Path#
- class pyedb.grpc.database.primitive.path.Path(pedb, core=None)#
Bases:
pyedb.grpc.database.primitive.primitive.PrimitiveManages EDB functionalities for a primitives. It inherits EDB Object properties.
Examples
>>> from pyedb import Edb >>> edb = Edb("myedb", version="2026.1", grpc=True) >>> edb_prim = edb.layout.primitives[0]
Overview#
Create a path in the specified layout, layer, and net with the given parameters. |
Add a point at the end of the path. |
|
Clone a primitive object with keeping same definition and location. |
|
|
|
Create via fences on both sides of the trace. |
|
Retrieve center line points list. |
|
Return the data needed to draw the path as a thick line instead of a polygon. |
|
Move the path by a given vector. |
Path width in meters. |
|
Path length in meters. |
|
Path center line |
|
Path’s corner style as string. |
|
Path’s start style as string. |
|
Path’s end style as string. |
Import detail#
from pyedb.grpc.database.primitive.path import Path
Property detail#
- property Path.width: pyedb.grpc.database.utility.value.Value | float | int#
Path width in meters.
- property Path.corner_style: str#
Path’s corner style as string.
- Returns:
strValues supported for the setter “round”, “mitter”, “sharp”
Method detail#
- classmethod Path.create(layout, layer: str | pyedb.grpc.database.layers.layer.Layer = None, net: str | Net = None, width: float | int | str | pyedb.grpc.database.utility.value.Value = 0.0001, end_cap1: str | ansys.edb.core.primitive.path.PathEndCapType = 'flat', end_cap2: str | ansys.edb.core.primitive.path.PathEndCapType = 'flat', corner_style: str | ansys.edb.core.primitive.path.PathCornerType = 'sharp', points: list | ansys.edb.core.geometry.polygon_data.PolygonData = None)#
Create a path in the specified layout, layer, and net with the given parameters.
- Parameters:
- layout
Layout,optional The layout in which the path will be created. If not provided, the active layout of the pedb instance will be used.
- layer
Union[str,Layer],optional The layer in which the path will be created. This parameter is required and must be specified.
- net
Union[str,Net],optional The net to which the path will belong. If not provided, the path will not be associated with a net.
- width
Union[float,str,Value],optional The width of the path. Accepts a numeric value in meters, a string with units (e.g.
"100um"), or aValueobject for parameterized widths. The default value is100e-6.- end_cap1
str,optional The style of the first end cap. Options are “flat”, “round”, “extended”, and “clipped”. The default value is “flat”.
- end_cap2
str,optional The style of the second end cap. Options are “flat”, “round”, “extended”, and “clipped”. The default value is “flat”.
- corner_style
str,optional The style of the path corners. Options are “sharp”, “round”, and “mitter”. The default value is “sharp”.
- points
Union[list,GrpcPolygonData],optional The points defining the path. This can be a list of points or an instance of GrpcPolygonData. This parameter is required and must be specified.
- layout
- Returns:
PathThe created path object.
- Raises:
ValueErrorIf the points parameter is not provided.
Notes
If points is provided as a list, it will be converted to a GrpcPolygonData object.
The created path is added to the modeler primitives of the pedb instance.
- Path.add_point(x, y, incremental=True) bool#
Add a point at the end of the path.
- Parameters:
- x: str, int, float
X coordinate.
- y: str, in, float
Y coordinate.
- incremental: bool
Add point incrementally. If True, coordinates of the added point is incremental to the last point. The default value is
True.
- Returns:
- Path.clone()#
Clone a primitive object with keeping same definition and location.
- Returns:
- bool
Truewhen successful,Falsewhen failed.
- Path.create_edge_port(name, position='End', port_type='Wave', reference_layer=None, horizontal_extent_factor=5, vertical_extent_factor=3, pec_launch_width='0.01mm')#
- Parameters:
- name
str Name of the port.
- position
str,optional Position of the port. The default is
"End", in which case the port is created at the end of the trace. Options are"Start"and"End".- port_type
str,optional - Type of the port. The default is
"Wave", in which case a wave port is created. Options are"Wave" and
"Gap".
- Type of the port. The default is
- reference_layer
str,optional Name of the references layer. The default is
None. Only available for gap port.- horizontal_extent_factor
int,optional Horizontal extent factor of the wave port. The default is
5.- vertical_extent_factor
int,optional Vertical extent factor of the wave port. The default is
3.- pec_launch_width
float,str,optional Perfect electrical conductor width of the wave port. The default is
"0.01mm".
- name
- Returns:
GapPort
Examples
>>> from pyedb import Edb >>> edb = Edb("myproject.aedb") >>> sig = edb.modeler.create_trace([[0, 0], ["9mm", 0]], "TOP", "1mm", "SIG", "Flat", "Flat") >>> sig.create_edge_port("pcb_port", "end", "Wave", None, 8, 8)
- Path.create_via_fence(distance, gap, padstack_name, net_name='GND')#
Create via fences on both sides of the trace.
- Parameters:
- distance: str, float
Distance between via fence and trace center line.
- gap: str, float
Gap between vias.
- padstack_name: str
Name of the via padstack.
- net_name: str, optional
Name of the net.
- Path.stroke_data(arc_segments: int = 6) dict | None#
Return the data needed to draw the path as a thick line instead of a polygon.
The path is described by its center line (with arcs converted to segments), its width and its end cap and corner styles. This is much cheaper than getting the polygon computed by the server, which is useful when plotting.
- Parameters:
- arc_segments
int,optional Number of facets used to convert an arc of the center line. The default is
6.
- arc_segments
- Returns:
- Path.move(vector)#
Move the path by a given vector.
- Parameters:
- vector: list, tuple
A list or tuple of two floats representing the x and y components of the movement vector.