Skip to content

Instantly share code, notes, and snippets.

@StephS
StephS / circular_array.py
Created August 20, 2020 03:01
Python module for placing components or vias in a circle. Allows for a rotational offset. some extra code for placing tracks.
#!/usr/bin/env python2
# github.com/StephS
# original code by Kevin Cuzner
import math
import pcbnew
# generate a LUT with shape integers to a string
padshapes = {
@StephS
StephS / CirclesToPoints.py
Created July 10, 2019 18:12
DXF Circles to Points
import ezdxf
import argparse
class DiameterToRadius(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
print('%r %r %r' % (namespace, values, option_string))
if values > 0:
values = values/2.0
setattr(namespace, self.dest, values)