Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 3
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 886 times and has 2 replies Next Thread
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 780
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Mar 21, 2023, 11:47:44 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9176
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[Mar 21, 2023, 11:57:54 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 780
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Mar 21, 2023, 2:15:27 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved