Wrong bounding boxes after splitting a torus

Wrong bounding boxes after splitting a torus

nnikbin
Collaborator Collaborator
1,039 Views
2 Replies
Message 1 of 3

Wrong bounding boxes after splitting a torus

nnikbin
Collaborator
Collaborator

During an app development for Fusion 360 I notices an issue with splitting a torus. After splitting a torus, one of the returend bodies from SplitBodyFeature object has a wrong bounding box (the bounding box is the same as the original torus bounding box). The same issue exists when I split the torus with the fusion UI (Modify > Split Body). I didn't find the same issue in splitting Boxes, Cylinders, Spheres, Coils, Revolved objects, and any other object that I tested.

 

To illustrate the problem I created a program to draw bounding boxes as sketches. Here are some screen captures after splitting a sphere and a torus by XY construction plane. The bottom left picture shows the wrong bounding box.

 

Image_01.png

 

0 Likes
Accepted solutions (1)
1,040 Views
2 Replies
Replies (2)
Message 2 of 3

KrisKaplan
Autodesk
Autodesk
Accepted solution

BRepBody.boundingBox uses a method that favors speed over a tight fitting aligned bounding box.  So the box returned is guaranteed to enclose the body, but not necessarily to be the tightest fitting box.  In this case, one of the halfs of the split torus is based on the original surface geometry with a trimming face, while the other was using a subsetted copy of the surface geometry, and the bounds calculations are based on the geometry extents for some types, which is why it is including the entire original surface.  You can see that Fusion's graphics system is using the same bounds results if you use the 'Find in Window' command on each body, you'll notice the graphics window fit to the entire torus for that one half.

 

We should be able to do better in this case, but in general this API should not be expected to always return tight fitting boxes.  We could possibly provide another API where the bounds are optimized to be minimal at the expense of performance.  I'll file an issue to see if the split should really be subsetting the face's surface in this case.  If you require a more tight fitting bounding box now, you could get a display mesh from the body, and build the bounds from the min and max node coordinates in the orthographic directions (of course this will be a lot slower).

 

Kris



Kris Kaplan
0 Likes
Message 3 of 3

nnikbin
Collaborator
Collaborator

Hi Kris,

 

Thank you for your quick and detailed response. I think it will be good to mention these facts about boundingBox property in the API help, because as you know some algorithms need the tightest fitting box, and I guese many developers presume that the boundingBox property returns it.

 

Regards,

Navid

0 Likes