I know using computePolysetVolume will find the volume of a mesh thats closed. But What if I need it for a mesh thats has open border?
{
float $bBox[] = `polyEvaluate -boundingBoxComponent`;
vector $bBoxMin = {$bBox[0], $bBox[1] ,$bBox[2]};
vector $bBoxMax = {$bBox[3], $bBox[4] ,$bBox[5]};
vector $subVector = $bBoxMax - $bBoxMin ;
float $volume = $subVector.x * $subVector.y * $subVector.z; //basic math for calculating volume length x width x height
print $volume;
}
This is my attempt. But failed badly. for some reason a smaller object yields are greater number with this code.
Solved! Go to Solution.
Solved by jordan.giboney. Go to Solution.
Solved by mspeer. Go to Solution.
Thanks for posting! @mspeer, I see that you helped them out in their other post in the main Maya forum 🙂 Any thoughts on this one as well?
Thanks for being a part of our community!
Jordan Giboney
Technical Solutions Engineer | Media & Entertainment
Installation & Licensing forums | Contact product support | Autodesk AREA
Hi!
The order/assignment of the bbox values is wrong, it needs to be:
vector $bBoxMin = {$bBox[0], $bBox[2] ,$bBox[4]};
vector $bBoxMax = {$bBox[1], $bBox[3] ,$bBox[5]};
Did you have a chance to review @mspeer's suggestion? Did this work for your project? 🙂
Thanks again for being a part of our forums!
Jordan Giboney
Technical Solutions Engineer | Media & Entertainment
Installation & Licensing forums | Contact product support | Autodesk AREA
Can't find what you're looking for? Ask the community or share your knowledge.