diff --git a/src/pyedb/dotnet/edb_core/edb_data/control_file.py b/src/pyedb/dotnet/edb_core/edb_data/control_file.py index 1193b1148e..076b85f575 100644 --- a/src/pyedb/dotnet/edb_core/edb_data/control_file.py +++ b/src/pyedb/dotnet/edb_core/edb_data/control_file.py @@ -193,6 +193,19 @@ def _write_xml(self, root): content.set("Thickness", self.properties.get("Thickness", "0.001")) if self.properties.get("Type"): content.set("Type", self.properties.get("Type", "conductor")) + if self.properties.get("ConvertPolygonToCircle"): + content.set("ConvertPolygonToCircle", self.properties["ConvertPolygonToCircle"]) + if self.properties.get("ConvertPolygonToCircleRatio"): + content.set("ConvertPolygonToCircleRatio", self.properties["ConvertPolygonToCircleRatio"]) + if self.properties.get("ReconstructArcs"): + content.set("ReconstructArcs", self.properties["ReconstructArcs"]) + if self.properties.get("ArcTolerance"): + content.set("ArcTolerance", self.properties["ArcTolerance"]) + if self.properties.get("UnionPrimitives"): + content.set("UnionPrimitives", self.properties["UnionPrimitives"]) + # To confirm syntax with development + if self.properties.get("DefeatureMinTraceWidth"): + content.set("DefeatureMinTraceWidth", self.properties["DefeatureMinTraceWidth"]) class ControlFileVia(ControlFileLayer): @@ -226,6 +239,14 @@ def _write_xml(self, root): content.set("Thickness", self.properties.get("Thickness", "0.001")) if self.properties.get("Type"): content.set("Type", self.properties.get("Type", "conductor")) + if self.properties.get("ConvertPolygonToCircle"): + content.set("ConvertPolygonToCircle", self.properties["ConvertPolygonToCircle"]) + if self.properties.get("ConvertPolygonToCircleRatio"): + content.set("ConvertPolygonToCircleRatio", self.properties["ConvertPolygonToCircleRatio"]) + if self.properties.get("ReconstructArcs"): + content.set("ReconstructArcs", self.properties["ReconstructArcs"]) + if self.properties.get("ArcTolerance"): + content.set("ArcTolerance", self.properties["ArcTolerance"]) if self.create_via_group: viagroup = ET.SubElement(content, "CreateViaGroups") viagroup.set("CheckContainment", "true" if self.check_containment else "false") diff --git a/tests/legacy/system/test_edb.py b/tests/legacy/system/test_edb.py index be7d5f2466..bb11bad5ce 100644 --- a/tests/legacy/system/test_edb.py +++ b/tests/legacy/system/test_edb.py @@ -1395,6 +1395,41 @@ def test_backdrill_via_with_offset(self): assert padstack_instance2.backdrill_bottom[2] == "100um" edb.close() + def test_add_via_with_options_control_file(self): + """Add new via layer with option in control file.""" + from pyedb.dotnet.edb_core.edb_data.control_file import ControlFile + + ctrl = ControlFile() + ctrl.stackup.add_layer( + "m2", + properties={ + "Elevation": "0.0", + "Material": "copper", + "Type": "conductor", + "Thickness": "1.0", + "UnionPrimitives": "true", + }, + ) + assert [layer for layer in ctrl.stackup.layers if layer.name == "m2"] + + ctrl.stackup.add_layer( + "m1", + properties={ + "Elevation": "1.0", + "Material": "copper", + "Type": "conductor", + "Thickness": "1.5", + "UnionPrimitives": "false", + "ConvertPolygonToCircle": "true", + }, + ) + assert [layer for layer in ctrl.stackup.layers if layer.properties["Elevation"] == "1.0"] + + ctrl.stackup.add_via( + "via12", properties={"StartLayer": "m2", "StopLayer": "m1", "ConvertPolygonToCircle": "true"} + ) + assert [via for via in ctrl.stackup.vias if via.properties["ConvertPolygonToCircle"] == "true"] + def test_add_layer_api_with_control_file(self): """Add new layers with control file.""" from pyedb.dotnet.edb_core.edb_data.control_file import ControlFile