This commit is contained in:
Andrej730
2025-08-11 11:23:07 +05:00
parent 8b1ffea91a
commit ce6505847a
6 changed files with 545 additions and 510 deletions
@@ -1605,277 +1605,294 @@ def _SineCurve_100_0__inf__300_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(3535.53390593274)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
def _VienneseBend_100_0_300_1000_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.1,
EndCantRight=0.03,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.1,
EndCantRight=0.03,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
def _VienneseBend_100_0__300__1000_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.1,
EndCantLeft=0.03,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.1,
EndCantLeft=0.03,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
def _VienneseBend_100_0_300_inf_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.1,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.1,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
def _VienneseBend_100_0__300__inf_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.1,
EndCantLeft=0.0,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.1,
EndCantLeft=0.0,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.05, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(-224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
def _VienneseBend_100_0_1000_300_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.03,
EndCantRight=0.1,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.03,
EndCantRight=0.1,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.015, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.015, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
def _VienneseBend_100_0__1000__300_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.03,
EndCantLeft=0.1,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.03,
EndCantLeft=0.1,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.015, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.015, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-185.93568367635672)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(169.87095595653895)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-180.0012184608678)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(241.1974890085123)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
def _VienneseBend_100_0_inf_300_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.0,
EndCantRight=0.1,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.0,
EndCantRight=0.1,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.0, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.0, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
def _VienneseBend_100_0__inf__300_1_Meter(file):
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.1,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND")
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.1,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(),
DesignParameters=design_parameters)
alignment_segment = file.createIfcAlignmentSegment(
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
)
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.0, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
mapped_segments = _map_alignment_cant_segment(file,alignment_segment, 1.5)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
assert mapped_segment.Placement.Location.Coordinates == pytest.approx((0.0, 0.0, 0.0))
assert mapped_segment.Placement.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0, 0.0))
assert mapped_segment.SegmentStart.wrappedValue == pytest.approx(0.0)
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-177.82794100389228)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(161.4322423756691)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-169.6127328157867)
assert mapped_segment.ParentCurve.QuarticTerm == pytest.approx(224.5910214113641)
assert mapped_segment.ParentCurve.CubicTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.QuadraticTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
def test_map_alignment_cant_segment():
file = ifcopenshell.file(schema="IFC4X3")
@@ -2031,53 +2031,54 @@ def _SineCurve_100_0__inf__300_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(-173.205080756888)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
def _VienneseBend_100_0_300_1000_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
# for viennese bends, the horizontal layout depends on the cant layout
# for this reason, define the cant segment before the horizontal segment
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartCantLeft=0.,
EndCantLeft=0.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.1,
EndCantRight=0.03,
PredefinedType="VIENNESEBEND"
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=300.0,
EndRadiusOfCurvature=1000.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=300.0,
EndRadiusOfCurvature=1000.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2087,7 +2088,7 @@ def _VienneseBend_100_0_300_1000_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(82.48484305114)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-67.097076273516)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(61.2742234216927)
@@ -2097,51 +2098,52 @@ def _VienneseBend_100_0_300_1000_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
def _VienneseBend_100_0__300__1000_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.1,
EndCantLeft=0.03,
StartCantRight=0.,
EndCantRight=0.,
PredefinedType="VIENNESEBEND"
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=-300.0,
EndRadiusOfCurvature=-1000.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=-300.0,
EndRadiusOfCurvature=-1000.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2151,7 +2153,7 @@ def _VienneseBend_100_0__300__1000_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-82.48484305114)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(67.097076273516)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-61.2742234216927)
@@ -2161,51 +2163,52 @@ def _VienneseBend_100_0__300__1000_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
def _VienneseBend_100_0_300_inf_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartCantLeft=0.,
EndCantLeft=0.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.1,
EndCantRight=0.,
PredefinedType="VIENNESEBEND"
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=300.0,
EndRadiusOfCurvature=0.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=300.0,
EndRadiusOfCurvature=0.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2215,7 +2218,7 @@ def _VienneseBend_100_0_300_inf_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(78.8880838459446)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-63.7638813456506)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(57.7378785242934)
@@ -2225,51 +2228,52 @@ def _VienneseBend_100_0_300_inf_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
def _VienneseBend_100_0__300__inf_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.1,
EndCantLeft=0.,
StartCantRight=0.,
EndCantRight=0.,
PredefinedType="VIENNESEBEND"
EndCantLeft=0.0,
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=-300.0,
EndRadiusOfCurvature=0.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=-300.0,
EndRadiusOfCurvature=0.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2279,7 +2283,7 @@ def _VienneseBend_100_0__300__inf_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-78.8880838459446)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(63.7638813456506)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-57.7378785242934)
@@ -2289,50 +2293,52 @@ def _VienneseBend_100_0__300__inf_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
def _VienneseBend_100_0_1000_300_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartCantLeft=0.,
EndCantLeft=0.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.03,
EndCantRight=0.1,
PredefinedType="VIENNESEBEND"
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=1000.0,
EndRadiusOfCurvature=300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=1000.0,
EndRadiusOfCurvature=300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2342,7 +2348,7 @@ def _VienneseBend_100_0_1000_300_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-82.48484305114)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(67.097076273516)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-61.2742234216927)
@@ -2352,50 +2358,52 @@ def _VienneseBend_100_0_1000_300_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(1000.0)
def _VienneseBend_100_0__1000__300_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.03,
EndCantLeft=0.1,
StartCantRight=0.,
EndCantRight=0.,
PredefinedType="VIENNESEBEND"
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=-1000.0,
EndRadiusOfCurvature=-300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=-1000.0,
EndRadiusOfCurvature=-300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2405,7 +2413,7 @@ def _VienneseBend_100_0__1000__300_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(82.48484305114)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-67.097076273516)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(61.2742234216927)
@@ -2415,50 +2423,52 @@ def _VienneseBend_100_0__1000__300_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-1000.0)
def _VienneseBend_100_0_inf_300_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartCantLeft=0.,
EndCantLeft=0.,
StartCantRight=0.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.0,
StartCantRight=0.0,
EndCantRight=0.1,
PredefinedType="VIENNESEBEND"
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=0.0,
EndRadiusOfCurvature=300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=0.0,
EndRadiusOfCurvature=300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2468,7 +2478,7 @@ def _VienneseBend_100_0_inf_300_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(-78.8880838459446)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(63.7638813456506)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(-57.7378785242934)
@@ -2478,50 +2488,52 @@ def _VienneseBend_100_0_inf_300_1_Meter(file):
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
def _VienneseBend_100_0__inf__300_1_Meter(file):
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
length = ifcopenshell.api.unit.add_si_unit(file,unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file,units=[length])
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
ifcopenshell.api.unit.assign_unit(file, units=[length])
alignment = ifcopenshell.api.alignment.create(file,"",include_vertical=True,include_cant=True)
alignment = ifcopenshell.api.alignment.create(file, "", include_vertical=True, include_cant=True)
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
cant_layout.RailHeadDistance=1.5
cant_layout.RailHeadDistance = 1.5
design_parameters = file.createIfcAlignmentCantSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartCantLeft=0.,
StartDistAlong=0.0,
HorizontalLength=100.0,
StartCantLeft=0.0,
EndCantLeft=0.1,
StartCantRight=0.,
EndCantRight=0.,
PredefinedType="VIENNESEBEND"
StartCantRight=0.0,
EndCantRight=0.0,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file,cant_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, cant_layout, design_parameters)
horizontal_layout = ifcopenshell.api.alignment.get_horizontal_layout(alignment)
design_parameters = file.createIfcAlignmentHorizontalSegment(
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=0.0,
EndRadiusOfCurvature=-300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND")
ifcopenshell.api.alignment.create_layout_segment(file,horizontal_layout,design_parameters)
StartPoint=file.createIfcCartesianPoint((0.0, 0.0)),
StartDirection=0.0,
StartRadiusOfCurvature=0.0,
EndRadiusOfCurvature=-300.0,
SegmentLength=100.0,
GravityCenterLineHeight=1.8,
PredefinedType="VIENNESEBEND",
)
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
design_parameters = file.createIfcAlignmentVerticalSegment(
StartDistAlong=0.,
HorizontalLength=100.,
StartHeight=0.,
StartGradient=0.,
EndGradient=0.,
PredefinedType = "CONSTANTGRADIENT"
StartDistAlong=0.0,
HorizontalLength=100.0,
StartHeight=0.0,
StartGradient=0.0,
EndGradient=0.0,
PredefinedType="CONSTANTGRADIENT",
)
ifcopenshell.api.alignment.create_layout_segment(file,vertical_layout,design_parameters)
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
alignment_segment = horizontal_layout.IsNestedBy[0].RelatedObjects[0]
mapped_segments = _map_alignment_horizontal_segment(file,alignment_segment)
mapped_segments = _map_alignment_horizontal_segment(file, alignment_segment)
mapped_segment = mapped_segments[0]
assert len(mapped_segments) == 2
assert "DISCONTINUOUS" == mapped_segment.Transition
@@ -2531,7 +2543,7 @@ def _VienneseBend_100_0__inf__300_1_Meter(file):
assert mapped_segment.SegmentLength.wrappedValue == pytest.approx(100.0)
assert mapped_segment.ParentCurve.is_a("IfcSeventhOrderPolynomialSpiral")
assert mapped_segment.ParentCurve.Position.Location.Coordinates == pytest.approx((0.0, 0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0,0.0))
assert mapped_segment.ParentCurve.Position.RefDirection.DirectionRatios == pytest.approx((1.0, 0.0))
assert mapped_segment.ParentCurve.SepticTerm == pytest.approx(78.8880838459446)
assert mapped_segment.ParentCurve.SexticTerm == pytest.approx(-63.7638813456506)
assert mapped_segment.ParentCurve.QuinticTerm == pytest.approx(57.7378785242934)