Module P5.Shape

Two Dimensional Primitives

val rect : ?⁠sketch: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:Sketch.t -> x1:float -> y1:float -> x2:float -> y2:float -> unit -> unit

Create a line from x1, y1 to x2, y2 (optionally pass z values for three-dimensional lines)

val line_3d : ?⁠sketch:Sketch.t -> x1:float -> y1:float -> z1:float -> x2:float -> y2:float -> z2:float -> unit -> unit

Create a line from x1, y1 to x2, y2 (optionally pass z values for three-dimensional lines)

val ellipse : ?⁠sketch:Sketch.t -> ?⁠detail:int -> float -> float -> float -> float -> unit

ellipse x y w h creates an ellipse, the detail option is for WebGL mode only