begin-contour

begin-shape

bezier-vertex

curve-vertex

end-contour

end-shape

quadratic-vertex

texture

texture-mode

texture-wrapclj

vertex

begin-contour

Arguments
[]
Docstring
Use the begin-contour and end-contour function to create negative
shapes within shapes. These functions can only be within a
begin-shape/end-shape pair and they only work with the :p2d and :p3d
renderers.
Works only inside sketch functions?
Yes
Original Processing method
beginContour()

begin-shape

Arguments
[mode][]
Docstring
Enables the creation of complex forms. begin-shape begins recording
vertices for a shape and end-shape stops recording. Use the mode
keyword to specify which shape create from the provided
vertices. With no mode specified, the shape can be any irregular
polygon.

The available mode keywords are :points, :lines, :triangles,
                                :triangle-fan, :triangle-strip,
                                :quads, :quad-strip.

After calling the begin-shape function, a series of vertex commands
must follow. To stop drawing the shape, call end-shape. The vertex
function with two parameters specifies a position in 2D and the
vertex function with three parameters specifies a position in
3D. Each shape will be outlined with the current stroke color and
filled with the fill color.

Transformations such as translate, rotate, and scale do not work
within begin-shape. It is also not possible to use other shapes,
such as ellipse or rect within begin-shape.
Works only inside sketch functions?
Yes
Original Processing method
beginShape()

bezier-vertex

Arguments
[cx1 cy1 cx2 cy2 x y][cx1 cy1 cz1 cx2 cy2 cz2 x y z]
Docstring
Specifies vertex coordinates for Bezier curves. Each call to
bezier-vertex defines the position of two control points and one
anchor point of a Bezier curve, adding a new segment to a line or
shape. The first time bezier-vertex is used within a begin-shape
call, it must be prefaced with a call to vertex to set the first
anchor point. This function must be used between begin-shape and
end-shape and only when there is no parameter specified to
begin-shape.
Works only inside sketch functions?
Yes
Original Processing method
bezierVertex()

curve-vertex

Arguments
[x y][x y z]
Docstring
Specifies vertex coordinates for curves. This function may only be
used between begin-shape and end-shape and only when there is no
mode keyword specified to begin-shape. The first and last points in a
series of curve-vertex lines will be used to guide the beginning and
end of a the curve. A minimum of four points is required to draw a
tiny curve between the second and third points. Adding a fifth point
with curve-vertex will draw the curve between the second, third, and
fourth points. The curve-vertex function is an implementation of
Catmull-Rom splines.
Works only inside sketch functions?
Yes
Original Processing method
curveVertex()

end-contour

Arguments
[]
Docstring
Use the begin-contour and end-contour function to create negative
shapes within shapes. These functions can only be within a
begin-shape/end-shape pair and they only work with the :p2d and :p3d
renderers.
Works only inside sketch functions?
Yes
Original Processing method
endContour()

end-shape

Arguments
[mode][]
Docstring
May only be called after begin-shape. When end-shape is called,
all of image data defined since the previous call to begin-shape is
written into the image buffer. The keyword :close may be passed to
close the shape (to connect the beginning and the end).
Works only inside sketch functions?
Yes
Original Processing method
endShape()

quadratic-vertex

Arguments
[cx cy cz x3 y3 z3][cx cy x3 y3]
Docstring
Specifies vertex coordinates for quadratic Bezier curves. Each call to
quadratic-vertex defines the position of one control points and one
anchor point of a Bezier curve, adding a new segment to a line or shape.
The first time quadratic-vertex is used within a begin-shape call, it
must be prefaced with a call to vertex to set the first anchor point.
This function must be used between begin-shape and end-shape and only
when there is no MODE parameter specified to begin-shape. Using the 3D
version requires rendering with :p3d.
Works only inside sketch functions?
Yes
Original Processing method
quadraticVertex()

texture

Arguments
[img]
Docstring
Sets a texture to be applied to vertex points. The texture fn must
be called between begin-shape and end-shape and before any calls to
vertex.

When textures are in use, the fill color is ignored. Instead, use
tint to specify the color of the texture as it is applied to the
shape.
Works only inside sketch functions?
Yes
Original Processing method
texture()

texture-mode

Arguments
[mode]
Docstring
Sets the coordinate space for texture mapping. There are two
options, :image and :normal.

:image refers to the actual coordinates of the image and :normal
refers to a normalized space of values ranging from 0 to 1. The
default mode is :image. In :image, if an image is 100 x 200 pixels,
mapping the image onto the entire size of a quad would require the
points (0,0) (0,100) (100,200) (0,200). The same mapping in
NORMAL_SPACE is (0,0) (0,1) (1,1) (0,1).
Works only inside sketch functions?
Yes
Original Processing method
textureMode()

texture-wrapclj

Arguments
[mode]
Docstring
Defines if textures repeat or draw once within a texture map. The two
parameters are :clamp (the default behavior) and :repeat. This function
only works with the :p2d and :p3d renderers.
Works only inside sketch functions?
Yes
Original Processing method
textureWrap()

vertex

Arguments
[x y z u v][x y u v][x y][x y z]
Docstring
All shapes are constructed by connecting a series of
vertices. vertex is used to specify the vertex coordinates for
points, lines, triangles, quads, and polygons and is used
exclusively within the begin-shape and end-shape fns.

Drawing a vertex in 3D using the z parameter requires the :p3d or
:opengl renderers to be used.

This function is also used to map a texture onto the geometry. The
texture fn declares the texture to apply to the geometry and the u
and v coordinates set define the mapping of this texture to the
form. By default, the coordinates used for u and v are specified in
relation to the image's size in pixels, but this relation can be
changed with texture-mode.
Works only inside sketch functions?
Yes
Original Processing method
vertex()