summaryrefslogtreecommitdiff
path: root/gerbonara/cad/protoserve.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2024-07-06 15:51:08 +0200
committerjaseg <git@jaseg.de>2024-07-06 15:51:08 +0200
commitf721692bf348489ac8444e3ed1560e4f0793b213 (patch)
tree25848ee5fc66e779bc65659b4bf2d9ade908be9b /gerbonara/cad/protoserve.py
parent04c4b3ff0c81d13b8aba01ddb79ac3f14d59baa6 (diff)
downloadgerbonara-f721692bf348489ac8444e3ed1560e4f0793b213.tar.gz
gerbonara-f721692bf348489ac8444e3ed1560e4f0793b213.tar.bz2
gerbonara-f721692bf348489ac8444e3ed1560e4f0793b213.zip
Protoboard generator WIP
Diffstat (limited to 'gerbonara/cad/protoserve.py')
-rw-r--r--gerbonara/cad/protoserve.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/gerbonara/cad/protoserve.py b/gerbonara/cad/protoserve.py
index 25ef8c6..cc5aae2 100644
--- a/gerbonara/cad/protoserve.py
+++ b/gerbonara/cad/protoserve.py
@@ -8,6 +8,7 @@ from quart import Quart, request, Response, send_file, abort
from . import protoboard as pb
from . import protoserve_data
+from .primitives import SMDStack
from ..utils import MM, Inch
@@ -62,10 +63,10 @@ def deserialize(obj, unit):
case 'smd':
match obj['pad_shape']:
case 'rect':
- pad = pb.SMDPad.rect(0, 0, pitch_x-clearance, pitch_y-clearance, paste=False, unit=unit)
+ stack = SMDStack.rect(pitch_x-clearance, pitch_y-clearance, paste=False, unit=unit)
case 'circle':
- pad = pb.SMDPad.circle(0, 0, min(pitch_x, pitch_y)-clearance, paste=False, unit=unit)
- return pb.PatternProtoArea(pitch_x, pitch_y, obj=pad, unit=unit)
+ stack = SMDStack.circle(min(pitch_x, pitch_y)-clearance, paste=False, unit=unit)
+ return pb.PatternProtoArea(pitch_x, pitch_y, obj=stack, unit=unit)
case 'tht':
hole_dia = mil(float(obj['hole_dia']))
@@ -79,11 +80,11 @@ def deserialize(obj, unit):
match obj['pad_shape']:
case 'rect':
- pad = pb.THTPad.rect(0, 0, hole_dia, pitch_x-clearance, pitch_y-clearance, paste=False, plated=plated, unit=unit)
+ pad = pb.THTPad.rect(hole_dia, pitch_x-clearance, pitch_y-clearance, paste=False, plated=plated, unit=unit)
case 'circle':
- pad = pb.THTPad.circle(0, 0, hole_dia, min(pitch_x, pitch_y)-clearance, paste=False, plated=plated, unit=unit)
+ pad = pb.THTPad.circle(hole_dia, min(pitch_x, pitch_y)-clearance, paste=False, plated=plated, unit=unit)
case 'obround':
- pad = pb.THTPad.obround(0, 0, hole_dia, pitch_x-clearance, pitch_y-clearance, paste=False, plated=plated, unit=unit)
+ pad = pb.THTPad.obround(hole_dia, pitch_x-clearance, pitch_y-clearance, paste=False, plated=plated, unit=unit)
if oneside:
pad.pad_bottom = None