検索 - User list
Full Version: Connecting Nearest Y axis point in point cloud
Root » Houdini Learning Materials » Connecting Nearest Y axis point in point cloud
egarton99
Hi All,

I am relatively new to Houdini, and am trying the connect points to their nearest y neighbour vertically. The points aren't perfectly aligned. I have attached a quick sketch (with red markup) to show the desired connections. Connect adjacent points connects to the x,z points as these are closest (attached.

Any suggestions would be greatly appreciated.

Thanks


animatrix_
Hi,

Here is one way:

int pts [ ] = pcfind ( 0, "P2", v@P2, ch("radius"), chi("maxpts") );
int foundpts [ ] = array ( );
foreach ( int pt; pts )
{
    int id = point ( 0, "class", pt );
    if ( i@class != id )
    {
        append ( foundpts, pt );
        break;
    }
}

if ( len ( foundpts ) > 0 )
    addprim ( 0, "polyline", @ptnum, foundpts [ 0 ] );


pixelninja
A simple global approach would be to crank up the radius and max points on the connect adjacent points then iterate over the polylines to delete any that are below your desired threshold of verticality.

Far less precise but might get you close to what you need.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB