Projekt

Allgemein

Profil

Feature #204

Von Maximilian Seesslen vor mehr als 2 Jahren aktualisiert

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:
<pre><code class="xml">
<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>
</code></pre>

How should the code look like.

<pre><code class="python">
#!/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.")

</code></pre>

Zurück