Feature #204
Add turtle class
Beginn:
23.06.2022
Abgabedatum:
% erledigt:
0%
Geschätzter Aufwand:
CS Zielversion:
Beschreibung
For Minutnik-eInk i need an quite complex frame to expose connectors but stay sustained.
Walking along the contour would be quite easy. An simple drawing on quadrille paper can be used.
The contur can be even drawn with kicad to match the PCB.
Turtle t(x,y)
t(10,0)
Not that complitated in SVG:
<g id="layer1">
<path
style="fill:#c200c2;fill-opacity:0;stroke:#c200c2;stroke-width:0.09999994;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="m 0,0 l 0,-10 10,0 0,20"
id="path630" />
</g>
How should the code look like.
#!/usr/bin/env python3
import sys
import time
class Turtle():
def __init__( self, host ):
self.host = host
def u(self,n):
print("up by ", n, "mm")
return self
def d(self, n):
print("down by ", n, "mm")
return self
def l(self,n):
print("left by ", n, "mm")
return self
def r(self, n):
print("right by ", n, "mm")
return self
turtle = Turtle("goo")
turtle.u(10).d(20) \
.l(2) .r(22)
turtle.finish()
print("fin.")
Historie
Von Maximilian Seesslen vor mehr als 2 Jahren aktualisiert
- Status wurde von Neu zu Erledigt geändert