cpinto

cpinto

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

How to delete primitive based on distance from one another? Dec. 17, 2023, 6:08 p.m.

Ah ok, thanks for the help folks and explanations.

How to delete primitive based on distance from one another? Dec. 17, 2023, 1:31 p.m.

Oh wait, sorry I found it.

I just change the delete_prims wrangle from

"int index = findattribval ( 1, "point", "id", @primnum );
if ( index == -1 )
removeprim ( 0, @primnum, 1 );"

to

"int index = findattribval ( 1, "point", "id", @primnum );
if ( index > -1 )
removeprim ( 0, @primnum, 1 );"

How to delete primitive based on distance from one another? Dec. 17, 2023, 1:26 p.m.

animatrix_
Hi,

If you don't need to use connectivity, you can create a point per primitive and then perform a point cloud look up like this:

create_pts_per_prim (Primitive Wrangle):

addpoint ( 0, @P );
removeprim ( 0, @primnum, 1 );


id (Point Wrangle):

@id = @ptnum;


pcfind (Point Wrangle):

int pts [ ] = pcfind ( 0, "P", @P, ch("radius"), chi("maxpts") );
if ( len ( pts ) > 1 )
    removepoint ( 0, @ptnum );


delete_prims (Primitive Wrangle):

int index = findattribval ( 1, "point", "id", @primnum );
if ( index == -1 )
    removeprim ( 0, @primnum, 1 );



Heya Animatrix_,

Thanks for that, I tried it and it looks like it does the inverse? So it removed everything but the floating circle letter primitives. Is there a way in vex to say do the opposite. Thanks again.