mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Updates helmert curve business2geometry mapping
This commit is contained in:
+9
-2
@@ -260,8 +260,15 @@ def _map_helmert_curve(file: ifcopenshell.file, design_parameters: entity_instan
|
|||||||
Transition=transition,
|
Transition=transition,
|
||||||
Placement=file.create_entity(
|
Placement=file.create_entity(
|
||||||
type="IfcAxis2Placement2D",
|
type="IfcAxis2Placement2D",
|
||||||
Location=file.createIfcCartesianPoint((x1, y1)),
|
Location=file.createIfcCartesianPoint(
|
||||||
RefDirection=file.createIfcDirection((math.cos(angle1), math.sin(angle1))),
|
(
|
||||||
|
start_point.Coordinates[0] + x1 * math.cos(start_direction) + y1 * math.sin(start_direction),
|
||||||
|
start_point.Coordinates[1] + x1 * math.sin(start_direction) - y1 * math.cos(start_direction),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
RefDirection=file.createIfcDirection(
|
||||||
|
(math.cos(start_direction + angle1), math.sin(start_direction + angle1))
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SegmentStart=file.createIfcLengthMeasure(length / 2),
|
SegmentStart=file.createIfcLengthMeasure(length / 2),
|
||||||
SegmentLength=file.createIfcLengthMeasure(length / 2),
|
SegmentLength=file.createIfcLengthMeasure(length / 2),
|
||||||
|
|||||||
+11
-8
@@ -1214,7 +1214,7 @@ def _HelmertCurve_100_0_300_1000_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.7998035122387, 3.91603145329256))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.7998035122387, -3.91603145329256))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.9892460407218963, 0.146260968532457)
|
(0.9892460407218963, 0.146260968532457)
|
||||||
)
|
)
|
||||||
@@ -1262,7 +1262,7 @@ def _HelmertCurve_100_0__300__1000_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.7998035122387, -3.91603145329256))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.7998035122387, 3.91603145329256))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.9892460407218963, -0.146260968532457)
|
(0.9892460407218963, -0.146260968532457)
|
||||||
)
|
)
|
||||||
@@ -1310,7 +1310,7 @@ def _HelmertCurve_100_0_300_inf_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.8122545525202, 3.81263503030693))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.8122545525202, -3.81263503030693))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.9904138664989948, 0.1381317235341378)
|
(0.9904138664989948, 0.1381317235341378)
|
||||||
)
|
)
|
||||||
@@ -1358,7 +1358,7 @@ def _HelmertCurve_100_0__300__inf_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.8122545525202, -3.81263503030693))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.8122545525202, 3.81263503030693))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.9904138664989948, -0.1381317235341378)
|
(0.9904138664989948, -0.1381317235341378)
|
||||||
)
|
)
|
||||||
@@ -1406,7 +1406,7 @@ def _HelmertCurve_100_0_1000_300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(1000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(1000.0)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9681012468824, 1.49252747074135))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9681012468824, -1.49252747074135))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.997594495159641, 0.0693197174487962)
|
(0.997594495159641, 0.0693197174487962)
|
||||||
)
|
)
|
||||||
@@ -1454,7 +1454,7 @@ def _HelmertCurve_100_0__1000__300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-1000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-1000.0)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9681012468824, -1.49252747074135))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9681012468824, 1.49252747074135))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.997594495159641, -0.0693197174487962)
|
(0.997594495159641, -0.0693197174487962)
|
||||||
)
|
)
|
||||||
@@ -1502,7 +1502,7 @@ def _HelmertCurve_100_0_inf_300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9972443634885, 0.347204361427475))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9972443634885, -0.347204361427475))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.999614222337484, 0.027769614722351524)
|
(0.999614222337484, 0.027769614722351524)
|
||||||
)
|
)
|
||||||
@@ -1550,7 +1550,7 @@ def _HelmertCurve_100_0__inf__300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
||||||
mapped_segment = mapped_segments[1]
|
mapped_segment = mapped_segments[1]
|
||||||
assert "DISCONTINUOUS" == mapped_segment.Transition
|
assert "DISCONTINUOUS" == mapped_segment.Transition
|
||||||
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9972443634885, -0.347204361427475))
|
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((49.9972443634885, 0.347204361427475))
|
||||||
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx(
|
||||||
(0.999614222337484, -0.027769614722351524)
|
(0.999614222337484, -0.027769614722351524)
|
||||||
)
|
)
|
||||||
@@ -2100,3 +2100,6 @@ def test_map_alignment_horizontal_segment():
|
|||||||
_SineCurve_100_0__inf__300_1_Meter(file)
|
_SineCurve_100_0__inf__300_1_Meter(file)
|
||||||
|
|
||||||
# VIENESSE BEND NOT IMPLEMENTED
|
# VIENESSE BEND NOT IMPLEMENTED
|
||||||
|
|
||||||
|
|
||||||
|
test_map_alignment_horizontal_segment()
|
||||||
|
|||||||
Reference in New Issue
Block a user