Jump to content

Get max/min two points of each primtive inside a group.

Recommended Posts

Hi Everyone I'm currently trying to create circular point groups, inside a voronoi fracture. 
My outputs are groups currently are primitives but when I conver them to points, i have to many clustered together.
I'm thinking of a solution by either getting the max/min two points of each primitive inside my group and delete the other points from the group.

Unfortunately my VEX skills are very limited, I seem to be declaring my max function wrong.
If someone could help me figure it out that would be great, also an explanation to why my attempt didn't work/ any other solutions towards achieving the same result would be more than welcome.

Cheers :DExample.hipnc 

and for any questions im trying to make a tool that creates ground slams, as you can see there's distinct circular fractures which im trying to replicate, but also make procedural.


Share this post

Link to post
Share on other sites


I didn't check your scene but you can use getbbox VEX function that accepts a primitive group, or can use adhoc group syntax.

vector pmin = 0;

vector pmax = 0;

getbbox ( 0, myPrimGroup, pmin, pmax );

// Delete all points except these by checking distance2(@P, pmin/pmax) functions.


But this is only for AABB (axis aligned bounding box), if you want OBB (oriented bounding box), then you have to use more involved methods such as PCA, SVD, etc or just use a For Loop SOP network with Bound SOP (OBB=on).

Share this post

Link to post
Share on other sites

I don't think getting the bounding box of my group will help anything since I already have the groupsize, moreover some primitives are found in the same axis as lower prim ID's but I don't want to include those.
I'm trying to create hollow point groups out of a hollow primitive group, but only selecting the outer/inner points of the select primitives.

Please check out my file to see what I'm trying to do, I find it difficult to explain this :P.

I'll give it a try later tonight

Share this post

Link to post
Share on other sites

Ok I assumed you have a different group for each primitive. If not, you can just use the adhoc group syntax like "4" to mean primitive #4, etc.


Share this post

Link to post
Share on other sites


 you could go through your primitive groups with a foreach (so that it blasts the primitives not in the group),  fuse the points.. group by unshared edges,  set an attribute on the points in that group, then attribute transfer the attribute back to the rest of your prims (with a small threshold).

 I hope that makes sense.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now