Delete by bbox size (SOP)

   4763   4   1
User Avatar
Member
17 posts
Joined: May 2016
Offline
Hello,

I'm trying to find a way to delete small ‘cables’ from this little network.
So my guess is to use the foreach node to browse between all the primitives entries, and using an expression based on bbox to delete small cables.

Obviously the expression is wrong :

if (bbox(“../foreach_begin1/”, D_ZSIZE) > 5, 1, 0) … I pretty sure the “../foreach_begin1/” doesn't make any sence, but I have no idea what to give for the path for the bbox expression.

I would really appreciate any input, or maybe video link related to this

Thanks a lot !
Edited by PascalBkm - May 26, 2016 20:36:03

Attachments:
DeleteBySizeSG.jpg (334.2 KB)

User Avatar
Member
17 posts
Joined: May 2016
Offline
Btw here's the test scene.

Attachments:
DeleteBySize.hipnc (61.2 KB)

User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Interesting .

I would instead in a foreach , create a point at the centroid of each line, then using a point cloud measure the distance to the centroid from each point in the lines. of course short lines will have short distance values. That distance becomes the threshold to delete by.

Rob
Gone fishing
User Avatar
Member
8569 posts
Joined: July 2007
Offline
you don't have to use foreach at all
just do single Primitive Wrangle with code like:
if (primintrinsic(0, "measuredperimeter", @primnum) < chf("minlength") ) removeprim(0, @primnum, 1);
to delete lines based on their perimeter (length) if it's smaller than minlength parm

Attachments:
DeleteBySize_fix.hipnc (65.5 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
17 posts
Joined: May 2016
Offline
Thank you very much guys !

and thank you Tomas for taking the time to post an example scene, I really appreciate !
  • Quick Links