mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +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]
|
||||
) -> 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
|
||||
:return: None
|
||||
@@ -36,6 +36,11 @@ def _create_offset_curve_representation(
|
||||
expected_type = "IfcAlignment"
|
||||
if not alignment.is_a(expected_type):
|
||||
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)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ def create_as_offset_curve(
|
||||
|
||||
:param file:
|
||||
: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
|
||||
:return: Returns an IfcAlignment
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user