Return Highest Point Position with VEX
eharetea

Return the highest position of a point in a set of points. This is accomplished using point clouds in VEX.

Useful expression for point positions.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Sunday January 31st, 2010 09:06 PM

/*
*
* VEX GEOMETRY OPERATOR 
* Author: Dan Lynch
*
*/


#pragma hint filename oppath
#pragma hint height hidden
sop
find_highest(string filename="";
            export float height = 0;
            export vector pos = 0)
{
    string file = concat("op:", filename);
    int numpoints = npoints(0);
    int pointcloud = pcopen(file, "P", P, 1000000, numpoints);

 

    while(pciterate(pointcloud))
    {
        vector tempVec;
        pcimport(pointcloud, "P", tempVec);
  
        if (tempVec.y > height)
        {
            height = tempVec.y;
            pos = tempVec;
        } 
    }

}

            


Downloads:
Download: return_highest.vfl 597 B

Please login or Click Here to register for downloads
Creative Commons License
Return Highest Point Position with VEX by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com