Delete Pieces with a volume smaller x
5961 13 2- piosbenni
- Member
- 12 posts
- Joined: May 2020
- Offline
- goingbananas
- Member
- 27 posts
- Joined: March 2020
- Offline
- mestela
- Member
- 1804 posts
- Joined: May 2006
- Online
- piosbenni
- Member
- 12 posts
- Joined: May 2020
- Offline
goingbananasSorry 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.
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.
Edited by piosbenni - March 4, 2021 00:56:15
- tamte
- Member
- 8853 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
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
FX Supervisor
Method Studios, NY
- Soothsayer
- Member
- 874 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.
--
Jobless
Jobless
- piosbenni
- Member
- 12 posts
- Joined: May 2020
- Offline
SoothsayerThank you, with some tinkering it worked. Sorry for the delay.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.
- vusta
- Member
- 555 posts
- Joined: Feb. 2017
- Offline
- piosbenni
- Member
- 12 posts
- Joined: May 2020
- Offline
- mestela
- Member
- 1804 posts
- Joined: May 2006
- Online
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...
- Librarian
- Member
- 142 posts
- Joined: Aug. 2009
- Offline
- piosbenni
- Member
- 12 posts
- Joined: May 2020
- Offline
mestelaOkay I will write to them
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...
- piosbenni
- Member
- 12 posts
- Joined: May 2020
- Offline
- Alexander_Nguyen
- Member
- 21 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 Alexander_Nguyen - March 15, 2021 00:49:32
-
- Quick Links