mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Fixes angle unit conversion when creating horizontal alignment from PI
This commit is contained in:
+5
-3
@@ -40,6 +40,8 @@ def layout_horizontal_alignment_by_pi_method(
|
|||||||
if not (len(hpoints) - 2 == len(radii)):
|
if not (len(hpoints) - 2 == len(radii)):
|
||||||
raise ValueError("radii should have two fewer elements that hpoints")
|
raise ValueError("radii should have two fewer elements that hpoints")
|
||||||
|
|
||||||
|
angle_unit_scale = ifcopenshell.util.unit.calculate_unit_scale(file, "PLANEANGLEUNIT")
|
||||||
|
|
||||||
xBT, yBT = hpoints[0]
|
xBT, yBT = hpoints[0]
|
||||||
xPI, yPI = hpoints[1]
|
xPI, yPI = hpoints[1]
|
||||||
|
|
||||||
@@ -84,7 +86,7 @@ def layout_horizontal_alignment_by_pi_method(
|
|||||||
StartTag=None,
|
StartTag=None,
|
||||||
EndTag=None,
|
EndTag=None,
|
||||||
StartPoint=pt,
|
StartPoint=pt,
|
||||||
StartDirection=angleBT,
|
StartDirection=angleBT / angle_unit_scale,
|
||||||
StartRadiusOfCurvature=0.0,
|
StartRadiusOfCurvature=0.0,
|
||||||
EndRadiusOfCurvature=0.0,
|
EndRadiusOfCurvature=0.0,
|
||||||
SegmentLength=tangent_run,
|
SegmentLength=tangent_run,
|
||||||
@@ -102,7 +104,7 @@ def layout_horizontal_alignment_by_pi_method(
|
|||||||
StartTag=None,
|
StartTag=None,
|
||||||
EndTag=None,
|
EndTag=None,
|
||||||
StartPoint=pc,
|
StartPoint=pc,
|
||||||
StartDirection=angleBT,
|
StartDirection=angleBT / angle_unit_scale,
|
||||||
StartRadiusOfCurvature=float(radius),
|
StartRadiusOfCurvature=float(radius),
|
||||||
EndRadiusOfCurvature=float(radius),
|
EndRadiusOfCurvature=float(radius),
|
||||||
SegmentLength=lc,
|
SegmentLength=lc,
|
||||||
@@ -130,7 +132,7 @@ def layout_horizontal_alignment_by_pi_method(
|
|||||||
StartTag=None,
|
StartTag=None,
|
||||||
EndTag=None,
|
EndTag=None,
|
||||||
StartPoint=pt,
|
StartPoint=pt,
|
||||||
StartDirection=angleBT,
|
StartDirection=angleBT / angle_unit_scale,
|
||||||
StartRadiusOfCurvature=0.0,
|
StartRadiusOfCurvature=0.0,
|
||||||
EndRadiusOfCurvature=0.0,
|
EndRadiusOfCurvature=0.0,
|
||||||
SegmentLength=tangent_run,
|
SegmentLength=tangent_run,
|
||||||
|
|||||||
Reference in New Issue
Block a user