mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 04:59:52 +00:00
black .
This commit is contained in:
@@ -614,9 +614,11 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||||
curve = builder.rectangle(size=Vector((0.5, 0.5)) / unit_scale)
|
curve = builder.rectangle(size=Vector((0.5, 0.5)) / unit_scale)
|
||||||
|
|
||||||
if not (props.ifc_product == "IfcFeatureElement" and
|
if not (
|
||||||
props.ifc_class == "IfcOpeningElement" and
|
props.ifc_product == "IfcFeatureElement"
|
||||||
props.featured_obj):
|
and props.ifc_class == "IfcOpeningElement"
|
||||||
|
and props.featured_obj
|
||||||
|
):
|
||||||
item = builder.extrude(curve, magnitude=0.5 / unit_scale)
|
item = builder.extrude(curve, magnitude=0.5 / unit_scale)
|
||||||
else:
|
else:
|
||||||
featured_element = tool.Ifc.get_entity(props.featured_obj)
|
featured_element = tool.Ifc.get_entity(props.featured_obj)
|
||||||
@@ -629,12 +631,12 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
local_x = wall_matrix.to_3x3() @ Vector((1, 0, 0))
|
local_x = wall_matrix.to_3x3() @ Vector((1, 0, 0))
|
||||||
local_y = wall_matrix.to_3x3() @ Vector((0, 1, 0))
|
local_y = wall_matrix.to_3x3() @ Vector((0, 1, 0))
|
||||||
local_z = wall_matrix.to_3x3() @ Vector((0, 0, 1))
|
local_z = wall_matrix.to_3x3() @ Vector((0, 0, 1))
|
||||||
direction_sense = getattr(usage, 'DirectionSense', 'POSITIVE')
|
direction_sense = getattr(usage, "DirectionSense", "POSITIVE")
|
||||||
|
|
||||||
if usage.LayerSetDirection == "AXIS2":
|
if usage.LayerSetDirection == "AXIS2":
|
||||||
z_axis = tuple(local_y) if direction_sense == 'POSITIVE' else tuple(-local_y)
|
z_axis = tuple(local_y) if direction_sense == "POSITIVE" else tuple(-local_y)
|
||||||
elif usage.LayerSetDirection == "AXIS3":
|
elif usage.LayerSetDirection == "AXIS3":
|
||||||
z_axis = tuple(local_z) if direction_sense == 'POSITIVE' else tuple(-local_z)
|
z_axis = tuple(local_z) if direction_sense == "POSITIVE" else tuple(-local_z)
|
||||||
|
|
||||||
item = builder.extrude(
|
item = builder.extrude(
|
||||||
profile,
|
profile,
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ def _get_cant_segment(horizontal_segment: entity_instance) -> entity_instance:
|
|||||||
raise TypeError(f"Expected {expected_type} but got {horizontal_segment.is_a()}")
|
raise TypeError(f"Expected {expected_type} but got {horizontal_segment.is_a()}")
|
||||||
|
|
||||||
if not horizontal_segment.DesignParameters.is_a("IfcAlignmentHorizontalSegment"):
|
if not horizontal_segment.DesignParameters.is_a("IfcAlignmentHorizontalSegment"):
|
||||||
raise TypeError(f"Expect DesignParameter to be IfcAlignmentHorizontal but got {horizontal_segment.DesignParameters.is_a()}")
|
raise TypeError(
|
||||||
|
f"Expect DesignParameter to be IfcAlignmentHorizontal but got {horizontal_segment.DesignParameters.is_a()}"
|
||||||
|
)
|
||||||
|
|
||||||
# get the index of horizontal_segment in the horizontal_layout
|
# get the index of horizontal_segment in the horizontal_layout
|
||||||
horizontal_layout = horizontal_segment.Nests[0].RelatingObject
|
horizontal_layout = horizontal_segment.Nests[0].RelatingObject
|
||||||
@@ -72,6 +74,4 @@ def _get_cant_segment(horizontal_segment: entity_instance) -> entity_instance:
|
|||||||
if cant_segment:
|
if cant_segment:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
return cant_segment
|
return cant_segment
|
||||||
|
|
||||||
|
|||||||
@@ -392,10 +392,10 @@ def _map_viennese_bend(
|
|||||||
a1 = 0.0 # linear term
|
a1 = 0.0 # linear term
|
||||||
a2 = 0.0 * f # quadratic term
|
a2 = 0.0 * f # quadratic term
|
||||||
a3 = 0.0 * f # cubic term
|
a3 = 0.0 * f # cubic term
|
||||||
a4 = 35. * f # quartic term
|
a4 = 35.0 * f # quartic term
|
||||||
a5 = -84.*f # quintic term
|
a5 = -84.0 * f # quintic term
|
||||||
a6 = 70.*f # sextic term
|
a6 = 70.0 * f # sextic term
|
||||||
a7 = -20.*f # septic term
|
a7 = -20.0 * f # septic term
|
||||||
|
|
||||||
transition = "DISCONTINUOUS"
|
transition = "DISCONTINUOUS"
|
||||||
|
|
||||||
|
|||||||
+20
-16
@@ -437,7 +437,9 @@ def _map_viennese_bend(file: ifcopenshell.file, segment: entity_instance) -> Seq
|
|||||||
start_direction = design_parameters.StartDirection
|
start_direction = design_parameters.StartDirection
|
||||||
start_radius = design_parameters.StartRadiusOfCurvature
|
start_radius = design_parameters.StartRadiusOfCurvature
|
||||||
length = design_parameters.SegmentLength
|
length = design_parameters.SegmentLength
|
||||||
gravity_centerline_height = design_parameters.GravityCenterLineHeight if design_parameters.GravityCenterLineHeight != None else 0.0
|
gravity_centerline_height = (
|
||||||
|
design_parameters.GravityCenterLineHeight if design_parameters.GravityCenterLineHeight != None else 0.0
|
||||||
|
)
|
||||||
|
|
||||||
angle_unit_scale = ifcopenshell.util.unit.calculate_unit_scale(file, "PLANEANGLEUNIT")
|
angle_unit_scale = ifcopenshell.util.unit.calculate_unit_scale(file, "PLANEANGLEUNIT")
|
||||||
start_direction *= angle_unit_scale
|
start_direction *= angle_unit_scale
|
||||||
@@ -449,30 +451,32 @@ def _map_viennese_bend(file: ifcopenshell.file, segment: entity_instance) -> Seq
|
|||||||
start_cant_left = cant_segment.DesignParameters.StartCantLeft
|
start_cant_left = cant_segment.DesignParameters.StartCantLeft
|
||||||
end_cant_left = cant_segment.DesignParameters.EndCantLeft if cant_segment.DesignParameters.EndCantLeft else 0.0
|
end_cant_left = cant_segment.DesignParameters.EndCantLeft if cant_segment.DesignParameters.EndCantLeft else 0.0
|
||||||
start_cant_right = cant_segment.DesignParameters.StartCantRight
|
start_cant_right = cant_segment.DesignParameters.StartCantRight
|
||||||
end_cant_right = cant_segment.DesignParameters.EndCantRight if cant_segment.DesignParameters.EndCantRight else 0.0
|
end_cant_right = (
|
||||||
|
cant_segment.DesignParameters.EndCantRight if cant_segment.DesignParameters.EndCantRight else 0.0
|
||||||
|
)
|
||||||
cant_layout = cant_segment.Nests[0].RelatingObject
|
cant_layout = cant_segment.Nests[0].RelatingObject
|
||||||
rail_head_distance = cant_layout.RailHeadDistance
|
rail_head_distance = cant_layout.RailHeadDistance
|
||||||
else:
|
else:
|
||||||
start_cant_left = 0.
|
start_cant_left = 0.0
|
||||||
end_cant_left = 0.
|
end_cant_left = 0.0
|
||||||
start_cant_right = 0.
|
start_cant_right = 0.0
|
||||||
end_cant_right = 0.
|
end_cant_right = 0.0
|
||||||
rail_head_distance = 1.
|
rail_head_distance = 1.0
|
||||||
|
|
||||||
cant_angle_start = (start_cant_right - start_cant_left)/rail_head_distance if rail_head_distance else 0.
|
cant_angle_start = (start_cant_right - start_cant_left) / rail_head_distance if rail_head_distance else 0.0
|
||||||
cant_angle_end = (end_cant_right - end_cant_left)/rail_head_distance if rail_head_distance else 0.
|
cant_angle_end = (end_cant_right - end_cant_left) / rail_head_distance if rail_head_distance else 0.0
|
||||||
|
|
||||||
cant_factor = -420.*(gravity_centerline_height/length)*(cant_angle_end - cant_angle_start)
|
cant_factor = -420.0 * (gravity_centerline_height / length) * (cant_angle_end - cant_angle_start)
|
||||||
|
|
||||||
f = _get_curve_factor(design_parameters)
|
f = _get_curve_factor(design_parameters)
|
||||||
|
|
||||||
a0 = length / start_radius if start_radius != 0.0 else 0.0 # constant term
|
a0 = length / start_radius if start_radius != 0.0 else 0.0 # constant term
|
||||||
a1 = 0. # linear term
|
a1 = 0.0 # linear term
|
||||||
a2 = 1.*cant_factor # quadratic term
|
a2 = 1.0 * cant_factor # quadratic term
|
||||||
a3 = -4.*cant_factor # cubic term
|
a3 = -4.0 * cant_factor # cubic term
|
||||||
a4 = 5.*cant_factor + 35.*f # quartic term
|
a4 = 5.0 * cant_factor + 35.0 * f # quartic term
|
||||||
a5 = -2.*cant_factor - 84.*f # quintic term
|
a5 = -2.0 * cant_factor - 84.0 * f # quintic term
|
||||||
a6 = 70.*f # sextic term
|
a6 = 70.0 * f # sextic term
|
||||||
a7 = -20.0 * f # septic term
|
a7 = -20.0 * f # septic term
|
||||||
|
|
||||||
A0 = length * math.pow(math.fabs(a0), -1.0 / 1.0) * (a0 / math.fabs(a0)) if a0 != 0.0 else 0.0
|
A0 = length * math.pow(math.fabs(a0), -1.0 / 1.0) * (a0 / math.fabs(a0)) if a0 != 0.0 else 0.0
|
||||||
|
|||||||
@@ -1605,6 +1605,7 @@ def _SineCurve_100_0__inf__300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(3535.53390593274)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(3535.53390593274)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_300_1000_1_Meter(file):
|
def _VienneseBend_100_0_300_1000_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1613,11 +1614,12 @@ def _VienneseBend_100_0_300_1000_1_Meter(file):
|
|||||||
EndCantLeft=0.0,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.1,
|
StartCantRight=0.1,
|
||||||
EndCantRight=0.03,
|
EndCantRight=0.03,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1639,6 +1641,7 @@ def _VienneseBend_100_0_300_1000_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__300__1000_1_Meter(file):
|
def _VienneseBend_100_0__300__1000_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1647,11 +1650,12 @@ def _VienneseBend_100_0__300__1000_1_Meter(file):
|
|||||||
EndCantLeft=0.03,
|
EndCantLeft=0.03,
|
||||||
StartCantRight=0.0,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.0,
|
EndCantRight=0.0,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1673,6 +1677,7 @@ def _VienneseBend_100_0__300__1000_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_300_inf_1_Meter(file):
|
def _VienneseBend_100_0_300_inf_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1681,11 +1686,12 @@ def _VienneseBend_100_0_300_inf_1_Meter(file):
|
|||||||
EndCantLeft=0.0,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.1,
|
StartCantRight=0.1,
|
||||||
EndCantRight=0.0,
|
EndCantRight=0.0,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1707,6 +1713,7 @@ def _VienneseBend_100_0_300_inf_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__300__inf_1_Meter(file):
|
def _VienneseBend_100_0__300__inf_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1715,11 +1722,12 @@ def _VienneseBend_100_0__300__inf_1_Meter(file):
|
|||||||
EndCantLeft=0.0,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.0,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.0,
|
EndCantRight=0.0,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1741,6 +1749,7 @@ def _VienneseBend_100_0__300__inf_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(200000.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_1000_300_1_Meter(file):
|
def _VienneseBend_100_0_1000_300_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1749,11 +1758,12 @@ def _VienneseBend_100_0_1000_300_1_Meter(file):
|
|||||||
EndCantLeft=0.0,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.03,
|
StartCantRight=0.03,
|
||||||
EndCantRight=0.1,
|
EndCantRight=0.1,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1775,6 +1785,7 @@ def _VienneseBend_100_0_1000_300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__1000__300_1_Meter(file):
|
def _VienneseBend_100_0__1000__300_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1783,11 +1794,12 @@ def _VienneseBend_100_0__1000__300_1_Meter(file):
|
|||||||
EndCantLeft=0.1,
|
EndCantLeft=0.1,
|
||||||
StartCantRight=0.0,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.0,
|
EndCantRight=0.0,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1809,6 +1821,7 @@ def _VienneseBend_100_0__1000__300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(666666.666666667)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_inf_300_1_Meter(file):
|
def _VienneseBend_100_0_inf_300_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1817,11 +1830,12 @@ def _VienneseBend_100_0_inf_300_1_Meter(file):
|
|||||||
EndCantLeft=0.0,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.0,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.1,
|
EndCantRight=0.1,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1843,6 +1857,7 @@ def _VienneseBend_100_0_inf_300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__inf__300_1_Meter(file):
|
def _VienneseBend_100_0__inf__300_1_Meter(file):
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.0,
|
StartDistAlong=0.0,
|
||||||
@@ -1851,11 +1866,12 @@ def _VienneseBend_100_0__inf__300_1_Meter(file):
|
|||||||
EndCantLeft=0.1,
|
EndCantLeft=0.1,
|
||||||
StartCantRight=0.0,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.0,
|
EndCantRight=0.0,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
|
|
||||||
alignment_segment = file.createIfcAlignmentSegment(
|
alignment_segment = file.createIfcAlignmentSegment(
|
||||||
GlobalId=ifcopenshell.guid.new(),
|
GlobalId=ifcopenshell.guid.new(), DesignParameters=design_parameters
|
||||||
DesignParameters=design_parameters)
|
)
|
||||||
|
|
||||||
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
mapped_segments = _map_alignment_cant_segment(file, alignment_segment, 1.5)
|
||||||
mapped_segment = mapped_segments[0]
|
mapped_segment = mapped_segments[0]
|
||||||
@@ -1877,6 +1893,7 @@ def _VienneseBend_100_0__inf__300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
||||||
|
|
||||||
|
|
||||||
def test_map_alignment_cant_segment():
|
def test_map_alignment_cant_segment():
|
||||||
file = ifcopenshell.file(schema="IFC4X3")
|
file = ifcopenshell.file(schema="IFC4X3")
|
||||||
_BlossCurve_100_0_300_1000_1_Meter(file)
|
_BlossCurve_100_0_300_1000_1_Meter(file)
|
||||||
|
|||||||
+116
-104
@@ -2031,6 +2031,7 @@ def _SineCurve_100_0__inf__300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(-173.205080756888)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(-173.205080756888)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_300_1000_1_Meter(file):
|
def _VienneseBend_100_0_300_1000_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2043,14 +2044,13 @@ def _VienneseBend_100_0_300_1000_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.,
|
StartCantLeft=0.0,
|
||||||
EndCantLeft=0.,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.1,
|
StartCantRight=0.1,
|
||||||
EndCantRight=0.03,
|
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)
|
||||||
|
|
||||||
@@ -2062,17 +2062,18 @@ def _VienneseBend_100_0_300_1000_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=1000.0,
|
EndRadiusOfCurvature=1000.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
@@ -2097,6 +2098,7 @@ def _VienneseBend_100_0_300_1000_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__300__1000_1_Meter(file):
|
def _VienneseBend_100_0__300__1000_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2107,14 +2109,13 @@ def _VienneseBend_100_0__300__1000_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.1,
|
StartCantLeft=0.1,
|
||||||
EndCantLeft=0.03,
|
EndCantLeft=0.03,
|
||||||
StartCantRight=0.,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.,
|
EndCantRight=0.0,
|
||||||
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)
|
||||||
|
|
||||||
@@ -2126,17 +2127,18 @@ def _VienneseBend_100_0__300__1000_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=-1000.0,
|
EndRadiusOfCurvature=-1000.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
@@ -2161,6 +2163,7 @@ def _VienneseBend_100_0__300__1000_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_300_inf_1_Meter(file):
|
def _VienneseBend_100_0_300_inf_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2171,14 +2174,13 @@ def _VienneseBend_100_0_300_inf_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.,
|
StartCantLeft=0.0,
|
||||||
EndCantLeft=0.,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.1,
|
StartCantRight=0.1,
|
||||||
EndCantRight=0.,
|
EndCantRight=0.0,
|
||||||
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)
|
||||||
|
|
||||||
@@ -2190,17 +2192,18 @@ def _VienneseBend_100_0_300_inf_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=0.0,
|
EndRadiusOfCurvature=0.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
@@ -2225,6 +2228,7 @@ def _VienneseBend_100_0_300_inf_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(300.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__300__inf_1_Meter(file):
|
def _VienneseBend_100_0__300__inf_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2235,14 +2239,13 @@ def _VienneseBend_100_0__300__inf_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.1,
|
StartCantLeft=0.1,
|
||||||
EndCantLeft=0.,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.,
|
EndCantRight=0.0,
|
||||||
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)
|
||||||
|
|
||||||
@@ -2254,17 +2257,18 @@ def _VienneseBend_100_0__300__inf_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=0.0,
|
EndRadiusOfCurvature=0.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
@@ -2289,6 +2293,7 @@ def _VienneseBend_100_0__300__inf_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-300.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_1000_300_1_Meter(file):
|
def _VienneseBend_100_0_1000_300_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2299,13 +2304,13 @@ def _VienneseBend_100_0_1000_300_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.,
|
StartCantLeft=0.0,
|
||||||
EndCantLeft=0.,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.03,
|
StartCantRight=0.03,
|
||||||
EndCantRight=0.1,
|
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)
|
||||||
|
|
||||||
@@ -2317,17 +2322,18 @@ def _VienneseBend_100_0_1000_300_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=300.0,
|
EndRadiusOfCurvature=300.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
@@ -2352,6 +2358,7 @@ def _VienneseBend_100_0_1000_300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(1000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(1000.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__1000__300_1_Meter(file):
|
def _VienneseBend_100_0__1000__300_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2362,13 +2369,13 @@ def _VienneseBend_100_0__1000__300_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.03,
|
StartCantLeft=0.03,
|
||||||
EndCantLeft=0.1,
|
EndCantLeft=0.1,
|
||||||
StartCantRight=0.,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.,
|
EndCantRight=0.0,
|
||||||
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)
|
||||||
|
|
||||||
@@ -2380,17 +2387,18 @@ def _VienneseBend_100_0__1000__300_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=-300.0,
|
EndRadiusOfCurvature=-300.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
@@ -2415,6 +2423,7 @@ def _VienneseBend_100_0__1000__300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-1000.0)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(-1000.0)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0_inf_300_1_Meter(file):
|
def _VienneseBend_100_0_inf_300_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2425,13 +2434,13 @@ def _VienneseBend_100_0_inf_300_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.,
|
StartCantLeft=0.0,
|
||||||
EndCantLeft=0.,
|
EndCantLeft=0.0,
|
||||||
StartCantRight=0.,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.1,
|
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)
|
||||||
|
|
||||||
@@ -2443,17 +2452,18 @@ def _VienneseBend_100_0_inf_300_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=300.0,
|
EndRadiusOfCurvature=300.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
@@ -2478,6 +2488,7 @@ def _VienneseBend_100_0_inf_300_1_Meter(file):
|
|||||||
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.LinearTerm == pytest.approx(None)
|
||||||
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
assert mapped_segment.ParentCurve.ConstantTerm == pytest.approx(None)
|
||||||
|
|
||||||
|
|
||||||
def _VienneseBend_100_0__inf__300_1_Meter(file):
|
def _VienneseBend_100_0__inf__300_1_Meter(file):
|
||||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new())
|
||||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||||
@@ -2488,13 +2499,13 @@ def _VienneseBend_100_0__inf__300_1_Meter(file):
|
|||||||
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
cant_layout = ifcopenshell.api.alignment.get_cant_layout(alignment)
|
||||||
cant_layout.RailHeadDistance = 1.5
|
cant_layout.RailHeadDistance = 1.5
|
||||||
design_parameters = file.createIfcAlignmentCantSegment(
|
design_parameters = file.createIfcAlignmentCantSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartCantLeft=0.,
|
StartCantLeft=0.0,
|
||||||
EndCantLeft=0.1,
|
EndCantLeft=0.1,
|
||||||
StartCantRight=0.,
|
StartCantRight=0.0,
|
||||||
EndCantRight=0.,
|
EndCantRight=0.0,
|
||||||
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)
|
||||||
|
|
||||||
@@ -2506,17 +2517,18 @@ def _VienneseBend_100_0__inf__300_1_Meter(file):
|
|||||||
EndRadiusOfCurvature=-300.0,
|
EndRadiusOfCurvature=-300.0,
|
||||||
SegmentLength=100.0,
|
SegmentLength=100.0,
|
||||||
GravityCenterLineHeight=1.8,
|
GravityCenterLineHeight=1.8,
|
||||||
PredefinedType="VIENNESEBEND")
|
PredefinedType="VIENNESEBEND",
|
||||||
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, horizontal_layout, design_parameters)
|
||||||
|
|
||||||
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
vertical_layout = ifcopenshell.api.alignment.get_vertical_layout(alignment)
|
||||||
design_parameters = file.createIfcAlignmentVerticalSegment(
|
design_parameters = file.createIfcAlignmentVerticalSegment(
|
||||||
StartDistAlong=0.,
|
StartDistAlong=0.0,
|
||||||
HorizontalLength=100.,
|
HorizontalLength=100.0,
|
||||||
StartHeight=0.,
|
StartHeight=0.0,
|
||||||
StartGradient=0.,
|
StartGradient=0.0,
|
||||||
EndGradient=0.,
|
EndGradient=0.0,
|
||||||
PredefinedType = "CONSTANTGRADIENT"
|
PredefinedType="CONSTANTGRADIENT",
|
||||||
)
|
)
|
||||||
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
ifcopenshell.api.alignment.create_layout_segment(file, vertical_layout, design_parameters)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user