Module P5__.Shape
Two Dimensional Primitives
val rect : ?sketch:P5.Sketch.t -> ?tl:float -> ?tr:float -> ?br:float -> ?bl:float -> float -> float -> float -> float -> unit
rect x y w h
draws a rectangle on the canvas.h
is used for the height of the rectangle.tl, tr, br, bl
specifies the radius of the top-left, top-right, bottom-right and bottom-left corners respectively.
val line_2d : ?sketch:P5.Sketch.t -> x1:float -> y1:float -> x2:float -> y2:float -> unit -> unit
Create a line from
x1, y1
tox2, y2
(optionally pass z values for three-dimensional lines)
val line_3d : ?sketch:P5.Sketch.t -> x1:float -> y1:float -> z1:float -> x2:float -> y2:float -> z2:float -> unit -> unit
Create a line from
x1, y1
tox2, y2
(optionally pass z values for three-dimensional lines)
val ellipse : ?sketch:P5.Sketch.t -> ?detail:int -> float -> float -> float -> float -> unit
ellipse x y w h
creates an ellipse, thedetail
option is for WebGL mode only