Fixes angle unit conversion when creating horizontal alignment from PI

This commit is contained in:
Richard Brice
2025-09-01 15:31:58 -07:00
parent d36205ea8b
commit eba3ced5fe
@@ -40,6 +40,8 @@ def layout_horizontal_alignment_by_pi_method(
if not (len(hpoints) - 2 == len(radii)):
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]
xPI, yPI = hpoints[1]
@@ -84,7 +86,7 @@ def layout_horizontal_alignment_by_pi_method(
StartTag=None,
EndTag=None,
StartPoint=pt,
StartDirection=angleBT,
StartDirection=angleBT / angle_unit_scale,
StartRadiusOfCurvature=0.0,
EndRadiusOfCurvature=0.0,
SegmentLength=tangent_run,
@@ -102,7 +104,7 @@ def layout_horizontal_alignment_by_pi_method(
StartTag=None,
EndTag=None,
StartPoint=pc,
StartDirection=angleBT,
StartDirection=angleBT / angle_unit_scale,
StartRadiusOfCurvature=float(radius),
EndRadiusOfCurvature=float(radius),
SegmentLength=lc,
@@ -130,7 +132,7 @@ def layout_horizontal_alignment_by_pi_method(
StartTag=None,
EndTag=None,
StartPoint=pt,
StartDirection=angleBT,
StartDirection=angleBT / angle_unit_scale,
StartRadiusOfCurvature=0.0,
EndRadiusOfCurvature=0.0,
SegmentLength=tangent_run,