Reference › Shapes and Graphics — 206 commands
amigaball
Also: ab
Input: radius (number) | stacks (number) | sectors (number)
Output: none
Creates an 'Amiga ball', a sphere that alternates sectors between the pen color and the fill color.
amigaball 50 10 20
amigaballoid
Also: abo
Input: radius (number) | stacks (number) | sectors (number) | ratio (number)
Output: none
Creates a stretched or flattened Amiga ball, based on the supplied ratio. Respects setspheroidaxis
amigaballoid 50 10 20 0.5
arc
Input: degrees | radius
Output: 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
beginfill
Input: none
Output: none
Starts the collection of points used in creating an arbitrary (user-designed) 2D shape. The turtle's z-position must not change while drawing the shape. The path must not overlap. Once the path is completed, use endfill to generate the shape. See endfill
setfillcolor 12
beginfill repeat 6 [forward 40 right 60] endfill
billboard
Input: name (word) | dimensions (list)
Output: none
Creates a 'billboard' using the specified image and the specified list of dimensions [x y]. If the width or height of the billboard is given as a single list item, eg [20], billboard will center the image on the turtle appropriately. See sample
billboard "marquee [100 200]
billboard "image [[100][100]]
box
Input: size (number)
Output: none
Creates a lined square of the specified size. If the parameter is supplied as a single-item list, the box is centered on the turtle. See rect
box 20
box [20]
cappedcutsphere
Input: radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number)
Output: none
Creates a truncated, or cut, sphere with caps on the cut ends. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. See cappedcutspheroid
cappedcutsphere 30 14 32 4 13
cappedcutspheroid
Input: radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number) | ratio
Output: none
Creates a truncated, or cut, spheroid with caps on the cut ends stretched by the specified ratio. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. See cappedcutspheroid, setspheroidaxis
cappedcutspheroid 30 14 32 4 13 2
cappeddome
Input: radius (number) | stacks (number) | sectors (number)
Output: none
Creates a 'capped' dome, a dome with a circle 'sealing' its bottom. See dome, cappeddomoid
cappeddome 30 20 20
cappeddomoid
Input: radius (number) | stacks (number) | sectors (number) | ratio
Output: none
Creates a capped dome stretched by the given ratio. See cappeddome, setspheroidaxis
cappeddomoid 30 20 20 0.5
cappedsphereslice
Input: radius (number) | stacks (number) | sectorstotal (number) | sectorsused (number)
Output: 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
cappedspheroidslice
Input: radius (number) | stacks (number) | sectorstotal (number) | startsector (number) | endsector (number) | multiplier (number)
Output: 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 startsector and endsector values, and stretched using the provided multiplier. Like a squashed orange cut vertically. See cutspheroid, cutspheroidslice
spheroidslice 20 10 10 5 10 2
circle
Also: cir
Input: radius
Output: none
Creates a lined circle at the specified radius around the turtle
circle 50
repeat 18 [circle 50 rr 10]
clearimage
Input: imagename (word)
Output: none
Clears the specified image from memory.
clearimage "image
clearimages
Input: none
Output: none
Clears all iamges from memory.
clearimages
clearpins
Input: none
Output: none
Clears the list of pins. See pin
clearpins
cone
Also: cn
Input: radius (number) | depth (number) | sides (number)
Output: none
Creates a cone pointing downward from and centered on the calling turtle.
cone 20 10 20
coneslice
Also: csl
Input: radius (number) | depth (number) | sidestotal (number) | sidesused (number)
Output: none
Creates a sliced cone.
coneslice 20 20 20 10
conoid
Also: cno
Input: radius (number) | depth (number) | sides (number) | ratio (number)
Output: none
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
Also: cosl
Input: radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
Output: none
Creates a sliced conoid.
conoidslice 20 20 20 10 2
cube
Also: cb
Input: size or [size]
Output: none
Creates a wireframe cube of the specified size up, right and below the turtle unless the size is given as a [list] in which case it centers around the turtle
cube 20
cuboid
Also: cbo
Input: width | height | depth
Output: none
Creates a wireframe cuboid of the specified dimensions
cuboid 30 20 10
cutcone
Also: cc
Input: radiusnear (number) | radiusfar (number) | depth (number) | sides (number)
Output: none
Creates a truncated, or cut, cone. See cone
cutcone 10 20 30 30
cutconeslice
Also: ccs
Input: radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number)
Output: none
Creats a cut, sliced cone. See coneslice
cutconeslice 20 40 20 20 10
cutconoid
Also: cco
Input: radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio (number)
Output: none
Creates a truncated, or cut, conoid, stretched based on the provided ratio. See conoid
cutconoid 10 20 30 30 2
cutconoidslice
Also: ccos
Input: radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
Output: none
Creates a cut, sliced conoid, stretched based on the provided ratio. See conoid
cutconoidslice 10 20 30 30 15 2
cutfunnel
Also: cf
Input: radiusnear (number) | radiusfar (number) | depth (number) | sides (number)
Output: none
Creates a cut funnel (an uncapped cut cone).
cutfunnel 20 10 20 20
cutfunneloid
Also: cfo
Input: radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio (number)
Output: none
Creates a cut funneloid (an uncapped cut conoid).
cutfunneloid 20 30 20 20 0.5
cutfunneloidslice
Also: cfos
Input: radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
Output: none
Creates a cut, sliced funneloid (an uncapped cut conoid).
cutfunneloidslice 20 30 20 20 10 0.5
cutfunnelslice
Also: cfs
Input: radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number)
Output: none
Creates a sliced, cut funnel (an uncapped cut cone).
cutfunnelslice 20 10 20 20 10
cutsphere
Also: csp
Input: radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number)
Output: 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
Also: css
Input: radius (number) | stacks (number) | totalsectors (number) | minstack (number) | maxstack (number) | usedsectors (number)
Output: 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. If usedsector is supplied as a single list value eg [5], cutsphereslice renders only that sector. See sphereslice, cutsphere
cutsphereslice 30 20 20 5 15 10
cutspheroid
Also: cso
Input: radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number) | ratio (number)
Output: 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
Also: csos
Input: radius (number) | stacks (number) | totalsectors (number) | minstack (number) | maxstack (number) | startsector (number) | endsector (number) | ratio (number)
Output: 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 startsector and endsector. Is stretched by the ratio provided. See spheroidslice, cutspheroid
cutspheroidslice 30 20 20 5 15 5 10 2
cylinder
Also: cy
Input: radius (number) | depth (number) | sides (number)
Output: none
Creates a cylinder. If depth is provided as a list, centers the cylinder on the turtle
cylinder 20 30 10
cylinderarc
Also: cya
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number)
Output: none
Creates a partial torus, or curved cylinder.
cylinderarc 5 15 20 20 10
cylinderarcslice
Also: cyas
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides (number)
Output: none
Creates a slice of a partial torus, or curved cylinder. If arcsegments is provided as a single list value eg [5] then cylinderarcslice renders only that segment. Note: If you invert the thickness value, you can 'slice' the opposite side.
cylinderarcslice 5 15 20 20 10 5 15
cylinderslice
Also: cys
Input: radius (number) | depth (number) | totalsides (number) | slicesides (number)
Output: 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
Also: cyo
Input: radius (number) | depth (number) | sides (number) | ratio (number)
Output: none
Creates a cylindoid. If the depth parameter is provided as a list, centers the cylindroid on the turtle
cylindroid 20 30 10 2
cylindroidarc
Also: cyoa
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)
Output: none
Creates a cylinder arc extruded by the provided ratio.
cylindroidarc 5 15 20 20 10 2
cylindroidarcslice
Also: cyoas
Input: thickness (number) | radius (number) | totalsides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides | ratio (number)
Output: 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
Also: cyos
Input: radius (number) | depth (number) | totalsides (number) | slicesides (number) | ratio (number)
Output: 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
deformed
Also: dfm
Input: "shape (word) | radius (number) or [X Y (Z)] (list) | [points-x points-y (points-z)] (list) | "tablename (word) | smoothing (number)
Output: none
Creates a quad, voxeloid or sphere out of a lattice of division points, displaces each of those points by the amount held in the matching cell of the named table, then inserts smoothing extra points between each pair of division points using a spline. A single size value is a radius, applied to every axis, while a list gives the shape's full width, height and depth. Division counts are numbers of points, with a minimum of 2. Table values are in turtle-steps and negative values pull a point inwards, while empty, missing or non-numeric cells read as 0. X is to the right of the turtle, Y is forward and Z is up. quad reads sheet 1, cell [y x], and pushes each point along Z, ignoring points-z. sphere reads sheet 1, cell [latitude longitude], as a deviation of that point's radius, ignoring points-z, with latitude running from the -Z pole to the +Z pole and longitude wrapping around. voxeloid reads one sheet per face, in the order +X, -X, +Y, -Y, +Z, -Z, each pushing that face's points along its own outward normal. voxeloid faces are welded at their shared edges and corners, so they never pull apart: where faces meet, their deviations compose, meaning a corner pushed by three sheets travels diagonally. See voxeloid, sphere, quad, newtable, setcell
newtable "bumps [8 12 6]
setcell "bumps [3 3] 40
deformed "quad 100 [5 5] "bumps 0
deformed "sphere 100 [12 8] "bumps 3
deformed "voxeloid 100 [5 5 5] "bumps 2
deleteoverlay
Input: name (word)
Output: none
Deletes the named overlay.
deleteoverlay "myrtlesview
deletesticker
Input: name (word)
Output: none
Deletes the sticker with the specified name. See placesticker.
deletesticker "marquee
dodecahedron
Also: dod
Input: size (number)
Output: none
Creates a dodecahedron (12-sided shape) of the specified size.
dodecahedron 5
dodecahedroid
Also: dodo
Input: size (number) | ratio (number)
Output: 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
Also: dm
Input: radius (number) | stacks (number) | sectors (number)
Output: none
Creates a dome
dome 20 10 10
domoid
Also: dmo
Input: radius (number) | stacks (number) | sectors (number) | stretch (number)
Output: none
Creates a stretched dome.
domoid 20 10 10 2
doppel
Input: modelname (word)
Output: 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
Input: [x y (z)] (list)
Output: 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 clearscreen but not clean (this is a slight deviation from Apple Logo's behavior, for utility.) See dots, dotp, dotsize.
dot [10 10]
dots
Input: none
Output: 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
Input: none
Output: size (number)
Returns the calling turtle's current dot size. See setdotsize, dot, dotp.
show dotsize
duocutconoid
Also: dcc
Input: radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
Output: 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
Also: dcfo
Input: radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
Output: 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
Also: dco
Input: radius (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
Output: 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
Also: dto
Input: radius (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)
Output: 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
Also: ell
Input: half-width (number) | half-height (number)
Output: none
Creates a pen-drawn ellipse of the specified width and height. See oval
ellipse 50 20
endfill
Input: none
Output: none
Concludes the collection of points used in the creation of an arbitrary (user-created) 2D shape. If the path overlaps or changes Z-position the creation of the shape may fail, try can be used to mitigate this. See beginfill
beginfill repeat 3 [forward 60 right 120] endfill
fiso
Input: half-width height OR [height]
Output: none
Creates a filled isosceles triangle with the center of its base at the root of the selected turtle OR [centered on turtle] and aligned with the turtle's orientation. See iso.
fiso 20 10
funnel
Also: fu
Input: radius (number) | depth (number) | sides (number)
Output: none
Creates a funnel (an uncapped cone).
funnel 20 20 20
funnelslice
Also: fus
Input: radius (number) | depth (number) | sidestotal (number) | sidesused (number)
Output: none
Creates a sliced funnel.
funnelslice 20 20 20 10
funneloid
Also: fuo
Input: radius (number) | depth (number) | sides (number) | ratio (number)
Output: none
Creates a funneloid (an uncapped conoid).
funneloid 20 20 20 0.5
funneloidslice
Also: fuos
Input: radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
Output: none
Creates a sliced funneloid.
funneloidslice 20 20 20 10 2
hideoverlay
Input: name (word)
Output: none
Hides the specified overlay. See newoverlay
hideoverlay "myrtlesview
hidesticker
Input: name (word)
Output: none
Hides the sticker specified by the provided name parameter. See placesticker
hidesticker "marquee
icosphere
Also: ico
Input: radius (number)
Output: none
Creates an icosphere of a specified radius. See icosphereoid
icosphere 10
icospheroid
Also: icd
Input: radius (number) | multiplier (number)
Output: none
Creates an icosphereoid of a specified radius, stretched using the provided multiplier.
icosphereoid 10 2
images
Input: none
Output: list
Returns a list of the currently defined images.
show images
iso
Input: half-width height OR [height]
Output: none
Draws an isosceles triangle of the specified width and height, with the turtle positioned at the center of the lower side OR [centered on the turtle], and the triangle pointing in line with the turtle's current orientation.
repeat 18 [iso 20 60 rollright 10]
lat
Input: size
Output: none
Creates a left-facing right-angle triangle. See rat
lat 20
line
Input: length (number)
Output: none
Creates a line of the specified length in front of the calling turtle, without moving that turtle. Line does not respect penup / pendown. If length specified as a [list] eg [5], centres line on turtle.
repeat 36 [if oddp repcount [line 20] else [line 40] rt 10]
listanimations
Input: none
Output: none
Prints out a list of all models that have animations, showing each model name followed by its available animation names.
listanimations
listimages
Input: none
Output: none
Lists the calling turtle's images
listimages
listoverlays
Input: none
Output: none
Prints a list of the currently defined overlays.
listoverlays
liststickers
Input: none
Output: none
Prints the names of the currently defined stickers, one per line. See newsticker, stickers
liststickers
newoverlay
Input: name (word) | turtle (word)
Output: 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
newsticker
Input: name (word) | image (word)
Output: none
Defines a new sticker using the provided image. See placesticker
loadimage "marqueeimage "marquee.png
newsticker "marqueesticker "marqueeimage
nextframe
Input: none
Output: 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
nooverlayrender
Input: "name (word)
Output: none
Suspends rendering (updating) of the named overlay. See overlayrender, which resumes it.
nooverlayrender "overlay
norender
Input: none
Output: 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
Input: none
Output: none
Disables speckling of voxels and quads. See speckle
speckle voxel 30 forward 40
nospeckle voxel 30
notwosided
Also: ntws
Input: none
Output: 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
noupdatestamp
Input: none
Output: none
Disables automatic stamp updating. See updatestamp.
noupdatestamp
octahedron
Also: oct
Input: size (number)
Output: none
Creates a octahedron (8-sided shape) of the specified size, which is the distance to the farthest tips of the octahedron.
octahedron 5
octahedroid
Also: octo
Input: size (number) | ratio (number)
Output: 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
Input: half-width (number) | half-height (number)
Output: none
Creates a filled oval of the specified dimensions. See ellipse
oval 50 20
ovalpie
Input: degrees (number) | half-width (number) | half-height (number)
Output: none
Creates a filled oval-shaped 'pie' of the specified degrees and dimensions. See pie, oval
ovalpie 90 50 20
overlayrender
Input: name (word)
Output: none
Resumes rendering (updating) the selected overlay. See nooverlayrender, which suspends it.
overlayrender "overlay
overlays
Input: none
Output: list
Returns a list of the currently defined overlays.
show overlays
peak
Input: width | height | depth
Output: 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
pie
Input: degrees (number) | radius (number)
Output: 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
Input: none
Output: none
Drops a 'pin', for use with pinfill, pinline and pinshard
pin forward 60 pin right 120 forward 60 pin
pinfill
pinfill
Input: none
Output: none
Creates an arbitrary shape based on the previously dropped pins. Note that pinfill may not work if the lines created by the pins cross! pinfill erases the list of pins. See pin, pinline, pinshard.
repeat 5 [pin forward 40 right 72]
pinfill
pinline
Input: number (X)
Output: none
Creates a line using the last X dropped 'pins' in reverse sequential order. See pin
pinline 3
pins
Input: none
Output: list
Returns a list of the currently placed pins. See setpins, pinfill, pinspline
show pins
pinshard
Input: depth (number)
Output: none
Creates a 'shard' (an arbitrary shape of the given depth) using the list of dropped 'pins'. Note that pinshard may fail if the lines created by the pins cross! See pin, pinfill, pinspline
pinshard 5
pinspline
Input: resolution
Output: none
Creates a spline of the given resolution using the previously placed pins as base points. Replaces the existing pins with the resolved pins. Does not erase the list of pins. Can be subsequently used with pinfill (to fill the spline, if it is connected). See pin, pinfill
pinspline 5
placeoverlay
Input: name (word) | [x1% y1% x2% y2%] (list)
Output: 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]
placesticker
Input: name (word) | [x1% y1% x2% y2%] (list)
Output: 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 [25 25 75 75]
poly
Input: radius (number) OR [radius1 radius2 radius3…]| sides (number)
Output: none
Draws a convex polygon of the specified radius (either a single value or list of radii) and number of sides (must equal number of radii if radii provided in a list).
poly 10 6
poly [5 10 5 20] 4
polyellipse
Input: width (number) | height (number) | sides (number)
Output: none
Draws a convex polygon of the specified dimensions and sides.
polyellipse 20 10 10
polyoval
Input: width (number) | height (number) | sides (number)
Output: none
Creates a filled convex polygon of the specified dimensions and sides.
polyoval 10 20 5
polyspot
Also: ps
Input: radius (number) OR [radius1 radius2 radius3…] | sides (number)
Output: none
Creates a filled convex polygon of the specified radius (or radii if provided in a list) and number of sides (must equal number of radii, if list of radii provided).
polyspot 20 5
polyspot [10 5 20 30] 4
prism
Also: pri
Input: width | height | depth
Output: none
Creates a lined prism to the right, forward and under the turtle.
prism 20 10 30
pyramid
Also: py
Input: size (number) OR [width height depth] (list)
Output: none
Creates a pyramid (5-sided shape) of the specified size.
pyramid 10
pyramid [5 10 20]
pyramoid
Also: pyo
Input: size (number) | ratio (number)
Output: none
Creates a pyramoid (stretched pyramid) of the specified size and stretch ratio.
pyramoid 10 2
quad
Also: qd
Input: width | height
Output: none
Creates a 'quad', a two-dimensional filled rectangle of the specified width and height, to the front and right of the turtle, unless negative values are provided. If a list of a single item is provided for either parameter, quad will center the shape created on the appropriate turtle axis. See square
quad 20 10
quad -20 -10
ramp
Input: width (number) | height (number) | depth (number)
Output: none
Creates a filled wedge, or 'ramp' using the provided dimensions.
ramp 10 20 30
rat
Input: length
Output: none
Creates a filled isosceles right angle triangle with two sides of the same specified length.
rat 20
rect
Input: width (number) | height (number)
Output: none
Creates a pen-drawn rectangle of the specified width and height to the front and right of the current turtle, unless a parameter is supplied as a single-item list, in which case the rect is centered on the appropriate turtle axis. See quad, square
rect 10 20
rect [10] 20
resize
Input: imagename (word) | [width height] (list)
Output: none
Resizes the specified image and replaces it.
resize "image [100 50]
rhombus
Input: width (number) | height (number)
Output: none
Creates a 2D rhombus of the specified width and height.
rhombus 30 10
ring
Input: thickness (number) | inner radius (number) | segments (number)
Output: 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
Input: thickness (number) | inner radius (number) | totalsegments (number) | arcsegments (number)
Output: 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
ringoid
Input: thickness (number) | inner radius (number) | segments (number) | ratio (number)
Output: none
Creates a two-dimensional ring of the specified thickness, inner radius and segments, stretched by the provided ratio. See ring
ringoid 10 30 10 2
ringoidarc
Input: thickness (number) | inner radius (number) | totalsegments (number) | arcsegments (number) | ratio (number)
Output: none
Creates a partial ringoid of the specified number of segments. So, if the totalsegments specified were 10, an arcsegments value of 5 would create a half-ring. If the arcsegments value provided is a list of two, the segments are created from the first value in the list to the second value. See ringarc, ringoid
ringoidarc 10 30 10 5
ringoidarc 5 10 20 [3 5]
roller
Input: thickness inner-radius OR [inner-radius near inner-radius far] depth sides
Output: none
Creates a roller-shaped 3D object of the given composition. See rollerarc
roller 10 30 30 20
rollerarc
Input: thickness inner-radius OR [inner-radius near inner-radius far] depth sides-total sides-used
Output: none
Creates a portion of a roller of the given sectors-used. See roller
rollerarc 10 30 20 10 2
sample
Input: image (word) | position (list)
Output: 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
Input: image | filename
Output: none
Saves an internally stored image. Useful for saving internally created or modified images.
saveimage "myimage "imagefile
setdotsize
Input: size (number)
Output: 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
seticosphereiterations
Also: sisi
Input: number
Output: none
Sets the complexity of the icosphere, from 0 to 3
seticosphereiterations 3
setoverlayresolution
Input: name (word) | ratio (number)
Output: 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
Input: name (word) | boolean
Output: 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
Input: name (word) | frames per second (number)
Output: none
Sets the update frequency of the named overlay to the provided number of frames per second. See newoverlay
setoverlayupdate "myrtlesview 10
setpins
Input: list of positions
Output: none
Sets the list of pins to the given list of lists.
setpins [[0 0 0] [10 10 10]]
setspecklecolors
Input: list
Output: 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
Input: plotname (word)
Output: none
Selects the name of the plot to use to generate a speckle, if using the plot style with speckle.
setspeckleplot "myplot
setspecklesize
Input: turtleSteps
Output: none
Sets the pixel size used in generating speckles, in turtleSteps.
setspecklesize 1
setspecklestyle
Input: "styletype
Output: none
Selects the style to use when generating speckles. You can choose from "repeat "dither "random or "plot.
setspecklestyle "random
setspheroidaxis
Also: ssa
Input: boolean
Output: none
Sets the axis by which spheroids are stretched. 0 is equatorial while 1 is polar. See spheroidaxis
setspheroidaxis 1
showoverlay
Input: name (word)
Output: none
Shows the specified overlay. See newoverlay
showoverlay "myrtlesview
showsticker
Input: name (word)
Output: none
Shows the sticker with the provided name. See placesticker
showsticker "marqueesticker
skewfiso
Also: skf
Input: half-width (turtle-units) | height | degrees
Output: none
Creates a filled isosceles triangle "skewed" by the given number of degrees in the X axis. Negative degree values are an acceptable input. See fiso
skewfiso 50 100 45
skewiso
Also: ski
Input: width (turtle-units) | height | degrees
Output: none
Creates an isosceles triangle "skewed" by the given number of degrees in the X axis. Negative degree values are an acceptable input. See iso
skewiso 50 100 45
skewpyramid
Also: skp
Input: size (turtle-units) OR [width height depth] (list) | degrees X | degrees Z
Output: none
Creates a pyramid "skewed" by the specified number of degrees in the X and Z directions.
skewpyramid 50 45 45
skewpyramoid
Also: skpo
Input: size (turtle-units) OR [width height depth] | stretch (ratio) | degrees X | degrees Z
Output: none
Creates a pyramid "skewed" by the specified number of degrees in the X and Z directions, and stretched by the specified ratio
skewpyramoid 50 3 45 45
skewquad
Also: skq
Input: width (turtle-units) | height (turtle-units) | degrees
Output: none
Creates a quad "skewed" by the specified number of degrees, a value which can be negative. See quad
skewquad 50 50 45
skewrect
Also: skr
Input: width (turtle-units) | height | degrees
Output: none
Creates a "skewed" rectangle of the given width and height, skewed by the specified number of degrees, a value which can be negative.
skewrect 100 50 -45
skewtraperect
Also: sktr
Input: width (turtle-units) | height | ratio | degrees
Output: none
Creates a "skewed" trapezoidal rectangle of the specified width and height, whose top is affected by the provided ratio and who is skewed by the specified number of degrees, a value which can be negative. See rect
skewtraperect 100 100 0.5 45
skewtrapevoxeloid
Also: skvo
Input: width | height | depth | ratio-W | ratio-D | degrees X | degrees Z
Output: none
Creates a skewed trapezoidal voxel, the width and depth of whose "top" or side in front of the turtle is stretched or contracted by the given ratios (depth and width), and who is then skewed by the given degree values in the X and Z axis, which can be negative. See trapevoxeloid
skewtrapevoxeloid 50 50 50 0.5 2 45 45
skewtrapezoid
Also: skt
Input: width (turtle-units) | height | ratio | degrees
Output: none
Creates a skewed trapezoidal quad of the specified width and height, whose top is affected by the provided ratio and who is skewed by the specified number of degrees, a value which can be negative.
skewtrapezoid 100 100 0.5 45
skewvoxeloid
Also: skv
Input: width (turtle-units) | height | depth | degrees X | degrees Z
Output: none
Creates a "skewed" voxeloid of the specified dimensions, distorted on the X and Z axis by the specified number of degrees, which can be negative.
skewvoxeloid 100 100 100 45 45
snapshot
Input: imagename (word)
Output: none
Takes a snapshot of the screen and places it into the internal image library with the given imagename. That image can then be used with 'sample' to provide basic 2D collision detection, or used on a 'billboard'. See listimages, sample, billboard
snapshot "screenshot
speckle
Input: none
Output: 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 voxel 40
specklecolors
Input: none
Output: list
Returns the currently defined speckle colors. See speckle
show specklecolors
speckleplot
Input: none
Output: word
Returns the plot currently used by speckle in the plot style. See setspecklestyle
show speckleplot
specklesize
Input: none
Output: number
Returns the currently defined speckle size. See setspecklesize, speckle
show specklesize
specklestyle
Input: none
Output: word
Returns the current speckle style. See speckle
show specklestyle
"random
sphere
Also: sph
Input: radius (number) | stacks (number) | sectors (number)
Output: 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
Also: sphs
Input: radius (number) | stacks (number) | sectorstotal (number) | sectorsused (number)
Output: 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
Also: spd
Input: radius (number) | stacks (number) | sectors (number) | multiplier (number)
Output: none
Creates an spheroid of a specified radius, stacks and sectors, stretched using the provided multiplier.
sphereoid 20 10 10 2
spheroidaxis
Input: none
Output: boolean
Returns the current spheroid axis, the axis along which spheroids are stretched. 0 is equatorial and 1 is polar.
show spheroidaxis
spheroidslice
Also: spds
Input: radius (number) | stacks (number) | sectorstotal (number) | startsector (number) | endsector (number) | multiplier (number)
Output: 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 startsector and endsector values, and stretched using the provided multiplier. Like a squashed orange cut vertically. See cutspheroid, cutspheroidslice
spheroidslice 20 10 10 5 10 2
spline
Input: resolution | points
Output: none
Converts lines connecting the last given number of points into a spline, adding the number of resolution points given for each base point converted. Turns a series of disjointed lines into a smooth curve. spline requires that the pen have been down when drawing the lines it converts, and will not work if the pen was up.
spline 5 10
splinepos
Input: resolution | [point1 point2…]
Output: list
Returns a list of spline points calculated from the given resolution and list of base points.
show splinepos 5 [[0 0 0] [10 10 10] [20 20 20]]
spot
Also: sp
Input: radius (number) OR [radius end%] OR [radius start% end%]
Output: none
Creates a filled circle of the specified radius. When given a list, creates a partial spot clipped vertically (lengthwise along the turtle's up direction). With two values [radius end%], clips from 0% to end%. With three values [radius start% end%], clips from start% to end%. 0% is the top of the spot, 100% is the bottom.
spot 50
spot [50 50]
spot [50 25 75]
square
Also: sq
Input: size (number)
Output: none
Creates a filled square of the specified size. If the parameter is supplied as a single-item list, then the square is centered on the turtle.
square 20
square [20]
stamp
Input: modelname (word) OR [modelname scale]
Output: none
'Stamps' a copy of the specified model at the current location using the current model scale, or the model scale specified in the list form of the input.
cs pu repeat 20 [setmodelscale repcount / 10 stamp "plane fd 3 * repcount]
stickers
Input: none
Output: list
Returns the currently defined stickers. See newsticker
show stickers
tent
Input: half-width (number) | height (number) | depth (number)
Output: none
Creates an opaque (solid) prism to the left, right and front of the turtle.
tent 10 10 5
tetrahedron
Also: th
Input: size (number)
Output: none
Creates a tetrahedron (4-sided shape) of the specified size.
tetrahedron 5
tetrahedroid
Also: tho
Input: size (number) | ratio (number)
Output: 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
Also: tro
Input: thickness (number) | radius (number) | sides (number) | segments (number) | ratio (number) OR [ratio-z ratio-x]
Output: none
Creates a torusoid, an extruded three-dimensional ring, stretched by a ratio where 1 is a normal torus.
toroid 10 30 4 16 0.5
toroidslice
Also: tros
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | startsides (number) | endsides (number) | ratio
Output: none
Creates a 'slice' of a torus, based on the startsides and endsides value. Note that using a negative thickness value inverts the slice.
toroidslice 5 15 20 20 10 15 2
toroidslice -5 15 20 20 10 15 2
torusslice
Also: trs
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | startsides (number) | endsides (number)
Output: 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
Also: tr
Input: thickness (number) | radius (number) | sides (number) | segments (number)
Output: 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
traperect
Also: tre
Input: width (turtle-units) | height | ratio
Output: none
Creates a trapezoidal rectangle of the given width, height and with its far end contracted or expanded by the given ratio. See rect
traperect 50 50 2
trapevoxeloid
Also: tvo
Input: width (turtle-units) | height | depth | ratio-W | ratio-D
Output: none
Creates a trapezoidal voxel, whose far 'end' is affected by the given width and depth ratios. If any of the first three parameters is given as a list with a single item, then the shape is centered on that parameter's axis.
trapevoxeloid 50 50 50 0.5 2
trapezoid
Also: tz
Input: width (turtle-units) | height | ratio
Output: none
Creates a quad whose far 'end' is expanded or contracted based on the provided ratio. See quad, skewtrapezoid
trapezoid 100 50 5
triangle
Also: tri
Input: width (number) | height (number)
Output: none
Creates a wireframe (pen-drawn) right-angle triangle to the front and right of the turtle.
triangle 10 20
tube
Also: tb
Input: radius (number) | depth (number) | sides (number)
Output: none
Creates a hollow tube.
tube 10 20 20
tubearc
Also: tba
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number)
Output: none
Creates a tube arc.
tubearc 5 15 20 20 10
tubearcslice
Also: tbas
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides (number)
Output: none
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
Also: tbs
Input: radius (number) | depth (number) | sidestotal (number) | sidesused (number)
Output: none
Creates a 'slice' of a tube, based on the sidestotal and sidesused values.
tubeslice 20 20 10 4
tuboid
Also: tbo
Input: radius (number) | depth (number) | sides (number) | ratio (number)
Output: none
Creates a tuboid, or stretched tube.
tuboid 10 20 20 0.5
tuboidarc
Also: tboa
Input: thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)
Output: none
Creates a tube arc extruded by the provided ratio.
tuboidarc 5 15 20 20 10 2
tuboidarcslice
Also: tboas
Input: thickness (number) | radius (number) | totalsides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides | ratio (number)
Output: 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
Also: tbos
Input: radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)
Output: 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
Also: tws
Input: none
Output: 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 setfillcolor 6
quad 40 40
updatestamps
Input: none
Output: none
Causes stamps to be updated when the turtle model is updated. This is disabled by default. See noupdatestamp, updatestampp
updatestamps
voxel
Also: vx
Input: turtle-steps or [turtle-steps]
Output: none
Creates a filled cube turtle-steps wide, high and deep to the right, forward and down of the turtle, unless the parameter is provided as a list, in which case the voxel is created around the turtle. See voxeloid.
voxel 20
voxel [20]
voxeloid
Also: vxo
Input: turtle-steps-right turtle-steps-forward turtle-steps-deep
Output: none
Creates a filled cuboid to the right, forward and down of the turtle. If any parameter is provided as a list, eg [20], then center the voxel on that axis. See voxel.
voxeloid 10 20 30
voxeloid 10 [20] 30
voxeloid [10] [20] [30]
wedge
Input: turtle-steps-right turtle-steps-forward
Output: none
Creates a filled right-angle triangle turtle-steps-right from the turtle and turtle-steps-forward from the turtle in dimensions.
wedge 20 4
wiggle
Input: distance OR [orbitdegrees] OR [arcdegrees arcsize] | sine OR [sine1 sine2] | amp OR [amp1 amp2]
Output: none
Creates a 'wiggle', which can create AMAZING shapes using sine waves! Try these examples, and play with their values:
wiggle 100 10 5
wiggle [360] 18 4
beginfill wiggle [360 100] [10 5] 2 endfill
beginfill wiggle [360 50] [8 3] [2 1] endfill
icosphereiterations
Input: none
Output: number
Returns the current number of iterations used when creating icospheres.
print icosphereiterations
hinge
Input: "name [commands]
Output: none
Creates a hinge joint in a procedural model, for use inside NEWMODEL or SETMODEL blocks. Hinges allow parts of the model to be rotated independently after the model is created. The name is used to identify the hinge when using SWIVEL or SETHINGEORIENTATION. Commands inside the block create geometry that will be attached to this hinge and move with it. Hinges can be nested to create articulated hierarchies like robot arms.
newmodel "arm [
setpenstyle "tube setpw 3
setpc yellow fd 30
hinge "shoulder [
setpc orange fd 20
hinge "elbow [
setpc red fd 15
]
]
]
hinges
Input: "modelname
Output: list
Returns a list of hinge/joint names available in the specified model. Returns an empty list if the model has no hinges.
show hinges "arm
[shoulder elbow]
hingesp
Input: "modelname
Output: boolean
Returns TRUE if the specified model has hinges/joints, FALSE otherwise.
show hingesp "arm
TRUE
hingep
Input: "hingename
Output: boolean
Returns TRUE if the specified hinge exists in the current turtle's model, FALSE otherwise.
show hingep "shoulder
TRUE
listhinges
Input: none
Output: none
Prints a list of all loaded models that have hinges, along with their hinge names.
listhinges
arm: shoulder elbow
robot: head leftarm rightarm
sethingeorientation
Input: "hingename [pitch heading roll]
Output: none
Sets the orientation of the specified hinge to the given pitch, heading, and roll values in degrees. This is an absolute orientation - it sets the hinge TO these values, replacing any previous orientation. Child hinges in the hierarchy will move along with their parent.
sethingeorientation "shoulder [30 0 0]
sethingeorientation "elbow [0 45 0]
swivel
Input: "hingename heading | [heading pitch]
Output: none
Rotates the specified hinge BY the given amounts in degrees. Pass a single number to change heading only, or a list [heading pitch] to change both. This is a relative rotation - it adds to the current orientation. Useful for animations where you want to incrementally rotate a joint.
swivel "elbow 10
repeat 36 [swivel "elbow 10 wait 1]
swivel "shoulder [15 5]
hingeorientation
Input: "hingename
Output: list
Returns the current orientation of the specified hinge as a list [pitch heading roll] in degrees.
show hingeorientation "shoulder
[30 0 0]
hingeorientationorder
Input: "hingename
Output: word
Returns the current rotation order for the specified hinge. The order determines in which sequence pitch, heading, and roll rotations are applied. Default is "phr" (pitch, heading, roll).
show hingeorientationorder "shoulder
phr
sethingeorientationorder
Input: "hingename "order
Output: none
Sets the rotation order for the specified hinge. The order must be a permutation of p (pitch), h (heading), and r (roll). Valid orders are: phr, prh, hpr, hrp, rph, rhp. Different orders can produce different final orientations when multiple rotations are combined.
sethingeorientationorder "shoulder "hpr
resethinges
Input: none
Output: none
Resets all hinge orientations on the current turtle's model to [0 0 0]. Useful for returning an articulated model to its default pose.
resethinges
plotcopy
Input: "source "destination | [destination]
Output: none
Copies the content of plot "source to "destination. If the list syntax [destination] is used, only defined (non-zero) points are copied, leaving other points in the destination unchanged. If "destination is used (without brackets), the entire contents of source replaces destination completely. If destination does not exist when using "destination syntax, it will be created.
plotcopy "frame1 "frame2
plotcopy "frame1 [frame2]
setpinorigin
Input: [x y z]
Output: none
Sets the origin point used when drawing transformed pins. Drawing commands (pinline, pinfill, pinspline) will offset pins by this amount. Does not modify the original pins. Alias: spino
setpinorigin [100 50 0]
pin setpos [0 0 0] pin setpos [10 0 0] pin
pinline 2
; draws line from [100 50 0] to [110 50 0]
pinorigin
Input: none
Output: list
Returns the current pin origin offset as [x y z]. Alias: pino
setpinorigin [100 50 0]
show pinorigin
[100 50 0]
setpinscale
Input: scale
Output: none
Sets the scale factor used when drawing transformed pins. Drawing commands (pinline, pinfill, pinspline) will scale pins by this amount relative to the origin. Does not modify the original pins. Alias: spins
setpinscale 2
pin setpos [10 0 0] pin setpos [20 0 0] pin
pinline 2
; draws line scaled by 2
pinscale
Input: none
Output: number
Returns the current pin scale factor. Alias: pscl
setpinscale 2
show pinscale
2
setpintransform
Input: [a b c]
Output: none
Sets the rotation angles used when drawing transformed pins. The angles follow orientationorder (default phr = [pitch heading roll]). Drawing commands (pinline, pinfill, pinspline) will rotate pins by these angles. Does not modify the original pins. Alias: spint
setpintransform [0 90 0]
pin setpos [10 0 0] pin setpos [20 0 0] pin
pinline 2
; draws line rotated 90 degrees heading
pintransform
Input: none
Output: list
Returns the current pin transform angles as a list. Alias: pint
setpintransform [45 90 0]
show pintransform
[45 90 0]
xpins
Input: none
Output: list
Returns the pins with all transformations applied (scale, rotate, offset). Useful for inspecting the transformed pins without drawing them.
pin setpos [10 0 0] pin setpos [20 0 0] pin
setpinscale 2
setpinorigin [100 0 0]
show xpins
; shows scaled and offset pins