diff --git a/src/ansys/edb/core/geometry/polygon_data.py b/src/ansys/edb/core/geometry/polygon_data.py index fd794dd46b..fb0092b89f 100644 --- a/src/ansys/edb/core/geometry/polygon_data.py +++ b/src/ansys/edb/core/geometry/polygon_data.py @@ -109,7 +109,7 @@ def arc_data(self): h, incr = 0, 1 p1, p2 = self.points[i], self.points[(i + incr) % n] if p2.is_arc: - h, incr = p2.arc_height, 2 + h, incr = p2.arc_height.double, 2 p2 = self.points[(i + incr) % n] segments.append(ArcData(p1, p2, height=h)) i += incr @@ -225,9 +225,9 @@ def has_self_intersections(self, tol=1e-9): messages.polygon_data_with_tol_message(self, tol) ).value - @parser.to_polygon_data + @parser.to_polygon_data_list def remove_self_intersections(self, tol=1e-9): - """Create a polygon with all self-intersections removed. + """Remove self-intersections from this polygon. Parameters ---------- @@ -236,7 +236,8 @@ def remove_self_intersections(self, tol=1e-9): Returns ------- - PolygonData + list[.PolygonData] + A list of non self-intersecting polygons. """ return self.__stub.RemoveSelfIntersections( messages.polygon_data_with_tol_message(self, tol) diff --git a/src/ansys/edb/core/inner/messages.py b/src/ansys/edb/core/inner/messages.py index 205e38ee93..442a42d7ec 100644 --- a/src/ansys/edb/core/inner/messages.py +++ b/src/ansys/edb/core/inner/messages.py @@ -202,7 +202,7 @@ def point_property_message(target, point): def point_data_rotate_message(point, center, angle): """Convert to a ``PointRotateMessage`` object.""" return PointDataRotateMessage( - point=point_message(point), rotation_center=point_message(center), angle=angle + point=point_message(point), rotate_center=point_message(center), rotate_angle=angle ) @@ -310,7 +310,7 @@ def polygon_data_with_points_message(pd, point=None, polygon=None): elif polygon is not None: payload["polygon"] = polygon_data_message(polygon) - return PolygonDataWithPointsMessage(polygon=polygon_data_message(pd), **payload) + return PolygonDataWithPointsMessage(target=polygon_data_message(pd), **payload) def polygon_data_expand_message(pd, offset, tol, round_corner, max_corner_expansion): @@ -502,9 +502,9 @@ def point3d_message(point3d): return Point3DMessage(x=value_message(x), y=value_message(y), z=value_message(z)) -def point_3d_property_message(target, value): +def point_3d_property_message(target, val): """Convert to a ``Point3DPropertyMessage`` object.""" - return Point3DPropertyMessage(target=edb_obj_message(target), origin=point3d_message(value)) + return Point3DPropertyMessage(target=edb_obj_message(target), value=point3d_message(val)) def layout_get_items_message(layout, item_type): @@ -543,14 +543,14 @@ def temperature_settings_message(settings): ) -def hfss_extent_message(val): +def hfss_extent_message(hfss_val): """Convert to an ``ExtentMessage`` object.""" - if type(val) == float or type(val) == int: - value = val + if type(hfss_val) == float or type(hfss_val) == int: + val = hfss_val absolute = False else: - value, absolute = val - return HfssExtentMessage(value=value, absolute=absolute) + val, absolute = hfss_val + return HfssExtentMessage(value=val, absolute=absolute) def hfss_extent_info_message(hfss_info): @@ -722,7 +722,7 @@ def primitive_edge_params_message(primitive, point): def pad_edge_params_message(padstack_instance, layer, arc): """Convert to a ``PadEdgeParamsMessage`` object.""" return PadEdgeParamsMessage( - padstack_instance=padstack_instance.msg, + padstack=padstack_instance.msg, layer=layer_ref_message(layer), arc=arc_message(arc), ) @@ -932,13 +932,6 @@ def net_ref_message(net): return NetRefMessage(id=edb_obj_message(net.msg if net is not None else 0)) -def adaptive_frequency_message(frequency: str, max_delta_s: float, max_passes: int): - """Convert to an ``AdaptiveFrequencyDataMessage`` object.""" - return AdaptiveFrequencyDataMessage( - adaptive_frequency=frequency, max_delta=str(max_delta_s), max_passes=max_passes - ) - - def _length_mesh_operation_message(mesh_op): return LengthMeshOperationMessage( max_length=mesh_op.max_length, @@ -1097,15 +1090,17 @@ def differential_pair_creation_message(layout, name, pos_net, neg_net): return DifferentialPairCreationMessage( layout=edb_obj_message(layout), name=name, - pos_net=net_ref_message(pos_net), - neg_net=net_ref_message(neg_net), + positive_net=net_ref_message(pos_net), + negative_net=net_ref_message(neg_net), ) def differential_pair_net_refs_message(dp, pos_net, neg_net): """Convert to a ``DifferentialPairNetRefsMessage`` object.""" return DifferentialPairNetRefsMessage( - dp=edb_obj_message(dp), pos_net=net_ref_message(pos_net), neg_net=net_ref_message(neg_net) + dp=edb_obj_message(dp), + positive_net=net_ref_message(pos_net), + negative_net=net_ref_message(neg_net), ) diff --git a/src/ansys/edb/core/primitive/primitive.py b/src/ansys/edb/core/primitive/primitive.py index 009c2a1b7d..69cc029e33 100644 --- a/src/ansys/edb/core/primitive/primitive.py +++ b/src/ansys/edb/core/primitive/primitive.py @@ -618,7 +618,8 @@ def set_parameters(self, center_x, center_y, radius): ) ) - def get_polygon_data(self): + @property + def polygon_data(self): """:class:`.PolygonData`: \ Polygon data object of the circle.""" return Circle.render(*self.get_parameters(), self.is_void)