pyedb 0.25.0__py3-none-any.whl → 0.26.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyedb might be problematic. Click here for more details.
- pyedb/__init__.py +1 -1
- pyedb/dotnet/edb_core/cell/primitive/primitive.py +7 -78
- pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py +7 -2
- pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py +7 -1
- pyedb/dotnet/edb_core/cell/terminal/point_terminal.py +7 -1
- pyedb/dotnet/edb_core/dotnet/primitive.py +4 -5
- pyedb/dotnet/edb_core/edb_data/layer_data.py +7 -0
- pyedb/dotnet/edb_core/edb_data/primitives_data.py +1 -1
- pyedb/dotnet/edb_core/nets.py +2 -76
- pyedb/dotnet/edb_core/stackup.py +12 -6
- pyedb/misc/utilities.py +91 -18
- pyedb/siwave.py +18 -4
- {pyedb-0.25.0.dist-info → pyedb-0.26.1.dist-info}/METADATA +4 -4
- {pyedb-0.25.0.dist-info → pyedb-0.26.1.dist-info}/RECORD +16 -16
- {pyedb-0.25.0.dist-info → pyedb-0.26.1.dist-info}/LICENSE +0 -0
- {pyedb-0.25.0.dist-info → pyedb-0.26.1.dist-info}/WHEEL +0 -0
pyedb/__init__.py
CHANGED
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
# SOFTWARE.
|
|
22
|
-
import math
|
|
23
22
|
|
|
24
23
|
from pyedb.dotnet.edb_core.cell.connectable import Connectable
|
|
25
24
|
from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
|
|
26
25
|
from pyedb.dotnet.edb_core.geometry.polygon_data import PolygonData
|
|
26
|
+
from pyedb.misc.utilities import compute_arc_points
|
|
27
27
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
28
28
|
|
|
29
29
|
|
|
@@ -113,8 +113,11 @@ class Primitive(Connectable):
|
|
|
113
113
|
@property
|
|
114
114
|
def layer(self):
|
|
115
115
|
"""Get the primitive edb layer object."""
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
obj = self._edb_object.GetLayer()
|
|
117
|
+
if obj.IsNull():
|
|
118
|
+
return None
|
|
119
|
+
else:
|
|
120
|
+
return self._pedb.stackup.find_layer_by_name(obj.GetName())
|
|
118
121
|
|
|
119
122
|
@property
|
|
120
123
|
def layer_name(self):
|
|
@@ -199,80 +202,6 @@ class Primitive(Connectable):
|
|
|
199
202
|
def is_negative(self, value):
|
|
200
203
|
self._edb_object.SetIsNegative(value)
|
|
201
204
|
|
|
202
|
-
@staticmethod
|
|
203
|
-
def _eval_arc_points(p1, p2, h, n=6, tol=1e-12):
|
|
204
|
-
"""Get the points of the arc
|
|
205
|
-
|
|
206
|
-
Parameters
|
|
207
|
-
----------
|
|
208
|
-
p1 : list
|
|
209
|
-
Arc starting point.
|
|
210
|
-
p2 : list
|
|
211
|
-
Arc ending point.
|
|
212
|
-
h : float
|
|
213
|
-
Arc height.
|
|
214
|
-
n : int
|
|
215
|
-
Number of points to generate along the arc.
|
|
216
|
-
tol : float
|
|
217
|
-
Geometric tolerance.
|
|
218
|
-
|
|
219
|
-
Returns
|
|
220
|
-
-------
|
|
221
|
-
list, list
|
|
222
|
-
Points generated along the arc.
|
|
223
|
-
"""
|
|
224
|
-
# fmt: off
|
|
225
|
-
if abs(h) < tol:
|
|
226
|
-
return [], []
|
|
227
|
-
elif h > 0:
|
|
228
|
-
reverse = False
|
|
229
|
-
x1 = p1[0]
|
|
230
|
-
y1 = p1[1]
|
|
231
|
-
x2 = p2[0]
|
|
232
|
-
y2 = p2[1]
|
|
233
|
-
else:
|
|
234
|
-
reverse = True
|
|
235
|
-
x1 = p2[0]
|
|
236
|
-
y1 = p2[1]
|
|
237
|
-
x2 = p1[0]
|
|
238
|
-
y2 = p1[1]
|
|
239
|
-
h *= -1
|
|
240
|
-
xa = (x2 - x1) / 2
|
|
241
|
-
ya = (y2 - y1) / 2
|
|
242
|
-
xo = x1 + xa
|
|
243
|
-
yo = y1 + ya
|
|
244
|
-
a = math.sqrt(xa ** 2 + ya ** 2)
|
|
245
|
-
if a < tol:
|
|
246
|
-
return [], []
|
|
247
|
-
r = (a ** 2) / (2 * h) + h / 2
|
|
248
|
-
if abs(r - a) < tol:
|
|
249
|
-
b = 0
|
|
250
|
-
th = 2 * math.asin(1) # chord angle
|
|
251
|
-
else:
|
|
252
|
-
b = math.sqrt(r ** 2 - a ** 2)
|
|
253
|
-
th = 2 * math.asin(a / r) # chord angle
|
|
254
|
-
|
|
255
|
-
# center of the circle
|
|
256
|
-
xc = xo + b * ya / a
|
|
257
|
-
yc = yo - b * xa / a
|
|
258
|
-
|
|
259
|
-
alpha = math.atan2((y1 - yc), (x1 - xc))
|
|
260
|
-
xr = []
|
|
261
|
-
yr = []
|
|
262
|
-
for i in range(n):
|
|
263
|
-
i += 1
|
|
264
|
-
dth = (float(i) / (n + 1)) * th
|
|
265
|
-
xi = xc + r * math.cos(alpha - dth)
|
|
266
|
-
yi = yc + r * math.sin(alpha - dth)
|
|
267
|
-
xr.append(xi)
|
|
268
|
-
yr.append(yi)
|
|
269
|
-
|
|
270
|
-
if reverse:
|
|
271
|
-
xr.reverse()
|
|
272
|
-
yr.reverse()
|
|
273
|
-
# fmt: on
|
|
274
|
-
return xr, yr
|
|
275
|
-
|
|
276
205
|
def _get_points_for_plot(self, my_net_points, num):
|
|
277
206
|
"""
|
|
278
207
|
Get the points to be plotted.
|
|
@@ -292,7 +221,7 @@ class Primitive(Connectable):
|
|
|
292
221
|
p2 = [my_net_points[i + 1].X.ToDouble(), my_net_points[i + 1].Y.ToDouble()]
|
|
293
222
|
else:
|
|
294
223
|
p2 = [my_net_points[0].X.ToDouble(), my_net_points[0].Y.ToDouble()]
|
|
295
|
-
x_arc, y_arc =
|
|
224
|
+
x_arc, y_arc = compute_arc_points(p1, p2, arc_h, num)
|
|
296
225
|
x.extend(x_arc)
|
|
297
226
|
y.extend(y_arc)
|
|
298
227
|
# i += 1
|
|
@@ -84,8 +84,13 @@ class PadstackInstanceTerminal(Terminal):
|
|
|
84
84
|
isRef=is_ref,
|
|
85
85
|
)
|
|
86
86
|
terminal = PadstackInstanceTerminal(self._pedb, terminal)
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
if terminal.is_null:
|
|
88
|
+
msg = f"Failed to create terminal. "
|
|
89
|
+
if name in self._pedb.terminals:
|
|
90
|
+
msg += f"Terminal {name} already exists."
|
|
91
|
+
raise Exception(msg)
|
|
92
|
+
else:
|
|
93
|
+
return terminal
|
|
89
94
|
|
|
90
95
|
def _get_parameters(self):
|
|
91
96
|
"""Gets the parameters of the padstack instance terminal."""
|
|
@@ -56,7 +56,13 @@ class PinGroupTerminal(Terminal):
|
|
|
56
56
|
is_ref,
|
|
57
57
|
)
|
|
58
58
|
term = PinGroupTerminal(self._pedb, term)
|
|
59
|
-
|
|
59
|
+
if term.is_null:
|
|
60
|
+
msg = f"Failed to create terminal. "
|
|
61
|
+
if name in self._pedb.terminals:
|
|
62
|
+
msg += f"Terminal {name} already exists."
|
|
63
|
+
raise Exception(msg)
|
|
64
|
+
else:
|
|
65
|
+
return term
|
|
60
66
|
|
|
61
67
|
def pin_group(self):
|
|
62
68
|
"""Gets the pin group the terminal refers to."""
|
|
@@ -59,4 +59,10 @@ class PointTerminal(Terminal):
|
|
|
59
59
|
is_ref,
|
|
60
60
|
)
|
|
61
61
|
terminal = PointTerminal(self._pedb, terminal)
|
|
62
|
-
|
|
62
|
+
if terminal.is_null:
|
|
63
|
+
msg = f"Failed to create terminal. "
|
|
64
|
+
if name in self._pedb.terminals:
|
|
65
|
+
msg += f"Terminal {name} already exists."
|
|
66
|
+
raise Exception(msg)
|
|
67
|
+
else:
|
|
68
|
+
return terminal
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
"""Primitive."""
|
|
24
|
+
|
|
24
25
|
from pyedb.dotnet.edb_core.dotnet.database import NetDotNet
|
|
25
26
|
from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
|
|
27
|
+
from pyedb.misc.utilities import compute_arc_points
|
|
26
28
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
27
29
|
|
|
28
30
|
|
|
@@ -256,11 +258,10 @@ class PrimitiveDotNet:
|
|
|
256
258
|
"""
|
|
257
259
|
self.prim_obj.MakeZonePrimitive(zone_id)
|
|
258
260
|
|
|
259
|
-
def _get_points_for_plot(self, my_net_points,
|
|
261
|
+
def _get_points_for_plot(self, my_net_points, n=6, tol=1e-12):
|
|
260
262
|
"""
|
|
261
263
|
Get the points to be plot
|
|
262
264
|
"""
|
|
263
|
-
# fmt: off
|
|
264
265
|
x = []
|
|
265
266
|
y = []
|
|
266
267
|
for i, point in enumerate(my_net_points):
|
|
@@ -276,11 +277,9 @@ class PrimitiveDotNet:
|
|
|
276
277
|
p2 = [my_net_points[i + 1].X.ToDouble(), my_net_points[i + 1].Y.ToDouble()]
|
|
277
278
|
else:
|
|
278
279
|
p2 = [my_net_points[0].X.ToDouble(), my_net_points[0].Y.ToDouble()]
|
|
279
|
-
x_arc, y_arc =
|
|
280
|
+
x_arc, y_arc = compute_arc_points(p1, p2, arc_h, n, tol)
|
|
280
281
|
x.extend(x_arc)
|
|
281
282
|
y.extend(y_arc)
|
|
282
|
-
# i += 1
|
|
283
|
-
# fmt: on
|
|
284
283
|
return x, y
|
|
285
284
|
|
|
286
285
|
def points(self, arc_segments=6):
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
from __future__ import absolute_import
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
def layer_cast(pedb, edb_object):
|
|
27
|
+
if edb_object.IsStackupLayer():
|
|
28
|
+
return StackupLayerEdbClass(pedb, edb_object.Clone(), name=edb_object.GetName())
|
|
29
|
+
else:
|
|
30
|
+
return LayerEdbClass(pedb, edb_object.Clone(), name=edb_object.GetName())
|
|
31
|
+
|
|
32
|
+
|
|
26
33
|
class LayerEdbClass(object):
|
|
27
34
|
"""Manages Edb Layers. Replaces EDBLayer."""
|
|
28
35
|
|
|
@@ -488,7 +488,7 @@ class EDBArcs(object):
|
|
|
488
488
|
"""
|
|
489
489
|
try:
|
|
490
490
|
my_net_points = self.points_raw
|
|
491
|
-
xt, yt = self._app._get_points_for_plot(my_net_points, arc_segments)
|
|
491
|
+
xt, yt = self._app._active_cell.primitive._get_points_for_plot(my_net_points, arc_segments)
|
|
492
492
|
if not xt:
|
|
493
493
|
return []
|
|
494
494
|
x, y = GeometryOperators.orient_polygon(xt, yt, clockwise=True)
|
pyedb/dotnet/edb_core/nets.py
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
from __future__ import absolute_import # noreorder
|
|
24
24
|
|
|
25
|
-
import math
|
|
26
25
|
import os
|
|
27
26
|
import time
|
|
28
27
|
import warnings
|
|
@@ -30,6 +29,7 @@ import warnings
|
|
|
30
29
|
from pyedb.dotnet.edb_core.edb_data.nets_data import EDBNetsData
|
|
31
30
|
from pyedb.generic.constants import CSS4_COLORS
|
|
32
31
|
from pyedb.generic.general_methods import generate_unique_name
|
|
32
|
+
from pyedb.misc.utilities import compute_arc_points
|
|
33
33
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
34
34
|
|
|
35
35
|
|
|
@@ -354,80 +354,6 @@ class EdbNets(object):
|
|
|
354
354
|
|
|
355
355
|
return _extended_nets
|
|
356
356
|
|
|
357
|
-
@staticmethod
|
|
358
|
-
def _eval_arc_points(p1, p2, h, n=6, tol=1e-12):
|
|
359
|
-
"""Get the points of the arc.
|
|
360
|
-
|
|
361
|
-
Parameters
|
|
362
|
-
----------
|
|
363
|
-
p1 : list
|
|
364
|
-
Arc starting point.
|
|
365
|
-
p2 : list
|
|
366
|
-
Arc ending point.
|
|
367
|
-
h : float
|
|
368
|
-
Arc height.
|
|
369
|
-
n : int
|
|
370
|
-
Number of points to generate along the arc.
|
|
371
|
-
tol : float
|
|
372
|
-
Geometric tolerance.
|
|
373
|
-
|
|
374
|
-
Returns
|
|
375
|
-
-------
|
|
376
|
-
list
|
|
377
|
-
points generated along the arc.
|
|
378
|
-
"""
|
|
379
|
-
# fmt: off
|
|
380
|
-
if abs(h) < tol:
|
|
381
|
-
return [], []
|
|
382
|
-
elif h > 0:
|
|
383
|
-
reverse = False
|
|
384
|
-
x1 = p1[0]
|
|
385
|
-
y1 = p1[1]
|
|
386
|
-
x2 = p2[0]
|
|
387
|
-
y2 = p2[1]
|
|
388
|
-
else:
|
|
389
|
-
reverse = True
|
|
390
|
-
x1 = p2[0]
|
|
391
|
-
y1 = p2[1]
|
|
392
|
-
x2 = p1[0]
|
|
393
|
-
y2 = p1[1]
|
|
394
|
-
h *= -1
|
|
395
|
-
xa = (x2 - x1) / 2
|
|
396
|
-
ya = (y2 - y1) / 2
|
|
397
|
-
xo = x1 + xa
|
|
398
|
-
yo = y1 + ya
|
|
399
|
-
a = math.sqrt(xa ** 2 + ya ** 2)
|
|
400
|
-
if a < tol:
|
|
401
|
-
return [], []
|
|
402
|
-
r = (a ** 2) / (2 * h) + h / 2
|
|
403
|
-
if abs(r - a) < tol:
|
|
404
|
-
b = 0
|
|
405
|
-
th = 2 * math.asin(1) # chord angle
|
|
406
|
-
else:
|
|
407
|
-
b = math.sqrt(r ** 2 - a ** 2)
|
|
408
|
-
th = 2 * math.asin(a / r) # chord angle
|
|
409
|
-
|
|
410
|
-
# center of the circle
|
|
411
|
-
xc = xo + b * ya / a
|
|
412
|
-
yc = yo - b * xa / a
|
|
413
|
-
|
|
414
|
-
alpha = math.atan2((y1 - yc), (x1 - xc))
|
|
415
|
-
xr = []
|
|
416
|
-
yr = []
|
|
417
|
-
for i in range(n):
|
|
418
|
-
i += 1
|
|
419
|
-
dth = (i / (n + 1)) * th
|
|
420
|
-
xi = xc + r * math.cos(alpha - dth)
|
|
421
|
-
yi = yc + r * math.sin(alpha - dth)
|
|
422
|
-
xr.append(xi)
|
|
423
|
-
yr.append(yi)
|
|
424
|
-
|
|
425
|
-
if reverse:
|
|
426
|
-
xr.reverse()
|
|
427
|
-
yr.reverse()
|
|
428
|
-
# fmt: on
|
|
429
|
-
return xr, yr
|
|
430
|
-
|
|
431
357
|
def _get_points_for_plot(self, my_net_points):
|
|
432
358
|
"""
|
|
433
359
|
Get the points to be plot
|
|
@@ -448,7 +374,7 @@ class EdbNets(object):
|
|
|
448
374
|
p2 = [my_net_points[i + 1].X.ToDouble(), my_net_points[i + 1].Y.ToDouble()]
|
|
449
375
|
else:
|
|
450
376
|
p2 = [my_net_points[0].X.ToDouble(), my_net_points[0].Y.ToDouble()]
|
|
451
|
-
x_arc, y_arc =
|
|
377
|
+
x_arc, y_arc = compute_arc_points(p1, p2, arc_h)
|
|
452
378
|
x.extend(x_arc)
|
|
453
379
|
y.extend(y_arc)
|
|
454
380
|
# i += 1
|
pyedb/dotnet/edb_core/stackup.py
CHANGED
|
@@ -36,6 +36,7 @@ import warnings
|
|
|
36
36
|
from pyedb.dotnet.edb_core.edb_data.layer_data import (
|
|
37
37
|
LayerEdbClass,
|
|
38
38
|
StackupLayerEdbClass,
|
|
39
|
+
layer_cast,
|
|
39
40
|
)
|
|
40
41
|
from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
|
|
41
42
|
from pyedb.generic.general_methods import ET, generate_unique_name
|
|
@@ -284,10 +285,7 @@ class LayerCollection(object):
|
|
|
284
285
|
layer_list = list(self._edb_object.Layers(self._pedb.edb_api.cell.layer_type_set.AllLayerSet))
|
|
285
286
|
temp = dict()
|
|
286
287
|
for i in layer_list:
|
|
287
|
-
|
|
288
|
-
obj = StackupLayerEdbClass(self._pedb, i.Clone(), name=i.GetName())
|
|
289
|
-
else:
|
|
290
|
-
obj = LayerEdbClass(self._pedb, i.Clone(), name=i.GetName())
|
|
288
|
+
obj = layer_cast(self._pedb, i)
|
|
291
289
|
temp[obj.name] = obj
|
|
292
290
|
return temp
|
|
293
291
|
|
|
@@ -306,12 +304,20 @@ class LayerCollection(object):
|
|
|
306
304
|
"""
|
|
307
305
|
return {name: obj for name, obj in self.all_layers.items() if obj.is_stackup_layer}
|
|
308
306
|
|
|
307
|
+
def find_layer_by_name(self, name: str):
|
|
308
|
+
"""Finds a layer with the given name."""
|
|
309
|
+
obj = self._pedb.edb_api.cell._cell.Layer.FindByName(self._edb_object, name)
|
|
310
|
+
if obj.IsNull():
|
|
311
|
+
raise ValueError("Layer with name '{}' was not found.".format(name))
|
|
312
|
+
else:
|
|
313
|
+
return layer_cast(self._pedb, obj.Clone())
|
|
314
|
+
|
|
309
315
|
|
|
310
316
|
class Stackup(LayerCollection):
|
|
311
317
|
"""Manages EDB methods for stackup accessible from `Edb.stackup` property."""
|
|
312
318
|
|
|
313
319
|
def __getitem__(self, item):
|
|
314
|
-
return self.
|
|
320
|
+
return self.find_layer_by_name(item)
|
|
315
321
|
|
|
316
322
|
def __init__(self, pedb, edb_object=None):
|
|
317
323
|
super().__init__(pedb, edb_object)
|
|
@@ -1800,7 +1806,7 @@ class Stackup(LayerCollection):
|
|
|
1800
1806
|
temp_data = {name: 0 for name, _ in self.signal_layers.items()}
|
|
1801
1807
|
outline_area = 0
|
|
1802
1808
|
for i in self._pedb.modeler.primitives:
|
|
1803
|
-
layer_name = i.
|
|
1809
|
+
layer_name = i._edb_object.GetLayer().GetName()
|
|
1804
1810
|
if layer_name.lower() == "outline":
|
|
1805
1811
|
if i.area() > outline_area:
|
|
1806
1812
|
outline_area = i.area()
|
pyedb/misc/utilities.py
CHANGED
|
@@ -1,27 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
2
22
|
|
|
23
|
+
"""Module gathering utility functions for PyEDB modules."""
|
|
3
24
|
|
|
4
|
-
class file_tools:
|
|
5
|
-
def __init__(self):
|
|
6
|
-
pass
|
|
7
25
|
|
|
8
|
-
|
|
9
|
-
def copy_folder(source_folder, destination_folder):
|
|
10
|
-
"""
|
|
26
|
+
import math
|
|
11
27
|
|
|
12
|
-
Parameters
|
|
13
|
-
----------
|
|
14
|
-
source_folder : str
|
|
15
|
-
source folder
|
|
16
28
|
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
def compute_arc_points(p1, p2, h, n=6, tol=1e-12):
|
|
30
|
+
"""Get the points of the arc.
|
|
19
31
|
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
p1 : list
|
|
35
|
+
Arc starting point.
|
|
36
|
+
p2 : list
|
|
37
|
+
Arc ending point.
|
|
38
|
+
h : float
|
|
39
|
+
Arc height.
|
|
40
|
+
n : int
|
|
41
|
+
Number of points to generate along the arc.
|
|
42
|
+
tol : float
|
|
43
|
+
Geometric tolerance.
|
|
20
44
|
|
|
21
|
-
|
|
22
|
-
|
|
45
|
+
Returns
|
|
46
|
+
-------
|
|
47
|
+
list, list
|
|
48
|
+
Points generated along the arc.
|
|
49
|
+
"""
|
|
50
|
+
if abs(h) < tol:
|
|
51
|
+
return [], []
|
|
52
|
+
elif h > 0:
|
|
53
|
+
reverse = False
|
|
54
|
+
x1 = p1[0]
|
|
55
|
+
y1 = p1[1]
|
|
56
|
+
x2 = p2[0]
|
|
57
|
+
y2 = p2[1]
|
|
58
|
+
else:
|
|
59
|
+
reverse = True
|
|
60
|
+
x1 = p2[0]
|
|
61
|
+
y1 = p2[1]
|
|
62
|
+
x2 = p1[0]
|
|
63
|
+
y2 = p1[1]
|
|
64
|
+
h *= -1
|
|
23
65
|
|
|
24
|
-
|
|
66
|
+
xa = (x2 - x1) / 2
|
|
67
|
+
ya = (y2 - y1) / 2
|
|
68
|
+
xo = x1 + xa
|
|
69
|
+
yo = y1 + ya
|
|
70
|
+
a = math.sqrt(xa**2 + ya**2)
|
|
71
|
+
if a < tol:
|
|
72
|
+
return [], []
|
|
73
|
+
r = (a**2) / (2 * h) + h / 2
|
|
74
|
+
if abs(r - a) < tol:
|
|
75
|
+
b = 0
|
|
76
|
+
th = 2 * math.asin(1) # chord angle
|
|
77
|
+
else:
|
|
78
|
+
b = math.sqrt(r**2 - a**2)
|
|
79
|
+
th = 2 * math.asin(a / r) # chord angle
|
|
25
80
|
|
|
26
|
-
|
|
27
|
-
|
|
81
|
+
# Center of the circle
|
|
82
|
+
xc = xo + b * ya / a
|
|
83
|
+
yc = yo - b * xa / a
|
|
84
|
+
|
|
85
|
+
alpha = math.atan2((y1 - yc), (x1 - xc))
|
|
86
|
+
xr = []
|
|
87
|
+
yr = []
|
|
88
|
+
for i in range(n):
|
|
89
|
+
i += 1
|
|
90
|
+
dth = (float(i) / (n + 1)) * th
|
|
91
|
+
xi = xc + r * math.cos(alpha - dth)
|
|
92
|
+
yi = yc + r * math.sin(alpha - dth)
|
|
93
|
+
xr.append(xi)
|
|
94
|
+
yr.append(yi)
|
|
95
|
+
|
|
96
|
+
if reverse:
|
|
97
|
+
xr.reverse()
|
|
98
|
+
yr.reverse()
|
|
99
|
+
|
|
100
|
+
return xr, yr
|
pyedb/siwave.py
CHANGED
|
@@ -266,6 +266,16 @@ class Siwave(object): # pragma no cover
|
|
|
266
266
|
else:
|
|
267
267
|
return False
|
|
268
268
|
|
|
269
|
+
@property
|
|
270
|
+
def file_dir(self) -> str:
|
|
271
|
+
"""Directory path of the open project."""
|
|
272
|
+
return self.oproject.GetFileDir()
|
|
273
|
+
|
|
274
|
+
@property
|
|
275
|
+
def file_path(self) -> str:
|
|
276
|
+
"""Path of the open project file."""
|
|
277
|
+
return self.oproject.GetFilePath()
|
|
278
|
+
|
|
269
279
|
def save_project(self, projectpath=None, projectName=None):
|
|
270
280
|
"""Save the project.
|
|
271
281
|
|
|
@@ -283,7 +293,9 @@ class Siwave(object): # pragma no cover
|
|
|
283
293
|
|
|
284
294
|
"""
|
|
285
295
|
if projectName and projectpath:
|
|
286
|
-
|
|
296
|
+
if not projectName.endswith(".siw"):
|
|
297
|
+
projectName = projectName + ".siw"
|
|
298
|
+
self.oproject.ScrSaveProjectAs(os.path.join(projectpath, projectName))
|
|
287
299
|
else:
|
|
288
300
|
self.oproject.Save()
|
|
289
301
|
return True
|
|
@@ -476,6 +488,7 @@ class Siwave(object): # pragma no cover
|
|
|
476
488
|
if isinstance(file_path, Path):
|
|
477
489
|
file_path = str(file_path)
|
|
478
490
|
flag = self.oproject.ScrImportEDB(file_path)
|
|
491
|
+
# self.save_project(self.di)
|
|
479
492
|
if flag == 0:
|
|
480
493
|
self._logger.info(f"Importing EDB to {file_path}.")
|
|
481
494
|
return True
|
|
@@ -493,11 +506,12 @@ class Siwave(object): # pragma no cover
|
|
|
493
506
|
if isinstance(file_path, Path):
|
|
494
507
|
file_path = str(file_path)
|
|
495
508
|
|
|
496
|
-
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
|
|
497
|
-
temp_edb = os.path.join(temp_folder.name, "temp.aedb")
|
|
509
|
+
# temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
|
|
510
|
+
# temp_edb = os.path.join(temp_folder.name, "temp.aedb")
|
|
511
|
+
|
|
512
|
+
temp_edb = os.path.join(self.file_dir, "temp.aedb")
|
|
498
513
|
|
|
499
514
|
self.export_edb(temp_edb)
|
|
500
|
-
self.save_project()
|
|
501
515
|
self.oproject.ScrCloseProject()
|
|
502
516
|
edbapp = Edb(temp_edb, edbversion=self.current_version)
|
|
503
517
|
edbapp.configuration.load(file_path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyedb
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.26.1
|
|
4
4
|
Summary: Higher-Level Pythonic Ansys Electronics Data Base
|
|
5
5
|
Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
|
|
6
6
|
Maintainer-email: PyEDB developers <simon.vandenbrouck@ansys.com>
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Requires-Dist: cffi>=1.16.0,<1.
|
|
18
|
+
Requires-Dist: cffi>=1.16.0,<1.18; platform_system=='Linux'
|
|
19
19
|
Requires-Dist: pywin32 >= 303;platform_system=='Windows'
|
|
20
20
|
Requires-Dist: ansys-pythonnet >= 3.1.0rc3
|
|
21
21
|
Requires-Dist: dotnetcore2 ==3.1.23;platform_system=='Linux'
|
|
@@ -26,14 +26,14 @@ Requires-Dist: Rtree >= 1.2.0
|
|
|
26
26
|
Requires-Dist: toml == 0.10.2
|
|
27
27
|
Requires-Dist: scikit-rf
|
|
28
28
|
Requires-Dist: ansys-sphinx-theme>=0.10.0,<1.1 ; extra == "doc"
|
|
29
|
-
Requires-Dist: imageio>=2.30.0,<2.
|
|
29
|
+
Requires-Dist: imageio>=2.30.0,<2.36 ; extra == "doc"
|
|
30
30
|
Requires-Dist: ipython>=8.13.0,<8.27 ; extra == "doc"
|
|
31
31
|
Requires-Dist: jupyterlab>=4.0.0,<4.3 ; extra == "doc"
|
|
32
32
|
Requires-Dist: jupytext>=1.16.0,<1.17 ; extra == "doc"
|
|
33
33
|
Requires-Dist: matplotlib>=3.5.0,<3.10 ; extra == "doc"
|
|
34
34
|
Requires-Dist: nbsphinx>=0.9.0,<0.10 ; extra == "doc"
|
|
35
35
|
Requires-Dist: nbconvert < 7.17 ; extra == "doc"
|
|
36
|
-
Requires-Dist: numpydoc>=1.5.0,<1.
|
|
36
|
+
Requires-Dist: numpydoc>=1.5.0,<1.9 ; extra == "doc"
|
|
37
37
|
Requires-Dist: pypandoc>=1.10.0,<1.14 ; extra == "doc"
|
|
38
38
|
Requires-Dist: recommonmark ; extra == "doc"
|
|
39
39
|
Requires-Dist: Sphinx>=7.1.0,<8.1 ; extra == "doc"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
pyedb/__init__.py,sha256=
|
|
1
|
+
pyedb/__init__.py,sha256=5P-p1phekC9hBwBXwS212poYLwxDgwCBxRGH9gisrYg,1521
|
|
2
2
|
pyedb/edb_logger.py,sha256=yNkXnoL2me7ubLT6O6r6ElVnkZ1g8fmfFYC_2XJZ1Sw,14950
|
|
3
3
|
pyedb/exceptions.py,sha256=n94xluzUks6BA24vd_L6HkrvoP_H_l6__hQmqzdCyPo,111
|
|
4
|
-
pyedb/siwave.py,sha256=
|
|
4
|
+
pyedb/siwave.py,sha256=mH3wJ2e-lvAgNjAFRIkLTZ7mUjz7Gp_jm4z-QN66M88,16442
|
|
5
5
|
pyedb/workflow.py,sha256=Y0ya4FUHwlSmoLP45zjdYLsSpyKduHUSpT9GGK9MGd8,814
|
|
6
6
|
pyedb/component_libraries/ansys_components.py,sha256=O3ypt832IHY9zG2AD_yrRrbH2KH9P1yFaoi1EO6Zllw,4830
|
|
7
7
|
pyedb/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -35,10 +35,10 @@ pyedb/dotnet/edb_core/layout_validation.py,sha256=B2FIHsize6JZ5VhwN_3zBniK7iRC6d
|
|
|
35
35
|
pyedb/dotnet/edb_core/materials.py,sha256=zzYWIJ5dvOIO2H2vREpRnwGDx0hEa5QhCsg_EJkydww,43222
|
|
36
36
|
pyedb/dotnet/edb_core/modeler.py,sha256=iu16E6GXLlJZvsI_WTphyDDbFKX-i6_crFclTnNa--8,55316
|
|
37
37
|
pyedb/dotnet/edb_core/net_class.py,sha256=4U6Cc1Gn7ZJ_ub9uKmtrsoz5wD1XS42afci3Y3ewRp0,11354
|
|
38
|
-
pyedb/dotnet/edb_core/nets.py,sha256=
|
|
38
|
+
pyedb/dotnet/edb_core/nets.py,sha256=WMKC9aKkmGP_NFqAkQpM8b4AjgDgjhrRXOz8VrN4yj8,41429
|
|
39
39
|
pyedb/dotnet/edb_core/padstack.py,sha256=al5cXfnJXyaM6-KCAd8D8-TZzcIXHwco8grD44U7gNY,63588
|
|
40
40
|
pyedb/dotnet/edb_core/siwave.py,sha256=4duoAsFCuPMNLxtMTEEVJCUaHKNkdbLDmtTXiD93VrM,64311
|
|
41
|
-
pyedb/dotnet/edb_core/stackup.py,sha256=
|
|
41
|
+
pyedb/dotnet/edb_core/stackup.py,sha256=b56leXg7X7dEVPP2DUD9n8LZIakWcjIsjiqqkIWsyZU,120035
|
|
42
42
|
pyedb/dotnet/edb_core/cell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
pyedb/dotnet/edb_core/cell/connectable.py,sha256=rKWPATg0GCHi4d1ftu2V7WWhkDONjloCSPujssie5a8,2310
|
|
44
44
|
pyedb/dotnet/edb_core/cell/layout.py,sha256=u3HEdKc7rls3gkm7m31-XGi6l3pfoHEAswTVCz4FSmY,12619
|
|
@@ -55,13 +55,13 @@ pyedb/dotnet/edb_core/cell/hierarchy/spice_model.py,sha256=SGiUcan2l0n8DGk3GtwCs
|
|
|
55
55
|
pyedb/dotnet/edb_core/cell/primitive/__init__.py,sha256=8jByHkoaowAYQTCww-zRrTQmN061fLz_OHjTLSrzQQY,58
|
|
56
56
|
pyedb/dotnet/edb_core/cell/primitive/bondwire.py,sha256=fqIMdv0bNvk591DG6De5c--w9Rpkl5AOeo_qgzoPE6M,7322
|
|
57
57
|
pyedb/dotnet/edb_core/cell/primitive/path.py,sha256=XVN7dOVpccoBP28M8l5iMzK5QSQdHqpKqC4jK76UTis,12543
|
|
58
|
-
pyedb/dotnet/edb_core/cell/primitive/primitive.py,sha256=
|
|
58
|
+
pyedb/dotnet/edb_core/cell/primitive/primitive.py,sha256=4gshnuVsfZOoHFpxCQJIf1qTYw8XX_j7nzLHvJC4vGs,28029
|
|
59
59
|
pyedb/dotnet/edb_core/cell/terminal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
60
|
pyedb/dotnet/edb_core/cell/terminal/bundle_terminal.py,sha256=qM0wEXkZ-DpoJ6vlVa560Ce8IgOdp4vyIJPedvoa3O0,1977
|
|
61
61
|
pyedb/dotnet/edb_core/cell/terminal/edge_terminal.py,sha256=lafPRrvsDPYKcysvrkO-5tEZXF3h4IcTXdeJgTjleuI,2158
|
|
62
|
-
pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py,sha256=
|
|
63
|
-
pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py,sha256=
|
|
64
|
-
pyedb/dotnet/edb_core/cell/terminal/point_terminal.py,sha256=
|
|
62
|
+
pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py,sha256=XI7NiP1qT2aft7hjPK4gX42RzreiZ66aHXIHFPwUghs,3999
|
|
63
|
+
pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py,sha256=3y2UXqg8a7W74pjzZDljB1joCPTtmOkrIKGophDdgw4,2783
|
|
64
|
+
pyedb/dotnet/edb_core/cell/terminal/point_terminal.py,sha256=S3aCAuFc_QA36PVn2Cdb9L4dO3T4IikwyEVcP1FOW3I,2597
|
|
65
65
|
pyedb/dotnet/edb_core/cell/terminal/terminal.py,sha256=x-xUwqg1ZJQTgubuNSd3qistl982kAvSXNvAoNohcfg,19276
|
|
66
66
|
pyedb/dotnet/edb_core/definition/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
67
|
pyedb/dotnet/edb_core/definition/component_def.py,sha256=tYZ4L6DigwSjdQJ5AlqEbordPVZyJ6hYFNc6b3QnJ18,6514
|
|
@@ -71,17 +71,17 @@ pyedb/dotnet/edb_core/definition/definitions.py,sha256=9Zjl5LNidDBk07m-QGpducWfF
|
|
|
71
71
|
pyedb/dotnet/edb_core/definition/package_def.py,sha256=UoYNdfrB5j0rG4OK94yE25dCTzHcpDjSEn4L2yF10YY,6145
|
|
72
72
|
pyedb/dotnet/edb_core/dotnet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
73
|
pyedb/dotnet/edb_core/dotnet/database.py,sha256=9mfEg451IX3Y8PKnyhbVPApqtgmB9R4VTeWyfux8Q0A,36691
|
|
74
|
-
pyedb/dotnet/edb_core/dotnet/primitive.py,sha256=
|
|
74
|
+
pyedb/dotnet/edb_core/dotnet/primitive.py,sha256=2Mhh-pwnLzZUGLVRSCiBMtcxfvmrU40cASbpfXe1Ecs,49944
|
|
75
75
|
pyedb/dotnet/edb_core/edb_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
pyedb/dotnet/edb_core/edb_data/control_file.py,sha256=_W5DDBFvm4gTq8yCvhzfiWUsfpQK4PnLkjmntIYvW8E,48217
|
|
77
77
|
pyedb/dotnet/edb_core/edb_data/design_options.py,sha256=RO9ip-T5Bfxpsl97_QEk0qDZsza3tLzIX2t25XLutys,2057
|
|
78
78
|
pyedb/dotnet/edb_core/edb_data/edbvalue.py,sha256=Vj_11HXsQUNavizKp5FicORm6cjhXRh9uvxhv_D_RJc,1977
|
|
79
79
|
pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py,sha256=hKFHWUl0_OCMEZJbQn5c8Y1a-BYKr8nAycIlrCoeufk,13005
|
|
80
|
-
pyedb/dotnet/edb_core/edb_data/layer_data.py,sha256=
|
|
80
|
+
pyedb/dotnet/edb_core/edb_data/layer_data.py,sha256=2K1rvBXAWg3s8paNU6TPNb5tC1B3bRHmiUZjVsoX_Z8,26001
|
|
81
81
|
pyedb/dotnet/edb_core/edb_data/nets_data.py,sha256=Ifi5uSfnOuTLwesO9TS3_F-qa_8rpPXrJy6W5lvIWik,9684
|
|
82
82
|
pyedb/dotnet/edb_core/edb_data/padstacks_data.py,sha256=wOBO86cFGnx8OIsALzlQv59XeSGBhUYhJa7rksySGRE,77523
|
|
83
83
|
pyedb/dotnet/edb_core/edb_data/ports.py,sha256=wr2RQi8VExuNIVmnp7c4VpTIhODgthmJmHr01zO4ueo,8873
|
|
84
|
-
pyedb/dotnet/edb_core/edb_data/primitives_data.py,sha256=
|
|
84
|
+
pyedb/dotnet/edb_core/edb_data/primitives_data.py,sha256=CC-uSLponRiJKGh1rqc6FsITpBB5on0jP3M7YAGArfM,15449
|
|
85
85
|
pyedb/dotnet/edb_core/edb_data/raptor_x_simulation_setup_data.py,sha256=P37-OIsc8TuTC_s3CXRmvZcJqxAftHA7SATfEyoAnMM,20953
|
|
86
86
|
pyedb/dotnet/edb_core/edb_data/simulation_configuration.py,sha256=Z_Iuh7qgj9s0PwmlOOdBOC47imBTgWPAWt8KxGNZmZQ,100432
|
|
87
87
|
pyedb/dotnet/edb_core/edb_data/sources.py,sha256=jzC6p-fiuPEvZn3b9z1-X5UexW5jd48jZRamXillnXI,15700
|
|
@@ -169,7 +169,7 @@ pyedb/misc/aedtlib_personalib_install.py,sha256=eCVAdEoriMU92bZwPzY9Aig85cBbUO0J
|
|
|
169
169
|
pyedb/misc/downloads.py,sha256=j9jJhwGTTJwm4WWaCSEhGZzOGyOyHhBAFexx0NtD4Uw,10824
|
|
170
170
|
pyedb/misc/misc.py,sha256=3vyQ-l7lKUxdpdc_kGc7QNwu_EkmD8rRxe01Zx5Drr4,3315
|
|
171
171
|
pyedb/misc/pyedb.runtimeconfig.json,sha256=2xof-Vl0hY2VOs1KkMSReTMZACsZhcmPmyHXukfb-oY,301
|
|
172
|
-
pyedb/misc/utilities.py,sha256=
|
|
172
|
+
pyedb/misc/utilities.py,sha256=tW5O8R-qo0yhAufKZWxZPzbVy8qcz6UJCIqrKNhlghk,2742
|
|
173
173
|
pyedb/misc/siw_feature_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
174
174
|
pyedb/misc/siw_feature_config/emc_rule_checker_settings.py,sha256=arnOR1gSo5aGxLrRQbYewdg1jyce9EyLonPZeHYYVVE,7389
|
|
175
175
|
pyedb/misc/siw_feature_config/emc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -185,7 +185,7 @@ pyedb/misc/siw_feature_config/xtalk_scan/scan_config.py,sha256=YmYI6WTQulL5Uf8Wx
|
|
|
185
185
|
pyedb/misc/siw_feature_config/xtalk_scan/td_xtalk_config.py,sha256=KHa-UqcXuabiVfT2CV-UvWl5Q2qGYHF2Ye9azcAlnXc,3966
|
|
186
186
|
pyedb/modeler/geometry_operators.py,sha256=g_Sy7a6R23sP6RtboJn1rl8uTuo8oeLmMF21rNkzwjk,74198
|
|
187
187
|
pyedb/siwave_core/icepak.py,sha256=WnZ-t8mik7LDY06V8hZFV-TxRZJQWK7bu_8Ichx-oBs,5206
|
|
188
|
-
pyedb-0.
|
|
189
|
-
pyedb-0.
|
|
190
|
-
pyedb-0.
|
|
191
|
-
pyedb-0.
|
|
188
|
+
pyedb-0.26.1.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
|
|
189
|
+
pyedb-0.26.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
190
|
+
pyedb-0.26.1.dist-info/METADATA,sha256=drsOCWidauvPnHjR_X5dqv7kGpKq7UxPGZtlLR7ueKg,8386
|
|
191
|
+
pyedb-0.26.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|