BoxHelper generates incorrect bounding box

Hi, I’ve been using Three.js for a project to prepare 3D models online for 3D printing. I’ve followed the solutions in similar questions but they don’t work. I’ve also taken a look at the Three.js editor itself, which actually also has this bug.

I’ll use the example from the Three.js editor. When I first load in my model, the bounding box is correct:

Then, when the object is rotated, the bounding box is incorrectly updated:

With the edges on the left side protruding more than they should.

Is it possible for BoxHelper to generate the expected bounding box? On closer inspection, it seems that a slanted bounding box is generated for the object, and the BoxHelper’s box is built around it. However, the code utilizes .updateMatrixWorld( true ) which should prevent this issue.

Thank you in advance. I’ve been wrestling with this bug for a few hours and can’t seem to crack it.

Here is the STL used in the demo:
Top Part Supportless.STL (930.0 KB)

1 Like

I’m having a similar issue. The bounding box of rotated models overextend and do not represent the true bounding box. Replying for visibility.

OP, did you find any information that would be useful to post here?

I have the same issue.

I see this issue has been raised in 2021, 2022 and now in 2023. Here is demo code of how to adjust a box around a rotated 3D model (click on [Randomize orientation] … to randomize the orientation):

https://codepen.io/boytchev/full/eYLxqjM

image

1 Like