Open door bug. The Real Problem

This topic has been viewed 7693 times and has 3 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
Ferraro
Posts: 22
Joined: Wed Apr 16, 2014 6:25 pm

Open door bug. The Real Problem

Post by Ferraro »

I was developing an open door and discovered this bug. The current work-a-rounds are unsatisfactory since they involve either placing 2 objects, or turning-off magnetism. The source of the problem has to do with the units handling in Sweet Home. Sweet Home handles units in centimeters, and multiplies by 2.54 to size to inches. Some geometry attributes is stored in actual inches for dimension display on walls, while the other geometry is in centimeters (divided by 2.55 to display inches.) The reason the open door gets stretched when magnetism is turned on, is because of the code handling inches on the wall. To get a door to scale properly on a wall with magnetism turned on, you have to add the total depth of the door in inches to the wall thickness in cm. This will result in a squished looking door, however it will scale properly when used with magnetism.

For example, if you had a door .obj that had a depth of 30 inches, SH3D would multiply 30 x 2.54 to display the depth as 76.2 in your properties file. If you want that open door to display as 30 inches when magnetism is turned on , you would have to take 30 + your wall width in cm (in my case 4" wall so 4 x 2.54= 10.16). So if you set your depth property to 40.16, you will end up with a a squished door that sizes correctly when magnetism is used on the wall. This result worked for me with no issues other than having to have magnetism on. A simple multiplier in the code is either missing, or not working properly making one have to add a sum of inches to a sum of centimeters (door obj depth in inches + wall width in cm.)

Try with your own open door model and let me know the results.
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Open door bug. The Real Problem

Post by Puybaret »

Sorry, but "open door bug" as you call it has nothing to do with unit. See bug #154 for more information.
Emmanuel Puybaret, Sweet Home 3D creator
Ferraro
Posts: 22
Joined: Wed Apr 16, 2014 6:25 pm

Re: Open door bug. The Real Problem

Post by Ferraro »

Okay, perhaps I may be wrong about the units, nevertheless all my open doors are working with no distortion whatsoever. Here is a quick solution...
Insert one open door on a wall with magnetism on.
Insert one open door not attached to a wall.
Export all to .obj.
Measure the depth of both open doors in your favorite .obj editor
Calculate the percentage difference between the depth of each.
Subtract the difference in percentage from your depth property.
You might have to tweak the value by a tenth or so.

Done, open doors are now compensated for with magnetism on. Mine all work. Sorry I referred to an obvious error in calculating geometry as a "bug."

Good luck, hope this works for people.
Ferraro
Posts: 22
Joined: Wed Apr 16, 2014 6:25 pm

Re: Open door bug. The Real Problem

Post by Ferraro »

Okay so on average the open door is roughly 60% larger applied to a wall when magnetism is on than the original model without magnetism. Interestingly enough the percentage decrease from 2.54 to 1 is roughly 60%. 2.54 Being the number of centimeters in an inch. That makes a units conversion error hugely suspect in my book.
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest