Rounding of co-ordinates

This topic has been viewed 6181 times and has 2 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
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Rounding of co-ordinates

Post by okh »

This is probably a silly question - and not an important one - but I have noticed that sometimes when using exact centimetre values in walls and furniture in SH3D, the values are often off by a minute fraction in Home.xml (and exported .obj). E.g. a wall 17,5cm down becomes yStart='-17.499971' in Home.xml.

Not that it matters much, but I wonder whether there is a reason I do not understand.

ok
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Rounding of co-ordinates

Post by Puybaret »

The values in cm are rounded to the closest decimal in the user interface, but this value may be different in memory and then in the Home.xml file.

This gives me the opportunity to give a tip about handling precision in Sweet Home 3D: in all the spinner fields that accept decimal numbers, it's possible to enter a value with more decimals that the field displays and these additional decimals won't be forgotten when you confirm your choice.
For example, if you enter an angle of 1.54°, the field will still display 1.5°, but the actual value in memory will be 1.54°.
Emmanuel Puybaret, Sweet Home 3D creator
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: Rounding of co-ordinates

Post by okh »

Thanks, good to know. Still not entirely sure how those odd values appear, I probably must have slided the walls or something.

The reason I asked, was mostly that I discovered that when exporting a selected model from SH3D to do some more editing (e.g. to remove the normals [:)]), the values in the .obj file appeared relative to co-ords 0,0 in SH3D. Which again means that when I positioned the model with the corner in 0,0 the .obj file was easier to read later (and also shrunk because of fewer digits). A minor detail, but is quite helpful when trying to optimise accurate models.

ok
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest