Skip to main content
PathData is an indexed collection of PathCommand objects. Both Path and PathData behave like arrays of commands and support iteration via ipairs.

Methods

__len

__len() -> number
PathData is an indexed collection of PathCommand objects. Both Path and PathData behave like arrays of commands and support iteration via ipairs. Each entry is a PathCommand describing one segment or action in the path. Returns the number of commands in the path.

contours

contours(self: PathData) -> ContourMeasure?
Returns a ContourMeasure for the first contour in the path. A contour is a sequence of path segments between moveTo operations. Use the ‘next’ property on the returned ContourMeasure to iterate through subsequent contours. Returns nil if the path has no contours.

measure

measure(self: PathData) -> PathMeasure
Returns a PathMeasure that measures the entire path across all contours. This provides the total length and allows operations on the path as a whole.