summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2025-08-22 13:24:02 +0200
committerjaseg <git@jaseg.de>2025-08-22 13:24:34 +0200
commit379cf273cb39813aa8819a7c81bf4d2e6de0f948 (patch)
tree8f5078d5e462e5eab50db44c2046479ffdeef442
parentda6d8349faa5ed96e73b36be524b9973b004ebf8 (diff)
downloadgerbonara-379cf273cb39813aa8819a7c81bf4d2e6de0f948.tar.gz
gerbonara-379cf273cb39813aa8819a7c81bf4d2e6de0f948.tar.bz2
gerbonara-379cf273cb39813aa8819a7c81bf4d2e6de0f948.zip
Fix out-of-date documentationmain
-rw-r--r--docs/index.rst2
-rw-r--r--examples/highlight_outline.py3
-rw-r--r--examples/load_directory.py2
-rw-r--r--examples/test_arc_approx.py4
4 files changed, 6 insertions, 5 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 71d91ec..22c2361 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -71,7 +71,7 @@ Then, you are ready to read and write gerber files:
from gerbonara import LayerStack
- stack = LayerStack.from_directory('output/gerber')
+ stack = LayerStack.open('output/gerber')
w, h = stack.outline.size('mm')
print(f'Board size is {w:.1f} mm x {h:.1f} mm')
diff --git a/examples/highlight_outline.py b/examples/highlight_outline.py
index 9d89ce2..0f600e3 100644
--- a/examples/highlight_outline.py
+++ b/examples/highlight_outline.py
@@ -10,7 +10,7 @@ from gerbonara.utils import MM
from gerbonara.utils import rotate_point
def highlight_outline(input_dir, output_dir):
- stack = LayerStack.from_directory(input_dir)
+ stack = LayerStack.open(input_dir)
outline = []
for obj in stack.outline.objects:
@@ -28,7 +28,6 @@ def highlight_outline(input_dir, output_dir):
marker_nx, marker_ny = math.sin(marker_angle), math.cos(marker_angle)
ap = CircleAperture(0.1, unit=MM)
- stack['top silk'].apertures.append(ap)
for line in outline:
cx, cy = (line.x1 + line.x2)/2, (line.y1 + line.y2)/2
diff --git a/examples/load_directory.py b/examples/load_directory.py
index 6e1f901..a23f519 100644
--- a/examples/load_directory.py
+++ b/examples/load_directory.py
@@ -7,5 +7,5 @@ if __name__ == '__main__':
args = parser.parse_args()
import gerbonara
- print(gerbonara.LayerStack.from_directory(args.input))
+ print(gerbonara.LayerStack.open(args.input))
diff --git a/examples/test_arc_approx.py b/examples/test_arc_approx.py
index 76d4116..a93864a 100644
--- a/examples/test_arc_approx.py
+++ b/examples/test_arc_approx.py
@@ -2,6 +2,7 @@
import math
+from gerbonara.utils import MM
from gerbonara.graphic_objects import Arc
from gerbonara.graphic_objects import rotate_point
@@ -22,7 +23,8 @@ def approx_test():
x1, y1 = rotate_point(0, -1, start_angle*eps)
x2, y2 = rotate_point(x1, y1, sweep_angle*eps*(-1 if clockwise else 1))
- arc = Arc(x1+cx, y1+cy, x2+cx, y2+cy, -x1, -y1, clockwise=clockwise, aperture=None, polarity_dark=True)
+ arc = Arc(x1+cx, y1+cy, x2+cx, y2+cy, -x1, -y1, clockwise=clockwise, aperture=None,
+ polarity_dark=True, unit=MM)
lines = arc.approximate(max_error=max_error)
print(f'<path style="fill: {color}; stroke: none;" d="M {cx} {cy} L {lines[0].x1} {lines[0].y1}', end=' ')