From 306d07e7f036c39c517106ed3773a79cd215db49 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Thu, 11 Jul 2024 12:01:41 -0500 Subject: [PATCH 1/2] build_common.py -> correct value of MC from 1e-4 to 1e-3 --- src/build123d/build_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build123d/build_common.py b/src/build123d/build_common.py index 3fccefb3..2f2ade59 100644 --- a/src/build123d/build_common.py +++ b/src/build123d/build_common.py @@ -92,7 +92,7 @@ # # LENGTH CONSTANTS -MC = 0.0001 +MC = 0.001 MM = 1 CM = 10 * MM M = 1000 * MM From 209b772e1ef1f17042f707de16dc134a7db08c86 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Thu, 11 Jul 2024 12:04:48 -0500 Subject: [PATCH 2/2] exporters.py -> import UNITS_PER_METER from build_common instead and eliminate locally defined UNITS_PER_METER --- src/build123d/exporters.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/build123d/exporters.py b/src/build123d/exporters.py index 5498f9bd..4e66b1f2 100644 --- a/src/build123d/exporters.py +++ b/src/build123d/exporters.py @@ -65,6 +65,7 @@ Vector, VectorLike, ) +from build123d.build_common import UNITS_PER_METER PathSegment = Union[PT.Line, PT.Arc, PT.QuadraticBezier, PT.CubicBezier] @@ -249,17 +250,6 @@ def iso_pattern(*args): return result -# Scale factor to convert various units to meters. -UNITS_PER_METER = { - Unit.IN: 100 / 2.54, - Unit.FT: 100 / (12 * 2.54), - Unit.MC: 1_000_000, - Unit.MM: 1000, - Unit.CM: 100, - Unit.M: 1, -} - - def unit_conversion_scale(from_unit: Unit, to_unit: Unit) -> float: """Return the multiplicative conversion factor to go from from_unit to to_unit.""" result = UNITS_PER_METER[to_unit] / UNITS_PER_METER[from_unit]