2 people found this helpful
1) John, are you referring to an oriented bounding box? Matthew Cempa posted some code in Re: Finding max and min for each axis of body , that does a pretty good job for me. I packed the code from the post and it is attached.
2) I suppose you could use "GetArea" to select the largest face and then look at its Normal to determine if is mostly round/cylindrical. Curved edges will return a <0,0,0> vector. I included code for this in the attachment "SelectLargestFace."
Although better would be to find the oriented bounding cylinder. I am also interested in that.
The OrientedBoundingBox macro is awesome and works really good, but it does not guarantee the minimum volume bounding box.
See image 1. This body is not axis aligned and the macro work great.
Now look at Image 2. We have a large mass on one end. This is obviously not the height, width, length we're looking for.
The proper way to solve the minimum volume bounding box is to implement the algorithm by Joseph O'Rourke http://cs.smith.edu/~jorourke/Papers/MinVolBox.pdf . Unfortunately, it is very difficult and time-consuming. Taking the approximation from the moment of inertia is a reasonable solution for most objects.
However, another question comes to mind. How do SolidWorks weldment members know their minimum volume bounding box and other bodies do not?
This Oriented Bounding Box works to a certain extent, but not 100% everytime.
Is there a better solution to this if the body is not in line with any of the 3 planes?
Is it possible to identify the part if it is round and return the value as Ø
Thanks in advance!
is it possible to link this values with Part properties?
Yes, it's possible
If you are using the macro in my first post, it's already there
I found it