C++ boundingbox - how to get tight?

Today I was trying something I thought would be super simple. Draw a sphere, select it with a command, get the BREP and get its bounding box from C++ code.

I tried .BoundingBox(), .GetBoundingBox(…), .GetBBox(…) an .GetTightBoundingBox(…). None gave a true bounding box for spheres that were not centered to the origin.

Are there any examples on how to do this correctly?

Use RhinoGetTightBoundingBox. See rhinoSdkUtilities.h for more information.

Note, for Breps, tight bounding boxes are calculated from the object’s render mesh. If the object does not have a cached render mesh, one will be generated.

1 Like

Aha! Thanks :smile:

A sample if needed: