diff --git a/pyaedt/edb.py b/pyaedt/edb.py index e6571e0bb21..840e4482b98 100644 --- a/pyaedt/edb.py +++ b/pyaedt/edb.py @@ -2101,18 +2101,15 @@ def subtract(poly, voids): return poly.Subtract(convert_py_list_to_net_list(poly), convert_py_list_to_net_list(voids)) def clip_path(path): + pdata = path.polygon_data.edb_api + int_data = _poly.GetIntersectionType(pdata) + if int_data == 0: + prims_to_delete.append(path) + return result = path._edb_object.SetClipInfo(_poly, True) if not result: self.logger.info("Failed to clip path {}. Clipping as polygon.".format(path.id)) reference_prims.append(path) - else: - center_points = list(path._edb_object.GetCenterLine().Points) - new_points = [] - for i in range(len(center_points)): - if _poly.PointInPolygon(center_points[i]): - new_points.append(i) - if not new_points: - prims_to_delete.append(path) def clean_prim(prim_1): # pragma: no cover pdata = prim_1.polygon_data.edb_api diff --git a/pyaedt/edb_core/dotnet/primitive.py b/pyaedt/edb_core/dotnet/primitive.py index 63289fa9c62..abe6b6ef61f 100644 --- a/pyaedt/edb_core/dotnet/primitive.py +++ b/pyaedt/edb_core/dotnet/primitive.py @@ -746,7 +746,7 @@ def end_cap_style(self): **end_cap2** : End cap style of path end end cap. """ - return self.prim_obj.GetEndCapStyle() + return self._edb_object.GetEndCapStyle() @end_cap_style.setter def end_cap_style(self, end_cap1, end_cap2): @@ -759,7 +759,7 @@ def end_cap_style(self, end_cap1, end_cap2): end_cap2: :class:`PathEndCapType` End cap style of path end end cap. """ - self.prim_obj.SetEndCapStyle(end_cap1, end_cap2) + self._edb_object.SetEndCapStyle(end_cap1, end_cap2) @property def get_clip_info(self): @@ -777,7 +777,7 @@ def get_clip_info(self): **keep_inside** : Indicates whether the part of the path inside the polygon is preserved. """ - return self.prim_obj.GetClipInfo() + return self._edb_object.GetClipInfo() @get_clip_info.setter def get_clip_info(self, clipping_poly, keep_inside=True): @@ -790,7 +790,7 @@ def get_clip_info(self, clipping_poly, keep_inside=True): keep_inside: bool Indicates whether the part of the path inside the polygon should be preserved. """ - self.prim_obj.SetClipInfo( + self._edb_object.SetClipInfo( clipping_poly, keep_inside, )