This commit is contained in:
Andrej730
2025-07-14 16:29:07 +05:00
parent 73b76ba666
commit 72af88a4b3
6 changed files with 29 additions and 32 deletions
@@ -25,7 +25,9 @@ import math
from collections.abc import Sequence
def _create_polyline_representation(file: ifcopenshell.file, alignment: entity_instance, points: Sequence[Sequence[float]]) -> None:
def _create_polyline_representation(
file: ifcopenshell.file, alignment: entity_instance, points: Sequence[Sequence[float]]
) -> None:
"""
Create geometric representation for the alignment based on an IfcPolyline
@@ -40,9 +42,11 @@ def _create_polyline_representation(file: ifcopenshell.file, alignment: entity_i
placement = file.createIfcLocalPlacement(
PlacementRelTo=None,
RelativePlacement=file.createIfcAxis2Placement3D(Location=file.createIfcCartesianPoint(Coordinates=(0.0, 0.0, 0.0))),
RelativePlacement=file.createIfcAxis2Placement3D(
Location=file.createIfcCartesianPoint(Coordinates=(0.0, 0.0, 0.0))
),
)
curve = file.createIfcPolyLine(Points=points)
representation = file.createIfcShapeRepresentation(
@@ -52,6 +56,5 @@ def _create_polyline_representation(file: ifcopenshell.file, alignment: entity_i
Items=(curve,),
)
alignment.ObjectPlacement = placement
ifcopenshell.api.geometry.assign_representation(file, alignment, representation)