Delete Pieces with a volume smaller x

   504   13   2
User Avatar
Member
11 posts
Joined: May 2020
Offline
I want to delete all pieces of packed geometry with a volume smaller than x. I tried the measurement sop on packed geometry but it does not return any values.

Attachments:
HousDemolition.zip (1.3 MB)

User Avatar
Member
26 posts
Joined: March 2020
Offline
Where is your network showing how you try to delete the small pieces using the measure sop? I looked at your attached project and couldn't find it.
User Avatar
Member
1024 posts
Joined: May 2006
Offline
Yep, its REALLY annoying, asked for this to be a feature ages ago, no dice.

You'll either need to unpack, or use the intrinsics, or do a for each bound and transfer measure data, it really should be easier than this.
Edited by mestela - March 3, 2021 17:12:50
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://twitter.com/ThisIsRYOT [twitter.com]
User Avatar
Member
11 posts
Joined: May 2020
Offline
goingbananas
Where is your network showing how you try to delete the small pieces using the measure sop? I looked at your attached project and couldn't find it.
Sorry forgot to include that was just a delete sop with a @volume<2 but it only deletes the primitives and not the whole piece so I am stuck with open pieces.
Edited by piosbenni - March 4, 2021 00:56:15
User Avatar
Member
5296 posts
Joined: July 2007
Offline
you already have @class attribute so before packing you could do Measure SOP and change Accumulate to Per Piece, then your Blast @volume<2 would delte whole pieces whose volume is < 2 instead of individual polys, then your pack node will just pack whole pieces that are left

however your pieces are not really connected (enclosed/watertight), so connectivity splits the geo into many open pieces, but once you fix that it should work
Edited by tamte - March 4, 2021 01:33:23
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
705 posts
Joined: Oct. 2008
Offline
mestela
Yep, its REALLY annoying, asked for this to be a feature ages ago, no dice.

You'll either need to unpack, or use the intrinsics, or do a for each bound and transfer measure data, it really should be easier than this.

I think we should have some basic statistics functions or intrinsics available. min/max, average, etc. It becomes really tiring to noodle with att promotes or detail wrangles just for these things. I did a feature request a while ago. It would be so useful in this case too.
User Avatar
Member
11 posts
Joined: May 2020
Offline
Soothsayer
mestela
Yep, its REALLY annoying, asked for this to be a feature ages ago, no dice.

You'll either need to unpack, or use the intrinsics, or do a for each bound and transfer measure data, it really should be easier than this.

I think we should have some basic statistics functions or intrinsics available. min/max, average, etc. It becomes really tiring to noodle with att promotes or detail wrangles just for these things. I did a feature request a while ago. It would be so useful in this case too.
Thank you, with some tinkering it worked. Sorry for the delay.
User Avatar
Member
525 posts
Joined: Feb. 2017
Offline
bit fiddly, be nice if it works straight off the shelf.

Attachments:
vu_delSmalls.hipnc (140.7 KB)
smalls.gif (1.5 MB)

User Avatar
Member
11 posts
Joined: May 2020
Offline
vusta
bit fiddly, be nice if it works straight off the shelf.
Yes, thanks
User Avatar
Member
1024 posts
Joined: May 2006
Offline
Make sure to send an email to support@sidefx.com asking for the measure sop to measure volume of packed geo. The more customers who ask the more it'll bubble to the top of the to-do pile...
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://twitter.com/ThisIsRYOT [twitter.com]
Librarian
Member
136 posts
Joined: Aug. 2009
Offline
@piosbenni
Old Stuff or , maybe it Helps?

Attachments:
OliOdforcetesanSrdjanAsia.hiplc (186.1 KB)

User Avatar
Member
11 posts
Joined: May 2020
Offline
mestela
Make sure to send an email to support@sidefx.com asking for the measure sop to measure volume of packed geo. The more customers who ask the more it'll bubble to the top of the to-do pile...
Okay I will write to them
User Avatar
Member
11 posts
Joined: May 2020
Offline
Librarian
@piosbenni
Old Stuff or , maybe it Helps?
Yes thank you the vex worked to
User Avatar
Member
2 posts
Joined: Jan. 2018
Offline
 int npts = npoints(0);
float volume;
for(int i = 0; i < npts; i++){
float bounds[] = primintrinsic(0,"bounds",i);
vector min = set(bounds[0],bounds[2],bounds[4]);
vector max = set(bounds[1],bounds[3],bounds[5]);
float x = max.x-min.x;
float y = max.y-min.y;
float z = max.z-min.z;
volume = x*y*z;
setpointattrib(0,"volume",i,volume,"set");
if(volume < chf("volume_limit")){
removepoint(0,i);
}


}
Edited by AnQuoc - March 15, 2021 00:49:32
  • Quick Links