added debounce cap

This commit is contained in:
cpu
2026-05-16 17:57:35 +02:00
parent cd38349be3
commit c799e7ab56
32 changed files with 32363 additions and 15634 deletions

33
scripts/move_to_origin.py Normal file
View File

@@ -0,0 +1,33 @@
# move_to_origin.py
from shapely.affinity import translate
def kikitPostprocess(panel, args):
import pcbnew
# Get bounds from the substrate (Shapely polygon, units in nm)
bounds = panel.boardSubstrate.substrates.bounds # (minx, miny, maxx, maxy)
minx = bounds[0]
miny = bounds[1]
dx = int(-minx)
dy = int(-miny)
offset = pcbnew.VECTOR2I(dx, dy)
# Move all board items (footprints, tracks, drawings, zones)
for fp in panel.board.GetFootprints():
fp.Move(offset)
for track in panel.board.GetTracks():
track.Move(offset)
for drawing in panel.board.GetDrawings():
drawing.Move(offset)
for zone in panel.board.Zones():
zone.Move(offset)
# Translate the substrate geometry (this becomes the Edge.Cuts on save)
dx_nm = -bounds[0]
dy_nm = -bounds[1]
panel.boardSubstrate.substrates = translate(
panel.boardSubstrate.substrates,
xoff=dx_nm,
yoff=dy_nm
)