54 lines
1.3 KiB
Python
54 lines
1.3 KiB
Python
#!/usr/bin/env -S uv run --script
|
|
# /// script
|
|
# dependencies = [
|
|
# "gerbonara",
|
|
# "click"
|
|
# ]
|
|
# ///
|
|
|
|
import math
|
|
|
|
from gerbonara.cad.kicad.footprints import Atom, AtPos, XYCoord, Pad, Line, Arc, Stroke, Drill, Footprint, Polygon,\
|
|
FootprintInstance, Zone, Hatch, ZoneKeepout, ZonePolygon
|
|
from gerbonara.layers import LayerStack
|
|
import click
|
|
|
|
__version__ = '1.0'
|
|
|
|
|
|
@click.command()
|
|
def cli():
|
|
footprint = Footprint(
|
|
name='smtso-pattern-001',
|
|
generator=Atom('radial-pattern-gen'),
|
|
generator_version=__version__,
|
|
layer='F.Cu',
|
|
descr=f"SMTSO Radial pattern footprint",
|
|
zone_connect=0)
|
|
|
|
h_dia = 2.95
|
|
pad_dia = 5.5
|
|
|
|
ring_dia = 65
|
|
n = 4
|
|
|
|
for i in range(n):
|
|
a = 2 * math.pi * i / n
|
|
r = ring_dia / 2
|
|
footprint.pads.append(Pad(
|
|
number=str(i+1),
|
|
type=Atom.thru_hole,
|
|
shape=Atom.circle,
|
|
remove_unused_layers=True,
|
|
keep_end_layers=True,
|
|
at=AtPos(x=r*math.sin(a), y=r*math.cos(a)),
|
|
size=XYCoord(x=pad_dia, y=pad_dia),
|
|
drill=Drill(diameter=h_dia),
|
|
layers=['*.Cu']))
|
|
|
|
footprint.write('footprints.pretty/smtso-ring-001.kicad_mod')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
cli()
|
|
|