mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 23:19:57 +00:00
Fixes documentation and adds test for expected type
This commit is contained in:
+6
-1
@@ -28,7 +28,7 @@ def _create_offset_curve_representation(
|
|||||||
file: ifcopenshell.file, alignment: entity_instance, offsets: Sequence[entity_instance]
|
file: ifcopenshell.file, alignment: entity_instance, offsets: Sequence[entity_instance]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Create geometric representation for the alignment based on an IfcPolyline
|
Create geometric representation for the alignment based on an IfcOffsetByDistances curve
|
||||||
|
|
||||||
:param alignment: The alignment for which the representation is being created
|
:param alignment: The alignment for which the representation is being created
|
||||||
:return: None
|
:return: None
|
||||||
@@ -37,6 +37,11 @@ def _create_offset_curve_representation(
|
|||||||
if not alignment.is_a(expected_type):
|
if not alignment.is_a(expected_type):
|
||||||
raise TypeError(f"Expected {expected_type} but got {alignment.is_a()}")
|
raise TypeError(f"Expected {expected_type} but got {alignment.is_a()}")
|
||||||
|
|
||||||
|
expected_type = "IfcPointByDistaceExpression"
|
||||||
|
for offset in offsets:
|
||||||
|
if not offset.is_a(expected_type):
|
||||||
|
raise TypeError(f"Expected {expected_type} but got {offset.is_a()}")
|
||||||
|
|
||||||
axis_geom_subcontext = ifcopenshell.api.alignment.get_axis_subcontext(file)
|
axis_geom_subcontext = ifcopenshell.api.alignment.get_axis_subcontext(file)
|
||||||
|
|
||||||
basis_curve = offsets[0].BasisCurve # IfcPointByDistanceExpression.BasisCurve
|
basis_curve = offsets[0].BasisCurve # IfcPointByDistanceExpression.BasisCurve
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def create_as_offset_curve(
|
|||||||
|
|
||||||
:param file:
|
:param file:
|
||||||
:param name: name assigned to IfcAlignment.Name
|
:param name: name assigned to IfcAlignment.Name
|
||||||
:param offsets: offsets from the basis curve that defines the offset curve, expected to be IfcOffsetCurveByDistances.
|
:param offsets: offsets from the basis curve that defines the offset curve, expected to be IfcPointByDistanceExpression.
|
||||||
:param start_station: station value at the start of the alignment
|
:param start_station: station value at the start of the alignment
|
||||||
:return: Returns an IfcAlignment
|
:return: Returns an IfcAlignment
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user