Skip to content

Commit 583e8cb

Browse files
committed
FIX: rafactor example
1 parent 7e2b016 commit 583e8cb

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed
320 KB
Loading

examples/edb/legacy_standalone/differential_vias.py

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# # Parametric differential vias
1+
# # Coplanar Waveguide with Via Array
22
#
3-
# This example demonstrates how a differential via pair can be created using the EDB Python
3+
# This example demonstrates how a coplanar waveguide with via array can be created using the EDB Python
44
# interface.
55
#
6-
# The final differential via pair is shown below.
6+
# <img src="_static/cpw_via_array.png" width="500">
77
#
8-
# <img src="_static/diff_via.png" width="500">
9-
#
10-
# Keywords: **Differential Via**
8+
# Keywords: **coplanar waveguide, via array**
119

1210

1311
# ## Prerequisites
@@ -29,7 +27,7 @@
2927
# ### Start the EDB
3028

3129
# +
32-
aedb_path = os.path.join(temp_folder.name, "diff_via.aedb")
30+
aedb_path = os.path.join(temp_folder.name, "cpw_via_array.aedb")
3331
print(f"AEDB file path: {aedb_path}")
3432

3533
edb = pyedb.Edb(edbpath=aedb_path, edbversion=AEDT_VERSION)
@@ -43,31 +41,56 @@
4341
# [configuration file](https://examples.aedt.docs.pyansys.com/version/dev/examples/edb/use_configuration/import_stackup.html).
4442

4543
edb.stackup.add_layer("GND")
46-
edb.stackup.add_layer("Diel", "GND", layer_type="dielectric", thickness="0.1mm", material="FR4_epoxy")
44+
edb.stackup.add_layer("Diel", "GND", layer_type="dielectric", thickness="0.5mm", material="FR4_epoxy")
4745
edb.stackup.add_layer("TOP", "Diel", thickness="0.05mm")
4846

4947
# ### Create signal nets and ground planes
5048
# Create a signal net and ground planes.
5149

5250
points = [[0.0, 0], [100e-3, 0.0]]
53-
edb.modeler.create_trace(points, "TOP", width=1e-3)
51+
trace = edb.modeler.create_trace(points, "TOP", width=1e-3,end_cap_style="Flat",start_cap_style="Flat")
5452
points = [[0.0, 1e-3], [0.0, 10e-3], [100e-3, 10e-3], [100e-3, 1e-3], [0.0, 1e-3]]
55-
edb.modeler.create_polygon(points, "GND")
53+
edb.modeler.create_polygon(points, "TOP")
5654
points = [[0.0, -1e-3], [0.0, -10e-3], [100e-3, -10e-3], [100e-3, -1e-3], [0.0, -1e-3]]
55+
edb.modeler.create_polygon(points, "TOP")
56+
points = [[0.0, -10e-3], [0, 10e-3], [100e-3, 10e-3], [100e-3, -10e-3]]
5757
edb.modeler.create_polygon(points, "GND")
5858

59+
# ## Create wave ports on the main trace's ends.
60+
61+
edb.hfss.create_wave_port(prim_id = trace.id,point_on_edge = ["-10mm","10mm"],port_name="wport1")
62+
63+
edb.hfss.create_wave_port(prim_id = trace.id,point_on_edge = ["100mm","0mm"],port_name="wport2")
5964

6065
# ## Place vias
6166

6267
edb.padstacks.create("MyVia")
6368
edb.padstacks.place([5e-3, 5e-3], "MyVia")
6469
edb.padstacks.place([15e-3, 5e-3], "MyVia")
70+
edb.padstacks.place([25e-3, 5e-3], "MyVia")
6571
edb.padstacks.place([35e-3, 5e-3], "MyVia")
6672
edb.padstacks.place([45e-3, 5e-3], "MyVia")
73+
edb.padstacks.place([55e-3, 5e-3], "MyVia")
74+
edb.padstacks.place([65e-3, 5e-3], "MyVia")
75+
edb.padstacks.place([75e-3, 5e-3], "MyVia")
76+
edb.padstacks.place([85e-3, 5e-3], "MyVia")
77+
edb.padstacks.place([95e-3, 5e-3], "MyVia")
6778
edb.padstacks.place([5e-3, -5e-3], "MyVia")
6879
edb.padstacks.place([15e-3, -5e-3], "MyVia")
80+
edb.padstacks.place([25e-3, -5e-3], "MyVia")
6981
edb.padstacks.place([35e-3, -5e-3], "MyVia")
7082
edb.padstacks.place([45e-3, -5e-3], "MyVia")
83+
edb.padstacks.place([55e-3, -5e-3], "MyVia")
84+
edb.padstacks.place([65e-3, -5e-3], "MyVia")
85+
edb.padstacks.place([75e-3, -5e-3], "MyVia")
86+
edb.padstacks.place([85e-3, -5e-3], "MyVia")
87+
edb.padstacks.place([95e-3, -5e-3], "MyVia")
88+
89+
# ### Create simulation setup
90+
91+
setup = edb.create_hfss_setup(name= "Setup1")
92+
setup.set_solution_single_frequency("1GHz", max_num_passes=1, max_delta_s="0.02")
93+
setup.add_sweep(name="Sweep1")
7194

7295

7396
# ### View the nets

0 commit comments

Comments
 (0)