Print at Dec 27, 2025, 11:17:49 AM View all posts in this thread on one page
Posted by Keet at Mar 21, 2023, 12:47:44 PM
Change the bounding box for an object
Is there a way to change the bounding box for an object without changing the size of the object itself?

I have 2 objects, virtually the same but one has small protrusions on 2 sides. This makes the bounding boxes of the two objects different. Stacking the smaller on top of the larger means I have to align top-left and then move the smaller one a little to fit on top of the larger one where it correctly aligns with the base part the larger object. Of course I know the numbers so this is easy but if I want to share those models it's difficult for other users.
There are several tricks to accomplish the correct alignment but they are all a little awkward for a user that doesn't know the internal numbers of the objects. I want to offer the simple align top-left for these models.

As I see it this can be accomplished if I can set a larger bounding box for the smaller object so the normal alignment tools can be used. This means setting a different top, left, bottom, and right line around the actual object without changing the size of the object itself. In a way it's like setting a cutout shape: define a different square without changing the size of the object. The object just gets a little extra space around to match the larger object. This also has the advantage that resizing both objects keeps the alignment as it should.

In the Home.xml file and in the PluginFurnitureCatalog.properties file you can set additional properties that are not available through the user interface (wall-distance, sash, etc). Are there properties available to set such a bounding box? I searched the API docs but I can't find if there is such a thing.
----------------------------------------
Dodecagon.nl
1300+ 3D models, manuals, and projects

Posted by Puybaret at Mar 21, 2023, 12:57:54 PM
Re: Change the bounding box for an object
The bounding box of the 3D model always matches the width x depth x height dimensions. If you want to cheat, you could add some invisible boxes to the model or create a group containing your model and the invisible parts.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by Keet at Mar 21, 2023, 3:15:27 PM
Re: Change the bounding box for an object
That works. I didn't know that objects with d 0.0 were still exported, they are 'invisible' after all.
It's not perfect, you get an extra material property 'invisibleBox' that has no use. Because of the specifications of the obj/mtl files you cant't change it into '(invisible)' or 'N/A', so I have to resort to something like 'NA', 'nothing', 'notused', or 'filler'. I haven't decided yet.

It does solve the bounding box problem and that was the most important.
----------------------------------------
Dodecagon.nl
1300+ 3D models, manuals, and projects