Fixed error in PLAN_LEVEL elevation value in printed svgs #2961

Also added more precision to inPerFoot in helper.format_distance to avoid this a bit annoying precision problem where format function keeps adding 1/256"

Without precision - https://i.imgur.com/D9WYjvJ.png
With precision - https://i.imgur.com/3XgOFSH.png
This commit is contained in:
Andrej730
2023-04-11 18:48:12 +05:00
parent ac42f9f599
commit f002124c38
2 changed files with 2 additions and 2 deletions
@@ -131,7 +131,7 @@ def format_distance(value, isArea=False, hide_units=True):
unit_length = bpy.context.scene.unit_settings.length_unit
toInches = 39.3700787401574887
inPerFoot = 11.999
inPerFoot = 11.9999
if isArea:
toInches = 1550
@@ -794,7 +794,7 @@ class SvgWriter:
)
)
# TODO: allow metric to be configurable
rl = ((matrix_world @ points[0].co).xyz + obj.location).z
rl = (matrix_world @ points[0].co).z
if bpy.context.scene.unit_settings.system == "IMPERIAL":
rl = helper.format_distance(rl)
else: