Previous Page Next Page Contents

plot::Turtle -- graphical primitive for turtle graphics

Introduction

plot::Turtle() creates a turtle, which is a drawing device which understands few simple commands.

Creating Elements

plot::Turtle()

Related Domains

plot::Lsys, plot::Scene

Related Functions

plot

Details

Result of Evaluation

Evaluating an object of type plot::Turtle returns itself.

Method getPlotdata: create the plot data of a turtle

Method slot: read turtle methods

Method print: print a turtle

Example 1

We create a turtle, let it draw a triangle and then show its path:

>> T := plot::Turtle():
   T::right(90): T::line(1):
   T::left(120): T::line(1):
   T::left(120): T::line(1):
   plot(T, Axes = None)

Example 2

We draw a star-like object:

>> T := plot::Turtle():
   for i from 1 to 36 do
       T::right(170); T::line(1)
   end_for:
   plot(T, Axes = None)

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000