Translations:Macro HilbertCurve/47/it

def onOkButton(self): if self.twoDradioButton.isChecked: dimensions = 2 else: dimensions = 3 iterations = self.iterationsSpin.value length = self.lengthSpin.value HC=HilbertCurve(dimensions, iterations) points = HC.get_points pl = app.Placement pl.Rotation.Q = (0.0, 0.0, 0.0, 1.0) pl.Base = app.Vector(0.0, 0.0, 0.0) vectors = [] if dimensions == 2: for point in points: vectors.append(app.Vector(point[0]*length, point[1]*length, 0.0)) else: for point in points: vectors.append(app.Vector(point[0]*length, point[1]*length, point[2]*length)) wire = Draft.makeWire(vectors, placement=pl, closed=False, face=False, support=None) wire.Label = "Hilbert" Draft.autogroup(wire) self.close