def __init__(self, initialCell): self.position = np.array([0, 0, 0]) self.heading = np.eye(3) self.thickness = 50.0 self.crntCell = initialCell self.heading = rotations.do_rot(self.heading, 1, 90) self.heading = rotations.do_rot(self.heading, 2, 90) self.parentHeading = self.heading[:, 0]
def roll(axis_label, theta): state['heading'] = rotations.do_rot(state['heading'], axis_label, theta)
def Roll(self, axis_label, theta): self.heading = rotations.do_rot(self.heading, axis_label, theta)
# that we use lambda functions defined inside an interpretation dict to tell the # turtle what to do. import numpy as np import rotations import Parser from Parser import system import sys import geometry state = { 'position': np.array([0,-1,0]), #Simple 3D Vector coords 'heading': np.eye(3) #3D orientation vectors. Initially rotated so that axis 0 is up } state['heading'] = rotations.do_rot(state['heading'],1,90) state['heading'] = rotations.do_rot(state['heading'],2,90) print(state['heading']) stack = [] # Initialisation length = 0 delta = 0 def pushTurt(): newstate = {} newstate['position'] = state['position'].view() newstate['heading'] = state['heading'].view() stack.append(newstate)