Skip to content

Commit 55edd0a

Browse files
DOCS: Update diff vias example (#394)
Co-authored-by: Samuel Lopez <[email protected]>
1 parent 8cd12a4 commit 55edd0a

File tree

1 file changed

+41
-30
lines changed

1 file changed

+41
-30
lines changed
Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,52 @@
1-
# # EDB: geometry creation
2-
3-
# This example shows how you can use EDB to create a layout.
4-
# ## Final expected project
1+
# # Parametric differential vias
2+
#
3+
# This example demonstrates how a differential via pair can be created using the EDB Python
4+
# interface.
5+
#
6+
# The final differential via pair is shown below.
57
#
68
# <img src="_static/diff_via.png" width="500">
9+
#
10+
# Keywords: **Differential Via**
711

812

9-
# ## Perform imports and define constants
13+
# ## Prerequisites
1014
#
11-
# Perform required imports.
15+
# ### Perform imports
1216

13-
# +
1417
import os
1518
import tempfile
16-
1719
import pyedb
18-
# -
20+
21+
# ### Define constants
22+
# Constants help ensure consistency and avoid repetition throughout the example.
23+
24+
AEDT_VERSION = "2025.1"
25+
NG_MODE = False # Open AEDT UI when it is launched.
26+
27+
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
28+
29+
# ### Start the EDB
1930

2031
# +
21-
temp_dir = tempfile.TemporaryDirectory(suffix=".ansys")
22-
aedb_path = os.path.join(temp_dir.name, "create_via.aedb")
32+
aedb_path = os.path.join(temp_folder.name, "diff_via.aedb")
2333
print(f"AEDB file path: {aedb_path}")
2434

25-
# Select EDB version (change it manually if needed, e.g. "2025.1")
26-
edb_version = "2025.1"
27-
print(f"EDB version: {edb_version}")
28-
29-
edb = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version)
35+
edb = pyedb.Edb(edbpath=aedb_path, edbversion=AEDT_VERSION)
3036
# -
3137

32-
# ## Add stackup layers
33-
# Add stackup layers.
34-
# A stackup can be created layer by layer or imported from a CSV file or XML file.
38+
# ## Model Creation
39+
#
40+
# ### Add stackup layers
41+
#
42+
# A stackup can be created layer by layer or imported from a
43+
# [configuration file](https://examples.aedt.docs.pyansys.com/version/dev/examples/00_edb/use_configuration/import_stackup.html).
3544

3645
edb.stackup.add_layer("GND")
3746
edb.stackup.add_layer("Diel", "GND", layer_type="dielectric", thickness="0.1mm", material="FR4_epoxy")
3847
edb.stackup.add_layer("TOP", "Diel", thickness="0.05mm")
3948

40-
# ## Create signal net and ground planes
49+
# ### Create signal nets and ground planes
4150
# Create a signal net and ground planes.
4251

4352
points = [[0.0, 0], [100e-3, 0.0]]
@@ -48,8 +57,7 @@
4857
edb.modeler.create_polygon(points, "TOP")
4958

5059

51-
# ## Create vias with parametric positions
52-
# Create vias with parametric positions.
60+
# ## Place vias
5361

5462
edb.padstacks.create("MyVia")
5563
edb.padstacks.place([5e-3, 5e-3], "MyVia")
@@ -62,26 +70,29 @@
6270
edb.padstacks.place([45e-3, -5e-3], "MyVia")
6371

6472

65-
# ## Generate geometry plot
73+
# ### View the nets
6674

6775
edb.nets.plot(None, color_by_net=True)
6876

69-
# ## Generate stackup plot
77+
# ### View the stackup
7078

7179
edb.stackup.plot(plot_definitions="MyVia")
7280

73-
# ## Save and close EDB
81+
# ## Finish
82+
#
83+
# ### Save the project
7484
# Save and close EDB.
7585

7686
if edb:
7787
edb.save_edb()
7888
edb.close_edb()
7989
print("EDB saved correctly to {}. You can import in AEDT.".format(aedb_path))
8090

81-
# ### Clean up temporary directory
91+
# ### Clean up
8292
#
83-
# The following command removes the project and the temporary directory.
84-
# If you'd like to save this project, save it to a folder of your choice
85-
# prior to running the following cell.
93+
# All project files are saved in the folder ``temp_folder.name``.
94+
# If you've run this example as a Jupyter notebook, you
95+
# can retrieve those project files. The following cell
96+
# removes all temporary files, including the project folder.
8697

87-
temp_dir.cleanup()
98+
temp_folder.cleanup()

0 commit comments

Comments
 (0)