-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c005d6d
commit e068fa0
Showing
1 changed file
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
jupytext: | ||
text_representation: | ||
extension: .mystnb | ||
format_name: myst | ||
format_version: 0.13 | ||
jupytext_version: 1.14.1 | ||
kernelspec: | ||
display_name: Python 3 (ipykernel) | ||
language: python | ||
name: python3 | ||
--- | ||
|
||
# EDB: geometry creation | ||
|
||
This example shows how you can use EDB to create a layout. | ||
|
||
+++ | ||
|
||
## Final expected project | ||
|
||
![Differential vias](../../_static/diff_via.png){ width=600 } | ||
|
||
## Import EDB layout object | ||
|
||
```{code-cell} ipython3 | ||
# Complex Fluent API Sketch - PCB | ||
|
||
import time | ||
import os | ||
import pyaedt | ||
|
||
start = time.time() | ||
|
||
aedb_path = os.path.join(pyaedt.generate_unique_folder_name(), pyaedt.generate_unique_name("pcb") + ".aedb") | ||
print(aedb_path) | ||
edb = pyaedt.Edb(edbpath=aedb_path, edbversion="2023.2") | ||
``` | ||
|
||
+++ | ||
|
||
## Add stackup layers | ||
|
||
Add stackup layers. | ||
A stackup can be created layer by layer or imported from a csv file or xml file. | ||
|
||
```{code-cell} ipython3 | ||
edb.stackup.add_layer("GND") | ||
edb.stackup.add_layer("Diel", "GND", layer_type="dielectric", thickness="0.1mm", material="FR4_epoxy") | ||
edb.stackup.add_layer("TOP", "Diel", thickness="0.05mm") | ||
``` | ||
|
||
|
||
## Create a signal net and ground planes | ||
|
||
```{code-cell} ipython3 | ||
points = [ | ||
[0.0, 0], | ||
[100e-3, 0.0], | ||
] | ||
edb.modeler.create_trace(points, "TOP", width=1e-3) | ||
points = [[0.0, 1e-3], [0.0, 10e-3], [100e-3, 10e-3], [100e-3, 1e-3], [0.0, 1e-3]] | ||
edb.modeler.create_polygon(points, "TOP") | ||
|
||
points = [[0.0, -1e-3], [0.0, -10e-3], [100e-3, -10e-3], [100e-3, -1e-3], [0.0, -1e-3]] | ||
edb.modeler.create_polygon(points, "TOP") | ||
``` | ||
|
||
|
||
## Create vias with parametric positions | ||
|
||
```{code-cell} ipython3 | ||
edb.padstacks.create("MyVia") | ||
edb.padstacks.place([5e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([15e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([35e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([45e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([5e-3, -5e-3], "MyVia") | ||
edb.padstacks.place([15e-3, -5e-3], "MyVia") | ||
edb.padstacks.place([35e-3, -5e-3], "MyVia") | ||
edb.padstacks.place([45e-3, -5e-3], "MyVia") | ||
``` | ||
|
||
|
||
## Geometry Plot | ||
|
||
```{code-cell} ipython3 | ||
edb.nets.plot(None, color_by_net=True) | ||
``` | ||
|
||
|
||
## Stackup Plot | ||
|
||
```{code-cell} ipython3 | ||
edb.stackup.plot(plot_definitions="MyVia") | ||
``` | ||
|
||
|
||
## Save and close EDB | ||
|
||
```{code-cell} ipython3 | ||
if edb: | ||
edb.save_edb() | ||
edb.close_edb() | ||
print("EDB saved correctly to {}. You can import in AEDT.".format(aedb_path)) | ||
end = time.time() - start | ||
print(end) | ||
``` |