On this page:
Path
Path.close
Path.is_  open
Path.reset
Path.move_  to
Path.line_  to
Path.curve_  to
Path.polygon
Path.rectangle
Path.rounded_  rectangle
Path.ellipse
Path.arc
Path.scale
Path.rotate
Path.translate
Path.append
Path.bounding_  box
8.12

7 Path🔗ℹ

class

class Path()

Creates a drawing path.

method

method (path :: Path).close() :: Void

 

method

method (path :: Path).is_open() :: Boolean

 

method

method (path :: Path).reset() :: Void

Closes an open path, if any, check whether the path is currently open, or discards all points to reset the path.

method

method (path :: Path).move_to(pt :: PointLike)

  :: Void

 

method

method (path :: Path).line_to(pt :: PointLike)

  :: Void

 

method

method (path :: Path).curve_to(pt1 :: PointLike,

                               pt2 :: PointLike,

                               pt3 :: PointLike)

  :: Void

Sets a starting poin for an open path, or extends an open path with a stright line or Bezier curve.

method

method (path :: Path).polygon([pt :: PointLike, ...],

                              ~dpt: dpt :: PointLike = Point.zero,

                              ~dx: dx :: Real = 0,

                              ~dy: dy :: Real = 0)

  :: Void

 

method

method (path :: Path).rectangle(r :: RectLike)

  :: Void

 

method

method (path :: Path).rounded_rectangle(r :: RectLike,

                                        radius :: Real = -0.25)

  :: Void

 

method

method (path :: Path).ellipse(r :: RectLike)

  :: Void

 

method

method (path :: Path).arc(r :: RectLike,

                          start :: Real, end :: Real,

                          ~clockwise: clockwise :: Any = #false)

  :: Void

Adds to the path. If the path is currently open, it is first closed, except in the case of Path.arc.

method

method (path :: Path).scale(s :: Real) :: Void

 

method

method (path :: Path).scale(sx :: Real, sy :: Real) :: Void

 

method

method (path :: Path).rotate(radians :: Real) :: Void

 

method

method (path :: Path).translate(dx :: Real, dy :: Real) :: Void

Adjusts a path to scale, rotate, or translate every point defining the path.

method

method (path :: Path).append(other_path :: Path) :: Void

Adds other_path to the end of path.

method

method (path :: Path).bounding_box() :: Rect

Returns a rectangle that bounds all of the points describing path.