Skip to content

Commit e15623d

Browse files
committed
FIX: Fix PolygonData intersection_type API
1 parent 81df63a commit e15623d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/ansys/edb/core/geometry/polygon_data.py

+16-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import itertools
55
import math
66

7-
from ansys.api.edb.v1 import edb_defs_pb2, point_data_pb2, polygon_data_pb2_grpc
7+
from ansys.api.edb.v1 import edb_defs_pb2, point_data_pb2, polygon_data_pb2, polygon_data_pb2_grpc
88

99
from ansys.edb.core import session
1010
from ansys.edb.core.geometry.arc_data import ArcData
@@ -27,6 +27,16 @@ class ExtentType(Enum):
2727
BOUNDING_BOX = edb_defs_pb2.BOUNDING_BOX
2828

2929

30+
class IntersectionType(Enum):
31+
"""Provides an enum representing intersection types for geometries."""
32+
33+
NO_INTERSECTION = polygon_data_pb2.NO_INTERSECTION
34+
THIS_INSIDE_OTHER = polygon_data_pb2.THIS_INSIDE_OTHER
35+
OTHER_INSIDE_THIS = polygon_data_pb2.OTHER_INSIDE_THIS
36+
COMMON_INTERSECTION = polygon_data_pb2.COMMON_INTERSECTION
37+
UNDEFINED_INTERSECTION = polygon_data_pb2.UNDEFINED_INTERSECTION
38+
39+
3040
class PolygonData:
3141
"""Represents a polygon data object."""
3242

@@ -434,11 +444,12 @@ def intersection_type(self, other, tol=1e-9):
434444
435445
Returns
436446
-------
437-
bool
438-
``True`` when successful, ``False`` when failed.
447+
IntersectionType
439448
"""
440-
return self.__stub.GetIntersectionType(
441-
messages.polygon_data_pair_with_tolerance_message(self, other, tol)
449+
return IntersectionType(
450+
self.__stub.GetIntersectionType(
451+
messages.polygon_data_pair_with_tolerance_message(self, other, tol)
452+
)
442453
)
443454

444455
def circle_intersect(self, center, radius):

0 commit comments

Comments
 (0)