initial commit
This commit is contained in:
20
refac/hilbert.py
Executable file
20
refac/hilbert.py
Executable file
@@ -0,0 +1,20 @@
|
||||
import math
|
||||
from Program import Program
|
||||
from Command import Command
|
||||
|
||||
from hilbertcurve.hilbertcurve import HilbertCurve
|
||||
penthickness=28
|
||||
|
||||
def hilbert( laenge, dicke):
|
||||
tiefe=math.floor(math.log(laenge/dicke,2)+3)
|
||||
print("Tiefe",tiefe)
|
||||
hilbert_curve = HilbertCurve(tiefe , 2)
|
||||
pts = [hilbert_curve.coordinates_from_distance(i) for i in range(4*(2**tiefe))]
|
||||
return pts
|
||||
|
||||
def hilbert_curve(plt):
|
||||
|
||||
list=hilbert(min(plt.winsize[0],plt.winsize[1]),penthickness)
|
||||
return Program([Command('IN'),Command('SP1'),Command('PU',*list[0])]\
|
||||
+[Command('PD',*p) for p in list[1:]]\
|
||||
+[Command('PU')])
|
||||
Reference in New Issue
Block a user