.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\00-EDB\00_EDB_Create_VIA.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_00-EDB_00_EDB_Create_VIA.py: EDB: geometry creation ---------------------- This example shows how you can use EDB to create a layout. .. GENERATED FROM PYTHON SOURCE LINES 7-14 Final expected project ~~~~~~~~~~~~~~~~~~~~~~ .. image:: ../../_static/diff_via.png :width: 600 :alt: Differential Vias. ##################################################################### .. GENERATED FROM PYTHON SOURCE LINES 16-20 Import EDB layout object ~~~~~~~~~~~~~~~~~~~~~~~~ Import the EDB layout object and initialize it on version 2023 R2. ##################################################################### .. GENERATED FROM PYTHON SOURCE LINES 20-31 .. code-block:: default 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") .. rst-class:: sphx-glr-script-out .. code-block:: none D:\Temp\pyaedt_prj_9OL\pcb_AH034U.aedb .. GENERATED FROM PYTHON SOURCE LINES 32-37 Add stackup layers ~~~~~~~~~~~~~~~~~~ Add stackup layers. A stackup can be created layer by layer or imported from a csv file or xml file. .. GENERATED FROM PYTHON SOURCE LINES 37-42 .. code-block:: default 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") .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 43-46 Create signal net and ground planes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Create a signal net and ground planes. .. GENERATED FROM PYTHON SOURCE LINES 46-58 .. code-block:: default 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") .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 59-62 Create vias with parametric positions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Create vias with parametric positions. .. GENERATED FROM PYTHON SOURCE LINES 62-74 .. code-block:: default 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") .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 75-78 Geometry Plot ~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 78-80 .. code-block:: default edb.nets.plot(None, color_by_net=True) .. image-sg:: /examples/00-EDB/images/sphx_glr_00_EDB_Create_VIA_001.png :alt: Cell_6OTSRC :srcset: /examples/00-EDB/images/sphx_glr_00_EDB_Create_VIA_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 81-84 Stackup Plot ~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 84-87 .. code-block:: default edb.stackup.plot(plot_definitions="MyVia") .. image-sg:: /examples/00-EDB/images/sphx_glr_00_EDB_Create_VIA_002.png :alt: Stackup :srcset: /examples/00-EDB/images/sphx_glr_00_EDB_Create_VIA_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 88-91 Save and close EDB ~~~~~~~~~~~~~~~~~~ Save and close EDB. .. GENERATED FROM PYTHON SOURCE LINES 91-98 .. code-block:: default 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) .. rst-class:: sphx-glr-script-out .. code-block:: none EDB saved correctly to D:\Temp\pyaedt_prj_9OL\pcb_AH034U.aedb. You can import in AEDT. 12.749271869659424 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 12.781 seconds) .. _sphx_glr_download_examples_00-EDB_00_EDB_Create_VIA.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 00_EDB_Create_VIA.py <00_EDB_Create_VIA.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 00_EDB_Create_VIA.ipynb <00_EDB_Create_VIA.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_