deleting prims with centroid within bounday

   2959   8   2
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
hi,


how is it possible to check if prim's centroid is within an other specific volume (mesh)?

I know I can use the group so to test if points are within a volume and delete those points, but how would I do this for a primitive?

any input welcome!

thanks,
m.
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
something like this?

Attachments:
in_boundary.hip (77.3 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
perfect - spot-on!

thanks so much!
matt
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Here is a VEX solution that evaluates the normal directions of your mesh volume against the direction of the primitive centroids towards the closest points of the mesh volume.

Attachments:
prim_centroids_in_mesh.hipnc (259.8 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
Hi,

thanks for the additional input - that's a cool alternative!
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
hi .. re the solution by matthias_k.

I actually can't use this approach, as the ‘centroid points’ for concave polygons can actually be outside the polygon and therefore within the volume I test against, which causes errors. But thanks for the input!
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
where is your ‘centroid’ then in a case like this?

Attachments:
centroid_q1.jpg (12.1 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
:-)
many thanks for the response
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Hmmmm,
the question from Konstantin is perfect.
Maybe you need to convert every prim via primitive SOP to zero
and then check if the zero scaled prim points are inside your
“check against” geo.
But this can be slow, if I'm right
English is not my native language, sorry in advance for any misunderstanding :-)
  • Quick Links