MCPcopy Create free account
hub / github.com/Notgnoshi/generative / forward

Method forward

generative/lsystem/turtle.py:40–45  ·  view source on GitHub ↗

Move the turtle forward by the given stepsize.

(self, stepsize=1)

Source from the content-addressed store, hash-verified

38 self._position = np.array(value)
39
40 def forward(self, stepsize=1):
41 """Move the turtle forward by the given stepsize."""
42 orientation = (0, 0, 1)
43 orientation = self.rotation.apply(orientation)
44 self.position = self.position + stepsize * orientation
45 logger.debug(f"stepping forward to {self.position}")
46
47 def yaw(self, angle):
48 """Yaw the turtle around its local Z axis."""

Callers 7

test_forwardMethod · 0.95
test_rotated_forwardMethod · 0.95
test_rollMethod · 0.95
test_pitchMethod · 0.95
test_yawMethod · 0.95
_interpret_defaultMethod · 0.80

Calls

no outgoing calls

Tested by 6

test_forwardMethod · 0.76
test_rotated_forwardMethod · 0.76
test_rollMethod · 0.76
test_pitchMethod · 0.76
test_yawMethod · 0.76