shapes and graphics
amigaball
shapes and graphics
radius (number) | stacks (number) | sectors (number)
none
Creates an ‘Amiga ball’, a sphere that alternates sectors between the pen color and the fill color.
amigaball 50 10 20
amigaballoid
shapes and graphics
radius (number) | stacks (number) | sectors (number) | ratio (number)
Creates a stretched or flattened Amiga ball, based on the supplied ratio. Respects setspheroidaxis
amigaballoid 50 10 20 0.5
appendtrack
shapes and graphics
“turtlea (word) | “turtleb (word)
none
Appends “turtlea’s track (its movements and graphics) to the end of “turtleb’s track. See copytrack
appendtrack "myrtle "bob
arc
shapes and graphics
degrees | radius
none
Creates an arc. The arc is created around the turtle, and the turtle does not move. For arcs the turtle moves along, see leftarc, rightarc
arc 90 20
backgroundshade
shapes and graphics
none
shade (number)
Returns the current background shade value. See setbackgroundshade
show backgroundshade
begintag
shapes and graphics
name (word)
none
Begins a ‘tag’, that is a grouping of movements, turtle parameter changes and shapes present in the calling turtle’s ‘track’, or output. The tag is closed with endtag. These tagged groups can be used for creating turtle models using newmodel, can be hidden or shown using hidetag or showtag, or copied using copytag
begintag "newtag
billboard
shapes and graphics
name (word) | dimensions (list)
none
Creates a ‘billboard’ using the specified image and the specified list of dimensions [x y]. See sample
billboard "marquee [100 200]
box
shapes and graphics
size (number)
none
Creates a lined square of the specified size.
box 20
circle
shapes and graphics
radius
none
Creates a lined circle at the specified radius around the turtle
circle 50
repeat 18 [circle 50 rr 10]
clean
shapes and graphics
none
none
Erases the ‘turtle track’ (graphics) belonging to the current turtle without changing its position or state. Useful when a turtle is not actually drawing graphics but is itself a graphic element (for example, in a game) to ensure that its movements don’t build up in its track and slow down execution. To use clean in this context, simply place it at the end of the turtle’s “run loop”.
clean
cleanspace
shapes and graphics
none
none
Cleans all turtles in the current space. See clean
cleanspace
clearimage
shapes and graphics
imagename (word)
none
Clears the specified image from memory.
clearimage "image
clearimages
shapes and graphics
none
none
Clears all iamges from memory.
clearimages
clearmodel
shapes and graphics
modelname (word)
none
Removes the specified model from memory.
clearmodel "model
clearmodels
shapes and graphics
none
none
Removes all user-defined models from memory.
clearmodels
clearplot
shapes and graphics
name (word)
none
Clears the named plot. See plot
clearplot "myplot
clearscreen cs
shapes and graphics
none
none
Clears the turtle’s ‘turtle track’ and sends the turtle to its home position.
clearscreen
clonetag
shapes and graphics
sourcetagname (word) | copytagname (word)
none
Clones a turtle’s tag and puts the new copy at the end of its ‘turtle track’. See tag
clonetag "oldtag "newtag
color
shapes and graphics
number
list
color returns the red, green and blue values of the specified color
show color 5
[128 128 128]
show color brown
[128 80 0]
colors
shapes and graphics
none
list
Returns a list of lists containing all of the colors’ RGB values in order of color index, eg with the first list being [0 0 0] (black) and the 16th list being white [255 255 255]. For an easier-to-read version, see listcolors
show colors
cone
shapes and graphics
radius (number) | depth (number) | sides (number)
Creates a cone pointing downward from and centered on the calling turtle.
cone 20 10 20
coneslice
shapes and graphics
radius (number) | depth (number) | sidestotal (number) | sidesused (number)
none
Creates a sliced cone.
coneslice 20 20 20 10
conoid
shapes and graphics
radius (number) | depth (number) | sides (number) | ratio (number)
Creates a conoid, a cone stretched or compressed based on the provided ratio (1 is normal, 2 is stretched twice as much, 0.5 half as much, etc.)
conoid 20 40 20 2
conoidslice
shapes and graphics
radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
none
Creates a sliced conoid.
conoidslice 20 20 20 10 2
copytag
shapes and graphics
tag (word) | turtle (word)
none
Copies a tag from the calling turtle to the named turtle, at the end of the named turtle’s turtle track.
copytag "tag "turtle
copytrack
shapes and graphics
“turtlea (word) | “turtleb (word)
none
Copies “turtlea’s track (its movements and graphics) to “turtleb, overwriting “turtleb’s existing track. See appendtrack
copytrack "myrtle "bob
csall
shapes and graphics
none
none
Causes all turtles to clear their turtle tracks and return to their starting positions.
csall
cube
shapes and graphics
size
none
Creates a wireframe cube of the specified size
cube 20
cuboid
shapes and graphics
width | height | depth
none
Creates a wireframe cuboid of the specified dimensions
cuboid 30 20 10
cutcone
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sides (number)
none
Creates a truncated, or cut, cone. See cone
cutcone 10 20 30 30
cutconeslice
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number)
none
Creats a cut, sliced cone. See coneslice
cutconeslice 20 40 20 20 10
cutconoid
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio (number)
none
Creates a truncated, or cut, conoid, stretched based on the provided ratio. See conoid
cutconoid 10 20 30 30 2###
cutconoidslice
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
none
Creates a cut, sliced conoid, stretched based on the provided ratio. See conoid
cutconoidslice 10 20 30 30 15 2
cutfunnel
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sides (number)
none
Creates a cut funnel (an uncapped cut cone).
cutfunnel 20 10 20 20
cutfunneloid
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio (number)
none
Creates a cut funneloid (an uncapped cut conoid).
cutfunneloid 20 30 20 20 0.5
cutfunneloidslice
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
none
Creates a cut, sliced funneloid (an uncapped cut conoid).
cutfunneloidslice 20 30 20 20 10 0.5
cutfunnelslice
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number)
none
Creates a sliced, cut funnel (an uncapped cut cone).
cutfunnelslice 20 10 20 20 10
cutsphere
shapes and graphics
radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number)
none
Creates a truncated, or cut, sphere. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. See sphere
cutsphere 30 14 32 4 13
cutsphereslice
shapes and graphics
radius (number) | stacks (number) | totalsectors (number) | minstack (number) | maxstack (number) | usedsectors (number)
none
Creates a sliced and cut sphere. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. Displays the portion specified by totalsectors and usedsectors. See sphereslice, cutsphere
cutsphereslice 30 20 20 5 15 10
cutspheroid
shapes and graphics
radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number) | ratio (number)
none
Creates a truncated, or cut, sphere, stretched by the provided ratio. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. See spheroid
cutspheroid 30 14 32 4 13 0.5
cutspheroidslice
shapes and graphics
radius (number) | stacks (number) | totalsectors (number) | minstack (number) | maxstack (number) | usedsectors (number) | ratio (number)
none
Creates a sliced and cut spheroid. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. Displays the portion specified by totalsectors and usedsectors. Is stretched by the ratio provided. See spheroidslice, cutspheroid
cutspheroidslice 30 20 20 5 15 10 2
cylinder
shapes and graphics
radius (number) | depth (number) | sides (number)
none
Creates a cylinder
cylinder 20 30 10
cylinderarc
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number)
none
Creates a partial torus, or curved cylinder.
cylinderarc 5 15 20 20 10
cylinderarcslice
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides (number)
Creates a slice of a partial torus, or curved cylinder. Note: If you invert the thickness value, you can ‘slice’ the opposite side.
cylinderarcslice 5 15 20 20 10 5 15
cylinderslice
shapes and graphics
radius (number) | depth (number) | totalsides (number) | slicesides (number)
none
Creates a rounded wedge shape, like a slice of a round of cheese, starting at the turtle’s right vector and moving counter-clockwise.
cylinderslice 20 10 20 10
cylindroid
shapes and graphics
radius (number) | depth (number) | sides (number) | ratio (number)
none
Creates a cylindoid
cylindroid 20 30 10 2
cylindroidarc
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)
none
Creates a cylinder arc extruded by the provided ratio.
cylindroidarc 5 15 20 20 10 2
cylindroidarcslice
shapes and graphics
thickness (number) | radius (number) | totalsides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides | ratio (number)
none
Creates a cylinder arc sliced by the provided sides values and extruded by the provided ratio.
cylindroidarcslice 5 15 20 20 10 10 15 2
cylindroidslice
shapes and graphics
radius (number) | depth (number) | totalsides (number) | slicesides (number) | ratio (number)
none
Creates a stretched rounded wedge shape, like a slice of a round of cheese, starting at the turtle’s right vector and moving counter-clockwise, and stretched using the provided ratio, where 1 is normal, 0.5 is half, 2 is double etc.
cylindroidslice 20 10 20 10 0.5
definecolor
shapes and graphics
index (number) | list or word
none
definecolor takes an index number from 0 to 63 and either a list of three values (representing red, green, and blue) with a value from 0 to 100, or a 6-character word representing a color’s RGB values in hexadecimal format, for example ab1274. The color palette defined by definecolor is used for pen and fill colors. For text colors see definetextcolor
definecolor 20 [50 20 90]
definecolor 21 "ab1274
deleteoverlay
shapes and graphics
name (word)
none
Deletes the named overlay.
deleteoverlay "myrtlesview
deleteplot
shapes and graphics
name (word)
none
Deletes the named plot. See plot
deleteplot "myplot
deletesticker
shapes and graphics
name (word)
none
Deletes the sticker with the specified name. See placesticker.
deletesticker "marquee
dodecahedron
shapes and graphics
size (number)
none
Creates a dodecahedron (12-sided shape) of the specified size.
dodecahedron 5
dodecahedroid
shapes and graphics
size (number) | ratio (number)
none
Creates a dodecahedroid (12-sided shape) of the specified size and stretched using the specified ratio.
dodecahedroid 5 2
dodecahedroid 10 0.5
dome
shapes and graphics
radius (number) | stacks (number) | sectors (number)
none
Creates a dome
dome 20 10 10
domoid
shapes and graphics
radius (number) | stacks (number) | sectors (number) | stretch (number)
none
Creates a stretched dome.
domoid 20 10 10 2
doppel
shapes and graphics
modelname (word)
none
Like stamp, except creates a reference to the provided model rather than copying the model into the turtle track. This means that if the model changes, its doppel representation will also change.
doppel "myrtle
dot
shapes and graphics
[x y (z)] (list)
none
Puts a dot at the specified co-ordinates using the specified _pen_ color (this is for Apple Logo compatibility). If z is not specified, z = 0. Dots are removed by clean, clearscreen. See dots, dotp, dotsize.
dot [10 10]
dots
shapes and graphics
none
list
Returns a list of the co-ordinates of all the dots currently in the calling turtle’s turtle track. See dot, dotp
show dots
dotsize
shapes and graphics
none
size (number)
Returns the calling turtle’s current dot size. See setdotsize, dot, dotp.
show dotsize
duocutconoid
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
none
Creates a cut conoid with two different oid (stretch) ratios, one for each end. See cutconoid, duocutfunneloid
duocutconoid 20 30 20 20 0.5 2
duocutfunneloid
shapes and graphics
radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
none
Creates a cut funneloid (an uncapped cut conoid) with two different oid (stretch) ratios, one for each end. See cutfunneloid
duocutfunneloid 20 30 20 20 0.5 2
duocylindroid
shapes and graphics
radius (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
none
Creates a cylindroid with two different oid (stretch) ratios, one for each end. See cylindroid, duotuboid
duocylindroid 20 20 20 0.5 2
duotuboid
shapes and graphics
radius (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
none
Creates a tuboid, or stretched tube, with two different oid (stretch) values, one for each end. Can be used to transition between non-oids and oids, or between two oids. See tuboid
duotuboid 10 20 20 0.5 2
ellipse
shapes and graphics
width (number) | height (number)
none
Creates a pen-drawn ellipse of the specified width and height.
ellipse 50 20
endtag
shapes and graphics
none
none
Closes the currently open tag. See tag
endtag
erasetag
shapes and graphics
tag (word)
none
Erases the named tag and its contents.
erasetag "mytag
fill
shapes and graphics
none
none
Currently does nothing. This is OpenGL not Photoshop!
fillcolor
shapes and graphics
none
number
Returns the fill color currently used by the selected turtle.
print myrtle:fillcolor
7
fillshade
shapes and graphics
none
shade (number)
Returns the current fillshade value. See setfillshade
show fillshade
fillopacity
shapes and graphics
none
opacity (number)
Returns the current fill opacity
show opacity
fiso
shapes and graphics
width height
none
Creates a filled isosceles triangle with the center of its base at the root of the selected turtle and aligned with the turtle’s orientation. See iso.
fiso 20 10
frag
shapes and graphics
none
none
Makes a triangle from the current position and previous two turtle positions.
forward 20 right 90 forward 20 frag
funnel
shapes and graphics
radius (number) | depth (number) | sides (number)
Creates a funnel (an uncapped cone).
funnel 20 20 20
funnelslice
shapes and graphics
radius (number) | depth (number) | sidestotal (number) | sidesused (number)
none
Creates a sliced funnel.
funnelslice 20 20 20 10
funneloid
shapes and graphics
radius (number) | depth (number) | sides (number) | ratio (number)
Creates a funneloid (an uncapped conoid).
funneloid 20 20 20 0.5
funneloidslice
shapes and graphics
radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
none
Creates a sliced funneloid.
funneloidslice 20 20 20 10 2
gradient
shapes and graphics
none
none
Causes lines to graduate in color from the pencolor value to the fillcolor value. nogradient disables it. See gradientp
cs gradient randpc randfc repeat 36 [fd 100 rt 170]
hideoverlay
shapes and graphics
name (word)
none
Hides the specified overlay. See newoverlay
hideoverlay "myrtlesview
hideplot
shapes and graphics
plotname (word)
none
Hides (all) the named plot(s). If you want to show / hide one specific instance of a placed plot (since you can place multiple), place them inside of a tag. See tag, showplot, plot
hideplot "myplot
hidesticker
shapes and graphics
name (word)
none
Hides the sticker specified by the provided name parameter. See placesticker
hidesticker "marquee
hidetag
shapes and graphics
tagname (word)
none
Hides the specified tag from displaying. Be aware that this can alter the display of the rest of the turtle track, as the position of the turtle may be altered by the absence of the tag contents from rendering! To solve this problem, call ‘setposition position’ after calling ‘endtag’ when closing a tag. Then, when you hide the tag, the turtle will still end up in the place it lands when the tag is visible, and the remainder of the turtle track rendering will not be disrupted.
hidetag "mytag
hidetrack
shapes and graphics
none
none
Hides the calling turtle’s ‘turtle track’ or visible output. Make it visible again with showtrack.
hidetrack
icosphere ico
shapes and graphics
radius (number)
none
Creates an icosphere of a specified radius. See icosphereoid
icosphere 10
icospheroid
shapes and graphics
radius (number) | multiplier (number)
none
Creates an icosphereoid of a specified radius, stretched using the provided multiplier.
icosphereoid 10 2
images
shapes and graphics
none
list
Returns a list of the currently defined images.
show images
inscribe
shapes and graphics
word, number or list
none
Renders text shapes alongside and to the front of the turtle rather than to the side (as with typeset) using the same size and color as typeset. Unlike typeset, the turtle does not move. See typeset.
repeat 8 [inscribe se char 32 repcount right 45]
iso
width height
none
Draws an isosceles triangle of the specified width and height, with the turtle positioned at the center of the lower side, and the triangle pointing in line with the turtle’s current orientation.
repeat 18 [iso 20 60 rollright 10]
lat
shapes and graphics
size
none
Creates a left-facing right-angle triangle. See rat
lat 20
lightlines
shapes and graphics
none
none
Enables lighting for lines. Normally off by default. As lines have no ‘side’, their ‘normal’ (the direction in which light is reflected) needs to be manually set using setlinesnormal. nolightlines disables it.
lightlines
line
shapes and primitives
length (number)
none
Creates a line of the specified length in front of the calling turtle, without moving that turtle.
repeat 36 [if oddp repcount [line 20] else [line 40] rt 10]
listcolors
shapes and graphics
none
none
Prints out the 64 (0-63) color indexes and their associated RGB values. See colors, showcolors
listcolors
listoverlays
shapes and graphics
none
none
Prints a list of the currently defined overlays.
listoverlays
listplots
shapes and graphics
none
none
Prints a list of the currently defined plots.
listplots
loadtag
shapes and graphics
tagname (word) | tagfile (word)
none
Loads the contents of the specified file into the specified tagname. loadtag creates a new tag at the end of the turtletrack if the tagname does not already exist. See savetag
loadtag "mytag "tagfile
loadtrack
shapes and graphics
filename (word)
none
Loads the saved turtle track, replacing the current turtle track. See savetrack
loadtrack "turtletrack
mark
shapes and graphics
turtle-units (number)
none
Mark moves the turtle forward the specified turtle units, drawing a quad using the ‘marker’ rather than the pen. You can set the diameter of the ‘mark’ using setmarkerwidth
mark 10
merge
shapes and graphics
none
none
Causes the turtle track of a hatchling to merge with its parent at the start of the parents turtle track. The hatchling’s turtle track is empty after the merge. See hatch
merge
modelscale
shapes and graphics
none
scale (number)
Returns the calling turtle’s current modelscale value. Default is 1. See setmodelscale
show modelscale
newmodel
shapes and graphics
name (word) | tagname (word) or [command list] (list)
none
Creates a new model, using either the contents of the specified tag, or the provided list of turtle commands. See setmodel
newmodel "sphere [icosphere 20]
newmodel "fromtag "tag
newoverlay
shapes and graphics
name (word) | turtle (word)
none
Creates a new camera ‘overlay’ or picture-in-picture with the specified name using the point of view of the specified turtle. You position the overlay on the screen using placeoverlay
newoverlay "myrtlesview "myrtle
newplot
shapes and graphics
name (word) | dimensions (list)
Defines a new plot (a grid of pixels or voxels) with the provided name, and of the provided dimensions. If the list has two numbers, a two-dimensional plot is created. If the list has three numbers, a three-dimensional plot is created. See placeplot
newplot “myplot [10 20]
newplot "myplot [5 5 5]
newsticker
shapes and graphics
name (word) | image (word)
none
Defines a new sticker using the provided image. See placesticker
loadimage "marqueeimage "marquee.png
newsticker "marqueesticker "marqueeimage
nextframe
shapes and graphics
none
none
Waits until the next frame of video is rendered. Useful for creating smooth animations in combination with norender and render (eg render nextframe norender) by otherwise disabling rendering except for one nextframe per loop. Warning: If norender is currently set, nextframe will wait indefinitely!
render nextframe norender
nolightlines
shapes and graphics
none
none
Disables line lighting. See lightlines
nolightlines
norender
shapes and graphics
none
none
Disables the renderer. There will be no updates to the graphical output while norender is enabled. This includes view turtle (camera) movement! Pressing the escape key will re-enable render, as will the render primitive. See render
norender
nospeckle
shapes and graphics
none
none
Disables speckling of voxels and quads. See speckle
nospeckle
notrack
shapes and graphics
none
none
Causes the calling turtle not to generate a track and erases any existing track without changing the turtle’s position, after which any shape and graphics primitives are ignored. See track
notrack
notrackrender
shapes and graphics
none
none
Stops the calling turtle’s ‘track’ render from updating. Its current buffered render will continue to be displayed. This is handy for complex scene creation – you can choose to reveal parts of the scene as they are created. See trackrender, hidetrack, showtrack, render, norender
notrackrender
notwosided
shapes and graphics
none
none
Causes the surface of shapes to only be ‘lit’ from one side – in OpenGL parlance, only one side has ‘normals’. This is the default. If you wish both sides of a shape’s surface to be lit, invoke twosided. See twosided
notwosided
octahedron
shapes and graphics
size (number)
none
Creates a octahedron (8-sided shape) of the specified size.
octahedron 5
octahedroid
shapes and graphics
size (number) | ratio (number)
none
Creates a octahedroid (8-sided shape) of the specified size and stretched using the specified ratio.
octahedroid 5 2
octahedroid 10 0.5
oval
shapes and graphics
width (number) | height (number)
none
Creates a filled oval of the specified width and height. See ellipse
oval 50 20
overlays
shapes and graphics
none
list
Returns a list of the currently defined overlays.
show overlays
peak
shapes and graphics
width | height | depth
none
Creates a lined wedge around and beneath the calling turtle. The width distance is the distance to one side of the turtle (the total width of the peak is double the provided width value).
peak 10 20 30
pencolor pc
shapes and graphics
none
number
Returns the current pen color.
show pencolor
pendown pd
shapes and graphics
none
none
Puts the calling turtle’s ‘pen’ down (causes it to draw a line when moved).
pendown
penopacity
shapes and graphics
none
number
Returns the calling turtles pen opacity. See setpenopacity
shoe penopacity
penshade
shapes and graphics
none
shade (number)
Returns the current pen shade value. See setpenshade
show penshade
penup pu
shapes and graphics
none
none
Lifts the calling turtle’s pen up, it won’t draw a line when it moves. See pendown
penup
pie
shapes and graphics
degrees (number) | radius (number)
none
Creates a pie-chart like object of the specified radius and degrees, starting at the turtle’s right vector and moving counter-clockwise.
pie 270 20
pin
shapes and graphics
none
none
Drops a ‘pin’, for use with pinfrag and pinshard
pin
pinfrag
shapes and graphics
none
none
Creates a ‘frag’ using the last three dropped ‘pins’. See pin, frag
pinfrag
pinshard
shapes and graphics
none
none
Creates a ‘shard’ using the last three dropped ‘pins’. See pin, shard
pinshard
placeoverlay
shapes and graphics
name (word) | [x1% y1% x2% y2%] (list)
none
Places the named overlay on the screen over the list of co-ordinates which are specified in terms of percentages. See newoverlay
placeoverlay "myrtlesview [0 0 50 50]
placeplot
shapes and graphics
name (word) | voxel / pixel size (list)
none
Places the named plot at the current turtle position using pixels (by providing a list of two) or voxels (by providing a list of three)
placeplot "myplot [10 10]
would place a plot using pixels 10 turtle-units in size, while
placeplot "myplot [5 5 5]
would place a plot using voxels 5 turtle-units in size
placesticker
shapes and graphics
name (word) | [x1% y1% x2% y2%] (list)
none
Places the sticker with the provided name over the area of the screen specified by the provided list, which is in terms of percentages of the screen dimensions, where 100% is the right / bottom and 0% is the left / top. As the name suggests, a sticker is a static image which does not move with the camera view, as if you stuck a sticker to your display. See stickers, stickerp
loadimage "marquee "marquee.png
newsticker "marqueesticker "marquee
placesticker "marqueesticker "marquee [25 25 75 75]
plot
shapes and graphics
coordinates (list)
none
Plots a pixel / voxel at the specified co-ordinates in the currently selected plot. The list may contain two or three numbers depending on if the plot is two- or three-dimensional. See placeplot
plot [10 20]
plot [10 20 10]
plotcol
shapes and graphics
coordinates (list)
number
Returns the color (if any) of the specified pixel / voxel in the currently selected plot. The list of coordinates may contain two or three numbers, depending on if the selected plot is two- or three-dimensional. See plot
show plotcol [10 20]
show plotcol [10 20 10]
plotline
shapes and graphics
start co-ordinates (list) | end co-ordinates (list)
none
Plots a line from and including the first set of provided co-ordinates to and including the second set of provided co-ordinates. The co-ordinates may contain two or three numbers dependent on if the plot has two or three dimensions. See plot
plotline [1 1 1] [5 5 5]
plots
shapes and graphics
none
list
Returns a list of the currently defined plots. See newplot, placeplot, plot
show plots
plottotrack
shapes and graphics
plotname (word) | [x y z] list
instructions (list)
Renders the given plot with the voxel size specified in the given list as a series of instructions that can be passed into setmodel to turn a plot directly into a turtle model (with the turtle’s position being the dead center of the plot). Using plottotrack in isolation will cause the turtle to render the plot. See plot
setmodel “model plottottrack “plot [1 1 1]
plottotrack “plot
poly
shapes and graphics
radius (number) | sides (number)
none
Draws a convex polygon of the specified radius and number of sides.
poly 10 6
polyellipse
shapes and graphics
width (number) | height (number) | sides (number)
none
Draws a convex polygon of the specified dimensions and sides.
polyellipse 20 10 10
polyoval
shapes and graphics
width (number) | height (number) | sides (number)
none
Creates a filled convex polygon of the specified dimensions and sides.
polyoval 10 20 5
polyspot
shapes and graphics
radius (number) | sides (number)
Creates a filled convex polygon of the specified radius and number of sides.
polyspot 20 5
prism
shapes and graphics
width | height | depth
Creates a lined prism to the right, forward and under the turtle.
prism 20 10 30
pyramid
shapes and graphics
size (number)
none
Creates a pyramid (5-sided shape) of the specified size.
pyramid 10
pyramoid
shapes and graphics
size (number) | ratio (number)
none
Creates a pyramoid (stretched pyramid) of the specified size and stretch ratio.
pyramoid 10 2
quad
shapes and graphics
width | height
Creates a ‘quad’, a two-dimensional filled rectangle of the specified width and height, to the front and right of the turtle.
quad 20 10
ramp
shapes and graphics
width (number) | height (number) | depth (number)
none
Creates a filled wedge, or ‘ramp’ using the provided dimensions.
ramp 10 20 30
randomfillcolor randfc
shapes and graphics
none
none
Sets a random fill color (1 – 15). See setfillcolor
randomfillcolor sphere 10
randomfillshade randfs
shapes and graphics
none
none
Sets a random fill shade value. See setfillshade
randomfillshade
randompencolor [randpc]
shapes and graphics
none
none
Sets a random pen color (1 – 15)
pendown repeat 10 [randvec randompencolor fd 100 home]
randompenshade randps
shapes and graphics
none
none
Sets a random pen shade value. See setpenshade
randpenshade
rat
shapes and graphics
length
none
Creates a filled isosceles right angle triangle with two sides of the same specified length.
rat 20
rect
shapes and graphics
width (number) | height (number)
none
Creates a pen-drawn rectangle of the specified width and height to the front and right of the current turtle.
rect 10 20
replacetag
shapes and graphics
name (word) | list
none
Replaces the contents of the named tag with the contents of the provided list of turtle primitives.
replacetag "mytag [FD 20 RT 90 FD 20 RT 90]
resetmodel
shapes and graphics
none
none
Resets the turtle’s model to its default.
resetmodel
rhombus
shapes and graphics
width (number) | height (number)
none
Creates a 2D rhombus of the specified width and height.
rhombus 30 10
ring
shapes and graphics
thickness (number) | inner radius (number) | segments (number)
none
Creates a two-dimensional ring of the specified thickness, inner radius and segments. A segment number of 4 creates a square picture frame, while 3 creates a triangle. See ringarc
ring 10 30 10
ringarc
shapes and graphics
thickness (number) | inner radius (number) | totalsegments (number) | arcsegments (number)
none
Creates a partial ring of the specified number of segments. So, if the totalsegments specified were 10, an arcsegments value of 5 would create a half-ring.
ringarc 10 30 10 5
rope
shapes and graphics
length (number)
none
Draws a ‘rope’, a cylinder of the specified length, and places the turtle at its end, similar to mark or forward. You can set the diameter of the rope with setropewidth, and the number of sides the rope has using setropesides. See ropesides, ropewidth
rope 10
ropesides
shapes and graphics
none
number
Returns the number of sides of the cylinder drawn by rope. See setropesides
show ropesides
ropewidth
shapes and graphics
none
number
Returns the current width or radius of the rope. See setropewidth
show ropewidth
sample
shapes and graphics
image (word) | position (list)
RGBA (list)
Sample returns a list of the RGBA values of the pixel at the specified position (given in terms of percentages, measured from the bottom-left corner of the image) in the specified loaded image. For example, sample “frog [50 50] will return the color of the pixel located at 50% of frog’s height, and 50% of frog’s width. Sample can be used to determine the color of a pixel underneath a turtle, for example, by doing a bit of funky math.
show sample "frog [50 50]
saveimage
shapes and graphics
image | filename
none
Saves an internally stored image. Useful for saving internally created or modified images.
saveimage "myimage "imagefile
savemodel
shapes and graphics
modelname (word) | modelfile (word)
none
Saves the specified model name into the specified model file. See loadmodel
savemodel "mymodel "modelfile.mdl
savetag
shapes and graphics
tagname (word) | tagfile (word)
none
Saves the contents of the specified tag to the specified filename. See loadtag
savetag "mytag "tagfile
savetrack
shapes and graphics
filename
none
Saves the calling turtle’s ‘turtle track’ to a file.
savetrack
selectplot
shapes and graphics
name (word)
none
Selects the named plot for use with plot, unplot, plotcol. See plot
selectplot "myplot
setdotsize
shapes and graphics
size (number)
none
Sets the calling turtle’s dot size. All of a turtle’s dots are of the same size, but different turtles can have different-sized dots. See dotsize, dot, dotp.
setdotsize 5
setfillcolor setfc
shapes and graphics
color (number)
none
Sets the ‘fill’ color used by the turtle when creating shapes.
setfillcolor 3
setfillcolor blue
setfillshade setfs
shapes and graphics
shade (number)
none
Sets the shade of the fill color to be displayed when rendering subsequent shapes. It can be set to a number from 0 to 15, which represents a decrease in brightness of the fill color of 6.25 times that number. So, a value of 8 decreases the brightness by 50%. Negative shade values add 1/16th of the difference between each of the base RGB values of the color and 255
setfillshade 5
setfillopacity setfo
shapes and graphics
opacity (number)
none
Sets the fill opacity, takes a number from 0 to 100.
setfillopacity 50
seticosphereiterations
shapes and graphics
number
none
Sets the complexity of the icosphere, from 0 to 3
seticosphereiterations 3
setlinesnormal
shapes and graphics
vector (list)
none
Sets the ‘normal’ vector to be used by lightlines. All lines use the same vector. This is easiest taken from a turtle. Remember that if you take the forwarddir from Snappy, you will need to reverse it, using vectorsub! See lightlines
setlinesnormal vectorsub snappy:forwarddir [0 0 0]
setmarkerwidth
shapes and graphics
radius (number)
none
Sets the width of the mark primitive. The default is 2. See mark
setmarkerwidth 10
setoverlayresolution
shapes and graphics
name (word) | ratio (number)
none
Sets the resolution or pixel density of the named overlay, based on a ratio where 1 is 512 pixels by 384 pixels (at a 16:9 ratio)
setoverlayresolution "myrtlesview 2
setoverlaytransparency
shapes and graphics
name (word) | boolean
none
Turns on background transparency for the specified overlay. If transparency is off, the background color in the overlay view is solid.
setoverlaytransparency "myrtlesview on
setoverlayupdate
shapes and graphics
name (word) | frames per second (number)
none
Sets the update frequency of the named overlay to the provided number of frames per second. See newoverlay
setoverlayupdate "myrtlesview 10
setpencolor setpc
shapes and graphics
color (number)
none
Sets the pen color to the provided color index. Note that there are a number of color functions that return their corresponding numbers, such as yellow and blue, that can be used in place of a number. See colors
setpencolor yellow
setpc 13
setpenshade setps
shapes and graphics
shade (number)
none
Sets the shade of the pen color to be displayed when rendering subsequent lines. It can be set to a number from 0 to 15, which represents a decrease in brightness of the pen color of 6.25 times that number. So, a value of 8 decreases the brightness by 50%.
setpenshade 5
setropesides
shapes and graphics
sides (number)
none
Sets the number of sides of the cylinder created by the rope primitive. The default is 10. See rope, ropesides
setropesides 3
setropewidth
shapes and graphics
number
none
Sets the radius of the ‘rope’. See rope, ropewidth, ropesides
setspecklecolors
shapes and graphics
list
none
Takes a list of colors to be used in the generation of speckle patterns. If you want to weight a random speckle towards a particular color, simply include it more than once in the request, such as the example below.
setspecklecolors [1 1 1 1 2 2 3]
setspecklecolors {:col1 :col1 :col2}
setspeckleplot
shapes and graphics
plotname (word)
none
Selects the name of the plot to use to generate a speckle, if using the plot style with speckle.
setspeckleplot "myplot
setspecklesize
shapes and graphics
turtleSteps
none
Sets the pixel size used in generating speckles, in turtleSteps.
setspecklesize 1
setspecklestyle
shapes and graphics
“styletype
none
Selects the style to use when generating speckles. You can choose from “repeat “dither “random or “plot.
setspecklestyle "random
setspheroidaxis
shapes and graphics
boolean
none
Sets the axis by which spheroids are stretched. 0 is equatorial while 1 is polar. See spheroidaxis
setspheroidaxis 1
settypedelay
shapes and graphics
60ths-of-a-second (number)
none
Sets a delay between the rendering of each letter rendered by ‘typeset’. This delay is specified in 60ths of a second – 60 equalling one second. See typeset
settypedelay 60
settypedepth
shapes and graphics
turtle-units (number)
none
Sets the depth of three-dimensional type created by ‘typeset’. See typeset
settypedepth 3
settypefont
shapes and graphics
font-id (number)
none
Sets the font used for ‘typeset’. Default is 1. See settextfont
settypefont 1
settypefilled
shapes and graphics
boolean
none
If set true (default), typeset and inscribe create ‘filled’ characters. If false, they create lined cube characters.
settypefilled false
settypesize
shapes and graphics
size (number)
none
Sets the size (in turtle units) of the font used by typeset and inscribe. See typeset
settypesize 10
settypestretch
shapes and graphics
ratio
none
Stetches text rendered using typeset or inscribe by the specified ratio.
settypestretch 2
setview sv
shapes and graphics
turtle (word)
none
Sets the current “view turtle” – the turtle from whose viewpoint the display is generated.
setview "myrtle
setviewfar
shapes and graphics
distance (number)
none
Sets the far clipping plane, the distance at which OpenGL objects stop being rendered or are clipped. This must be set by the view turtle. See setviewnear
setviewfar 1000
setviewfov
shapes and graphics
angle (number)
none
Sets the turtle’s viewing angle, the angle of view displayed in the window. The default is 60
setviewfov 60
setviewnear
shapes and graphics
distance (number)
none
Sets the near clipping plane. OpenGL objects closer than this distance are not rendered or are clipped. This must be set by the view turtle. See setviewfar
setviewpoint
shapes and graphics
list
none
Positions the view by the provided [X (left-right) Y (down-up) Z (back-forward)] list of turtle units, where a negative value has the first effect and a positive value has the second effect.
setviewpoint [10 -10 0]
setviewvectors
shapes and graphics
vectors (list)
none
Sets arbitrary view vectors for the current turtle. When selected as a view (camera) turtle, if viewvectors are set the display will always be rendered in the direction and orientation specified by those vectors, regardless of the turtle’s orientation. To return to using the turtle’s orientation, specify an empty list, eg: setviewvectors []
setviewvectors vectors
setzoom
shapes and graphics
percentage (number)
none
Sets the view turtle’s camera ‘zoom’ – the default is 100%
setzoom 50
shard
shapes and graphics
depth (number)
none
Creates a ‘shard’ or a three-dimensional fragment using the current and two previous turtle positions with a depth specified by its input parameter.
shard 10
showoverlay
shapes and graphics
name (word)
none
Shows the specified overlay. See newoverlay
showoverlay "myrtlesview
showplot
shapes and graphics
plotname (word)
none
Shows (all) the named plot(s). If you want to show / hide one specific instance of a placed plot (since you can place multiple), place them inside of a tag. See tag, hideplot, plot
showplot "myplot
showsticker
shapes and graphics
name (word)
none
Shows the sticker with the provided name. See placesticker
show "marquee
showtag
shapes and graphics
tag (word)
none
Shows (makes visible) the specified tag. See tag
showtag "mytag
showtrack
shapes and graphics
none
none
Shows the calling turtles ‘turtle track’ or visible output. See hidetrack
showtrack
speckle
shapes and graphics
none
none
Enables ‘speckling’ (generated pixelated texturing) of any following square, quad, voxel and voxeloid shapes. These are configured using setspecklestyle (repeat, random or plot), setspecklecolors, setspecklesize and optionally setspeckleplot. nospeckle disables speckling
speckle
specklecolors
shapes and graphics
none
list
Returns the currently defined speckle colors. See speckle
show specklecolors
speckleplot
shapes and graphics
none
word
Returns the plot currently used by speckle in the plot style. See setspecklestyle
show speckleplot
specklesize
shaoes and graphics
none
number
Returns the currently defined speckle size. See setspecklesize, speckle
show specklesize
specklestyle
shapes and graphics
none
word
Returns the current speckle style. See speckle
show specklestyle
"random
sphere
shapes and graphics
radius (number) | stacks (number) | sectors (number)
none
Creates a sphere of the specified radius using the specified number of stacks and the specified number of sectors. Small stack and sector values create interesting shapes. As opposed to icosphere
sphere 20 10 10
sphereslice
shapes and graphics
radius (number) | stacks (number) | sectorstotal (number) | sectorsused (number)
none
Creates a partial sphere of the overall specified radius, using the specified number of vertical ‘stacks’, and specified number of horizontal ‘sectors’, based on the given total number of sectors, and the used (displayed) number of sectors. Like an orange cut vertically. See cutsphere, cutsphereslice
sphereslice 20 10 10 5
spheroid
shapes and graphics
radius (number) | stacks (number) | sectors (number) | multiplier (number)
none
Creates an spheroid of a specified radius, stacks and sectors, stretched using the provided multiplier.
sphereoid 20 10 10 2
spheroidaxis
shapes and graphics
none
boolean
Returns the current spheroid axis, the axis along which spheroids are stretched. 0 is equatorial and 1 is polar.
show spheroidaxis
spheroidslice
shapes and graphics
radius (number) | stacks (number) | sectorstotal (number) | sectorsused (number) | multiplier (number)
none
Creates a partial spheroid of the overall specified radius, using the specified number of vertical ‘stacks’, and specified number of horizontal ‘sectors’, based on the given total number of sectors, and the used (displayed) number of sectors, and stretched using the provided multiplier. Like a squashed orange cut vertically. See cutspheroid, cutspheroidslice
spheroidslice 20 10 10 5 2
spot
shapes and graphics
radius (number)
none
Creates a filled circle of the specified radius.
spot 50
square
shapes and graphics
size (number)
none
Creates a filled square of the specified size.
square 20
stamp
shapes and graphics
modelname (word)
none
‘Stamps’ a copy of the specified model at the current location using the current model scale.
cs pu repeat 20 [setmodelscale repcount / 10 stamp "plane fd 3 * repcount]
stickers
shapes and graphics
none
list
Returns the currently defined stickers. See newsticker
show stickers
switchtag
shapes and graphics
tag1 (word) | tag2 (word)
none
Hides tag1 and shows tag2, like flipping a switch. See tag
switchtag "tag1 "tag2
tag
shapes and graphics
name (word)
list
Returns the contents of a tag, as a list of turtle primitives. See begintag
show tag "mytag
tags
shapes and graphics
none
list
Returns a list of the current turtle’s defined tags.
show tags
tent
shapes and graphics
half-width (number) | height (number) | depth (number)
none
Creates an opaque (solid) prism to the left, right and front of the turtle.
tent 10 10 5
tetrahedron
shapes and graphics
size (number)
none
Creates a tetrahedron (4-sided shape) of the specified size.
tetrahedron 5
tetrahedroid
shapes and graphics
size (number) | ratio (number)
none
Creates a tetrahedroid (4-sided shape) of the specified size and stretched using the specified ratio.
tetrahedroid 5 2
tetrahedroid 10 0.5
toroid
shapes and graphics
thickness (number) | radius (number) | sides (number) | segments (number) | ratio (number)
none
Creates a torusoid, an extruded three-dimensional ring, stretched by a ratio where 1 is a normal torus.
torus 10 30 4 16 0.5
toroidslice
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | startsides (number) | endsides (number)
none
Creates a ‘slice’ of a torus, based on the startsides and endsides value. Note that using a negative thickness value inverts the slice.
torusslice 5 15 20 20 10 15
torusslice -5 15 20 20 10 15
torus
shapes and graphics
thickness (number) | radius (number) | sides (number) | segments (number)
none
Creates a torus, also known as a rhombus or a donut, a three-dimensional ring. Sides and segments can be as low as 3.
torus 10 30 4 16
track
shapes and graphics
none
none
Allows the calling turtle’s track to be created. See notrack
track
trackcount
shapes and graphics
none
number
Returns the number of items in the current turtle’s track.
show trackcount
trackitem
shapes and graphics
number
list
Returns the number last track item in the selected turtle’s track, where 1 returns the latest track entry
show trackitem 1
tracklist
shapes and graphics
number
list
Returns the last number latest track items in forward chronological order, the first being the oldest and the last being the newest and most recent.
show tracklist 5
trackrender
shapes and graphics
none
none
Causes the calling turtle’s ‘track’ to be rendered (updated) by the graphics renderer from the point it is called onwards. See notrackrender
trackrender
triangle
shapes and graphics
width (number) | height (number)
none
Creates a wireframe (pen-drawn) right-angle triangle to the front and right of the turtle.
triangle 10 20
tube
shapes and graphics
radius (number) | depth (number) | sides (number)
none
Creates a hollow tube.
tube 10 20 20
tubearc
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number)
none
Creates a tube arc.
tubearc 5 15 20 20 10
tubearcoid
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)
none
Creates a tube arcoid (extruded based on the provided ratio).
tubearcoid 5 15 20 20 10 2
tubearcslice
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides (number)
Creates a slice of a partial tube. Note: If you invert the thickness value, you can ‘slice’ the opposite side.
tubearcslice 5 15 20 20 10 5 15
tubeslice
shapes and graphics
radius (number) | depth (number) | sidestotal (number) | sidesused (number)
none
Creates a ‘slice’ of a tube, based on the sidestotal and sidesused values.
tubeslice 20 20 10 4
tuboid
shapes and graphics
radius (number) | depth (number) | sides (number) | ratio (number)
none
Creates a tuboid, or stretched tube.
tuboid 10 20 20 0.5
tuboidarc
shapes and graphics
thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)
none
Creates a tube arc extruded by the provided ratio.
tuboidarc 5 15 20 20 10 2
tuboidarcslice
shapes and graphics
thickness (number) | radius (number) | totalsides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides | ratio (number)
none
Creates a tube arc sliced by the provided sides values and extruded by the provided ratio.
tuboidarcslice 5 15 20 20 10 10 15 2
tuboidslice
shapes and graphics
radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
none
Creates a stretched ‘slice’ of a tube, based on the sidestotal and sidesused values, and the stretching ratio (normal is 1, half is 0.5, double is 2 etc.)
tuboidslice 10 20 20 10 0.5
tuboidslice 10 20 20 10 2
twosided
shapes and graphics
none
none
Lights both sides of the surface of a shape. Useful for shapes where both sides of the surface are visible. The default is that they are unlit. Whether to use twosided or not is a purely stylistic choice in most cases. See notwosided, which turns twosided off.
twosided
typeset
shapes and graphics
word or [list]
Typeset renders the provided word or list as three-dimensional text to the right of the turtle one character at a time, moving the turtle to the right as it does so.
typeset [Welcome to turtlespaces!]
typeset {[Happy New Year] year [!]}
typedepth
shapes and graphics
none
depth (number)
Returns the current depth of text rendered using typeset. See typeset
show typedepth
typefont
shapes and graphics
none
font (number)
Returns the index of the font used by typeset. See typeset
show typefont
typesize
shapes and graphics
none
size (number)
Returns the size of the text rendered by typeset. See typeset.
show typesize
typestretch
shapes and graphics
none
size (number)
Returns the ratio by which text rendered by typeset will be stretched. See typeset.
show typestretch
unplot
shapes and graphics
co-ordinates [list]
none
‘Unplots’ or removes the pixel / voxel from the selected plot at the provided co-ordinates. The list of coordinates may contain two or three numbers, depending on if the selected plot is two- or three-dimensional. See plot
unplot [10 10]
unplot [20 10 10]
viewfar
shapes and graphics
none
turtle-units (number)
Returns the value of the far clipping plane. See setviewfar
show viewfar
viewfov
shapes and graphics
none
angle (number)
Returns the current viewing angle, or field of view. See setviewfov
show viewfov
viewnear
shapes and graphics
none
turtle-units (number)
Returns the current near clipping plane. See setviewnear
show viewnear
viewvectors
shapes and graphics
none
list
Returns the calling turtle’s view vectors. See setviewvectors
show viewvectors
voxel
shapes and graphics
turtle-steps
none
Creates a filled cube turtle-steps wide, high and deep to the right, forward and down of the turtle.
voxel 20
voxeloid
shapes and graphics
turtle-steps-right turtle-steps-forward turtle-steps-deep
none
Creates a filled cuboid to the right, forward and down of the turtle.
voxeloid 10 20 30
wedge
shapes and graphics
turtle-steps-right turtle-steps-forward
Creates a filled right-angle triangle turtle-steps-right from the turtle and turtle-steps-forward from the turtle in dimensions.
wedge 20 4