Files
metabuilder/pcbgenerator/boardforge/Pin.py
T
git 04d8515a73 feat: Add PCB generator
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 17:18:12 +00:00

12 lines
378 B
Python

import math
class Pin:
def __init__(self, name, comp_at, dx, dy, rotation=0):
r = math.radians(rotation)
self.name = name
self.x = comp_at[0] + (dx * math.cos(r) - dy * math.sin(r))
self.y = comp_at[1] + (dx * math.sin(r) + dy * math.cos(r))
def __repr__(self):
return f"Pin(name={self.name!r}, x={self.x:.3f}, y={self.y:.3f})"