summaryrefslogtreecommitdiff
path: root/gerbonara/cad/kicad/schematic.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-09-19 12:44:22 +0200
committerjaseg <git@jaseg.de>2023-09-19 12:44:22 +0200
commit301601e81df58ea5fc5f32773c45e7a7e6a6f23c (patch)
tree41319a8c1a6774e584bc3650184ff53de3b5fcfe /gerbonara/cad/kicad/schematic.py
parent3e47e7c2dabc78650e228e5336da10d27bdf8dad (diff)
downloadgerbonara-301601e81df58ea5fc5f32773c45e7a7e6a6f23c.tar.gz
gerbonara-301601e81df58ea5fc5f32773c45e7a7e6a6f23c.tar.bz2
gerbonara-301601e81df58ea5fc5f32773c45e7a7e6a6f23c.zip
Multilayer coil WIP
Diffstat (limited to 'gerbonara/cad/kicad/schematic.py')
-rw-r--r--gerbonara/cad/kicad/schematic.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gerbonara/cad/kicad/schematic.py b/gerbonara/cad/kicad/schematic.py
index 5f4e920..390716e 100644
--- a/gerbonara/cad/kicad/schematic.py
+++ b/gerbonara/cad/kicad/schematic.py
@@ -633,7 +633,7 @@ class Schematic:
# From: https://jakevdp.github.io/blog/2012/10/07/xkcd-style-plots-in-matplotlib/
#def xkcd_line(x, y, xlim=None, ylim=None, mag=1.0, f1=30, f2=0.05, f3=15):
-def xkcd_line(x, y, xlim=None, ylim=None, mag=1.0, f1=10, f2=0.10, f3=5):
+def xkcd_line(x, y, xlim=None, ylim=None, mag=1.0, f1=10, f2=0.05, f3=5):
"""
Mimic a hand-drawn line from (x, y) data
@@ -745,9 +745,10 @@ def wonkify(path):
for p0, p1, p2 in zip(pts[0::], pts[1::], pts[2::]):
dx1, dy1 = p1[0] - p0[0], p1[1] - p0[1]
dx2, dy2 = p2[0] - p1[0], p2[1] - p1[1]
+ l1, l2 = math.hypot(dx1, dy1), math.hypot(dx2, dy2)
a1, a2 = math.atan2(dy1, dx1), math.atan2(dy2, dx2)
da = (a2 - a1 + math.pi) % (2*math.pi) - math.pi
- if abs(da) > math.pi/4:
+ if abs(da) > math.pi/4 and l1+l2 > 3:
seg.append(p1)
seg = [p1, p2]
segs.append(seg)