Jump to content

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


callandekeijzer

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.

a640feead99356e59a6ce24759d1d374.jpg

Link to comment
Share on other sites

Hi,

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).

Link to comment
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

Link to comment
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.

 

 -G

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...