mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 13:04:49 +00:00
ifcopenshell.alignment - fix error in Python 3.9
match statement was added only in Python 3.10
This commit is contained in:
@@ -203,8 +203,7 @@ class IfcAlignmentHelper:
|
|||||||
else:
|
else:
|
||||||
transition = "CONTSAMEGRADIENTSAMECURVATURE"
|
transition = "CONTSAMEGRADIENTSAMECURVATURE"
|
||||||
|
|
||||||
match _type:
|
if _type == "LINE":
|
||||||
case "LINE":
|
|
||||||
parent_curve = self._file.create_entity(
|
parent_curve = self._file.create_entity(
|
||||||
type="IfcLine",
|
type="IfcLine",
|
||||||
Pnt=self._file.create_entity(
|
Pnt=self._file.create_entity(
|
||||||
@@ -235,13 +234,11 @@ class IfcAlignmentHelper:
|
|||||||
ParentCurve=parent_curve,
|
ParentCurve=parent_curve,
|
||||||
)
|
)
|
||||||
result = (curve_segment, None)
|
result = (curve_segment, None)
|
||||||
case "CIRCULARARC":
|
elif _type == "CIRCULARARC":
|
||||||
parent_curve = self._file.createIfcCircle(
|
parent_curve = self._file.createIfcCircle(
|
||||||
Position=self._file.createIfcAxis2Placement2D(
|
Position=self._file.createIfcAxis2Placement2D(
|
||||||
Location=self._file.createIfcCartesianPoint(Coordinates=(0.0, 0.0)),
|
Location=self._file.createIfcCartesianPoint(Coordinates=(0.0, 0.0)),
|
||||||
RefDirection=self._file.createIfcDirection(
|
RefDirection=self._file.createIfcDirection((math.cos(start_direction), math.sin(start_direction))),
|
||||||
(math.cos(start_direction), math.sin(start_direction))
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Radius=abs(start_radius),
|
Radius=abs(start_radius),
|
||||||
)
|
)
|
||||||
@@ -252,9 +249,7 @@ class IfcAlignmentHelper:
|
|||||||
Placement=self._file.create_entity(
|
Placement=self._file.create_entity(
|
||||||
type="IfcAxis2Placement2D",
|
type="IfcAxis2Placement2D",
|
||||||
Location=start_point,
|
Location=start_point,
|
||||||
RefDirection=self._file.createIfcDirection(
|
RefDirection=self._file.createIfcDirection((math.cos(start_direction), math.sin(start_direction))),
|
||||||
(math.cos(start_direction), math.sin(start_direction))
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SegmentStart=self._file.createIfcLengthMeasure(0.0),
|
SegmentStart=self._file.createIfcLengthMeasure(0.0),
|
||||||
SegmentLength=self._file.createIfcLengthMeasure(length * start_radius / abs(start_radius)),
|
SegmentLength=self._file.createIfcLengthMeasure(length * start_radius / abs(start_radius)),
|
||||||
@@ -262,7 +257,7 @@ class IfcAlignmentHelper:
|
|||||||
)
|
)
|
||||||
result = (curve_segment, None)
|
result = (curve_segment, None)
|
||||||
|
|
||||||
case _:
|
else:
|
||||||
result = (None, None)
|
result = (None, None)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user