Bezier (ShapeContour
) backed turtle graphics.
The basic turtle language consists of:
rotate(degrees: Double)
to rotateforward(distance: Double
to walk forwardpenUp()
to raise the penpenDown()
to lower the pen, this will start a new contour
Orientation/direction and position can be set directly
position: Vector2
get/set position of the turtle, teleporting the turtle will start a new contourdirection: Vector2
get/set direction of the turtle, setting direction will computeorientation
orientation: Matrix44
the orientation matrix from whichdirection
is evaluatedisPenDown: Boolean
The language also holds some tools to manage the position and orientation of the turtle.
resetOrientation()
will reset the orientation to the default orientationpush()
push the position and orientation on the stackpop()
pop the position and orientation from the stackpushOrientation()
push the orientation on the stackpopOrientation()
pop the orientation on the stackpushPosition()
push the position on the stackpopPosition()
pop the position from the stack
segment(s: Segment)
to draw a segment with its entrance tangent aligned to the turtle's orientationcontour(c: ShapeContour)
to draw a contour with its entrance tangent aligned to the turtle's orientation