Skip to content

Commit f942d5c

Browse files
Merge pull request #251 from robbievanleeuwen/geometry_instantiation_fix
Added check for when control_point is an instance shapely.geometry.Point
2 parents acb77bb + 732ca47 commit f942d5c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sectionproperties/pre/geometry.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(
5353
self,
5454
geom: shapely.geometry.Polygon,
5555
material: pre.Material = pre.DEFAULT_MATERIAL,
56-
control_points: Optional[List[float, float]] = None,
56+
control_points: Optional[Union[Point, List[float, float]]] = None,
5757
tol=12,
5858
):
5959
"""Inits the Geometry class."""
@@ -64,7 +64,9 @@ def __init__(
6464
f"Argument is not a valid shapely.geometry.Polygon object: {repr(geom)}"
6565
)
6666
self.assigned_control_point = None
67-
if control_points is not None and len(control_points) == 2:
67+
if control_points is not None and (
68+
isinstance(control_points, Point) or len(control_points) == 2
69+
):
6870
self.assigned_control_point = Point(control_points)
6971
self.tol = (
7072
tol # Represents num of decimal places of precision for point locations

0 commit comments

Comments
 (0)