ofPathfile
ofPath::Commandstruct
ofPathclass
ofPath is a way to create a path or multiple paths consisting of points. It allows you to combine multiple paths consisting of points into a single vector data object that can be drawn to the screen, manipulated point by point, or manipulated with it's child subpaths. It is better at representing and manipulating complex shapes than the ofPolyline and more easily represents multiple child lines or shapes as either ofSubPath or ofPolyline instances. By default ofPath uses ofSubPath instances. Closing the path automatically creates a new path:
for( int i = 0; i < 5; i++) {
// create a new ofSubPath
path.arc( i * 50 + 20, i * 50 + 20, i * 40 + 10, i * 40 + 10, 0, 360);
path.close();
}
To use ofPolyline instances, simply set the mode to POLYLINES
path.setMode(POLYLINES);
Create and remove paths and sub paths
Sub paths
lineTo
()
moveTo
()
curveTo
()
bezierTo
()
quadBezierTo
()
arc
()
arcNegative
()
triangle
()
circle
()
ellipse
()
rectangle
()
rectRounded
()
Winding Mode
Drawing Mode
Drawing
draw
()
Functions
Path Commands
getCommands
()