I’d like to report a possible issue with the Bounding Box component.
I was using Bounding Box to quickly extract the width and height of rectangular faces, but part of my script was failing. I eventually traced the issue to very small hidden decimal values appearing in the bounding box dimensions.
This seems unexpected because the faces are planar and perfectly aligned with the X and Y axes. They are simply generated by extruding a curve/vector in the Y direction with an amplitude of 4, so I would expect the resulting bounding box dimension in that direction to return exactly 4.
Interestingly, measuring the length directly outputs the correct value. The issue only appears when reading the dimensions from the bounding box, where tiny decimal deviations are introduced.
Hi Martin, what do you mean just a tolerance issue?
The problem is that if you use other components with the Bbox output, it creates errors… For instance if you try to use Find Domains it detects the wrong domain.
Under the assumption that the bounding box in Rhino is similar computed as shown here:
In this section it is quoted that bounding boxes are computed by finding extremes on the underlying Nurbs/Bezier segment. This involves some sort of root finding on derivatives like utilizing Cardanos algorithm.
This agains means that there a lot of multiplications involved in the computation, and since we are dealing here with floating point arithmetics, rounding errors are expected
That must be it. I’ll be more careful when using the Bounding Box component.
I had assumed that, for simple geometry like a rectangular face, the component would have some kind of early-exit condition to calculate the dimensions directly without introducing any deviations. But perhaps the algorithm is not quite as robust in that case.
What is indeed weird though, is how the same identical faces from the same process get a rounded figure and some other don’t, it seems quite random.
@martinsiegrist I think this is still a bug and not a practical impossibility, the component can be done more robust to avoid this.