diff --git a/doc/source/api/geometry.rst b/doc/source/api/geometry.rst index 5b2c16fa12..21e75c9cc5 100644 --- a/doc/source/api/geometry.rst +++ b/doc/source/api/geometry.rst @@ -24,3 +24,4 @@ Enums polygon_data.ExtentType polygon_data.PolygonSenseType + polygon_data.IntersectionType diff --git a/src/ansys/edb/core/geometry/polygon_data.py b/src/ansys/edb/core/geometry/polygon_data.py index fb0092b89f..488f4b40b3 100644 --- a/src/ansys/edb/core/geometry/polygon_data.py +++ b/src/ansys/edb/core/geometry/polygon_data.py @@ -4,7 +4,7 @@ import itertools import math -from ansys.api.edb.v1 import edb_defs_pb2, point_data_pb2, polygon_data_pb2_grpc +from ansys.api.edb.v1 import edb_defs_pb2, point_data_pb2, polygon_data_pb2, polygon_data_pb2_grpc from ansys.edb.core import session from ansys.edb.core.geometry.arc_data import ArcData @@ -27,6 +27,16 @@ class ExtentType(Enum): BOUNDING_BOX = edb_defs_pb2.BOUNDING_BOX +class IntersectionType(Enum): + """Provides an enum representing intersection types for geometries.""" + + NO_INTERSECTION = polygon_data_pb2.NO_INTERSECTION + THIS_INSIDE_OTHER = polygon_data_pb2.THIS_INSIDE_OTHER + OTHER_INSIDE_THIS = polygon_data_pb2.OTHER_INSIDE_THIS + COMMON_INTERSECTION = polygon_data_pb2.COMMON_INTERSECTION + UNDEFINED_INTERSECTION = polygon_data_pb2.UNDEFINED_INTERSECTION + + class PolygonData: """Represents a polygon data object.""" @@ -434,11 +444,12 @@ def intersection_type(self, other, tol=1e-9): Returns ------- - bool - ``True`` when successful, ``False`` when failed. + :class:`IntersectionType` """ - return self.__stub.GetIntersectionType( - messages.polygon_data_pair_with_tolerance_message(self, other, tol) + return IntersectionType( + self.__stub.GetIntersectionType( + messages.polygon_data_pair_with_tolerance_message(self, other, tol) + ).intersection_type ) def circle_intersect(self, center, radius):