Path
A path represents an SVG path, which are the lines and curves on our pattern.
Signature
Path new Path()
The Path constructor takes no arguments.
Properties
A Path object comes with the following properties:
attributes
: An Attributes instance holding the path's attributeshidden
: When this istrue
the path will be hidden (excluding it from the output). See Path.hide(), Path.unhide(), and Path.setHidden() for various methods that allow setting this in a chainable way.
RELATED
See Using Attributes for information about custom Attributes that can be used with Paths.
Example
- Preview
- Code
- X-Ray
({ Point, points, Path, paths, part }) => {
paths.example = new Path()
.move(new Point(0,0))
.line(new Point(100,0))
return part
}
Methods
A Path object exposes the following methods:
- Path.addClass()
- Path.addText()
- Path.angleAt()
- Path.asPathString()
- Path.asRenderProps()
- Path.attr()
- Path.bbox()
- Path.circleSegment()
- Path.clean()
- Path.clone()
- Path.close()
- Path.combine()
- Path.curve()
- Path.curve_()
- Path.divide()
- Path.edge()
- Path.end()
- Path.hide()
- Path.insop()
- Path.intersects()
- Path.intersectsBeam()
- Path.intersectsX()
- Path.intersectsY()
- Path.join()
- Path.length()
- Path.line()
- Path.move()
- Path.noop()
- Path.offset()
- Path.reverse()
- Path.rotate()
- Path.roughLength()
- Path.setClass()
- Path.setHidden()
- Path.setText()
- Path.shiftAlong()
- Path.shiftFractionAlong()
- Path.smurve()
- Path.smurve_()
- Path.split()
- Path.start()
- Path.translate()
- Path.trim()
- Path.unhide()