::pix::pathTop, Main, Index
Enum WindingRule:Top, Main, Index
- NonZero
- EvenOdd
Enum LineCap:Top, Main, Index
- ButtCap
- RoundCap
- SquareCap
Enum LineJoin:Top, Main, Index
- MiterJoin
- RoundJoin
- BevelJoin
CommandsTop, Main, Index
addCopies [::pix::path]Top, Main, Index
Appends one copy of another path per position to the current path. Each copy of path2 is translated by its {x y} (e.g. a marker drawn around {0 0}).
Parameters
path1 | destination path object handle |
path2 | source path object handle |
coordinates | A flat list {x1 y1 x2 y2 ...} |
Return value
Nothing.
addPath [::pix::path]Top, Main, Index
Appends the geometry of another path to the current path.
Parameters
path1 | destination path object handle |
path2 | source path object handle |
Return value
Nothing.
angleToMiterLimit [::pix::path]Top, Main, Index
Converts miter-limit-angle to miter-limit-ratio.
Parameters
angle | Double value (radian) |
Return value
A Tcl double value.
arc [::pix::path]Top, Main, Index
Adds a circular arc to the current sub-path.
Parameters
path | path |
coordinates | A list {x y} |
radius | Double value |
angle0 | Double value (radian) |
angle1 | Double value (radian) |
ccw | Boolean value Optional, default false. |
Return value
Nothing.
arcTo [::pix::path]Top, Main, Index
Adds a circular arc using the given control points and radius.
Parameters
path | path |
coordinates1 | A list {x1 y1} |
coordinates2 | A list {x2 y2} |
radius | Double value |
Return value
Nothing.
bezierCurveTo [::pix::path]Top, Main, Index
Adds a cubic Bézier curve to the current sub-path.
Parameters
path | path |
coordinates1 | A list {x1 y1} |
coordinates2 | A list {x2 y2} |
coordinates3 | A list {x3 y3} |
Description
It requires three points:
the first two are control points and the third one is the end point. The starting point is the latest point in the current path, which can be changed using pix::path::moveTo before creating the Bézier curve.
Return value
Nothing.
circle [::pix::path]Top, Main, Index
Adds a circle.
Parameters
path | path |
coordinates | A list {cx cy} |
radius | Double value |
Return value
Nothing.
closePath [::pix::path]Top, Main, Index
Attempts to add a straight line from the current point to the start of the current sub-path.
Parameters
path | path |
Description
If the shape has already been closed or has only one point, this function does nothing.
Return value
Nothing.
computeBounds [::pix::path]Top, Main, Index
Computes the bounding box enclosing the path.
Parameters
path | path object handle |
transform | An optional 3x3 transformation matrix Optional, default identityMatrix. |
Return value
A Tcl dictionary with keys {x y w h} representing the bounding box.
copy [::pix::path]Top, Main, Index
Copy path.
Parameters
path | path |
Return value
A new handle path object.
destroy [::pix::path]Top, Main, Index
Destroy the path or all paths if special word all is specified.
Parameters
value | path object or string. |
Return value
Nothing.
ellipse [::pix::path]Top, Main, Index
Adds a ellipse.
Parameters
path | path |
coordinates | A list {x y} |
rx | Double value |
ry | Double value |
Return value
Nothing.
ellipticalArcTo [::pix::path]Top, Main, Index
Adds an elliptical arc to the current sub-path, using the given radius ratios, sweep flags, and end position.
Parameters
path | path |
coordinates | A list {x y} |
xAxisRotation | Double value |
largeArcFlag | Boolean value |
sweepFlag | Boolean value |
coordinates | Not documented. |
Return value
Nothing.
fillOverlaps [::pix::path]Top, Main, Index
Checks whether a given point is inside the filled region of the path.
Parameters
path | path object handle |
coordinates | A Tcl list {x y} (the point to test) |
windingRule | Optional enum value (WindingRule, defaults to NonZero) |
transform | An optional 3x3 transformation matrix Optional, default identityMatrix. |
Return value
True if the point overlaps the filled area, false otherwise.
lineTo [::pix::path]Top, Main, Index
Adds a straight line to the current sub-path by connecting the sub-path's last point to the specified {x y} coordinates.
Parameters
path | path |
coordinates | A list {x y} |
Return value
Nothing.
miterLimitToAngle [::pix::path]Top, Main, Index
Converts miter-limit-ratio to miter-limit-angle.
Parameters
angle | Double value (radian) |
Return value
A Tcl double value.
moveTo [::pix::path]Top, Main, Index
Begins a new sub-path at the point {x y}.
Parameters
path | path |
coordinates | A list {x y} |
Return value
Nothing.
new [::pix::path]Top, Main, Index
Creates and returns a new path object.
Return value
A new handle path object.
polygon [::pix::path]Top, Main, Index
Adds an n-sided regular polygon at {x y} with the parameter size.
Parameters
path | path |
coordinates | A list {x y} |
size | Double value |
sides | Integer value |
Return value
Nothing.
polyLine [::pix::path]Top, Main, Index
Adds an open polyline sub-path from a list of {x y} points. The first point opens a new sub-path (moveTo), each following point is connected with a straight line (lineTo). The sub-path is NOT closed.
Parameters
path | path |
coordinates | A list of points, each a list {x y} |
Return value
Nothing.
polyPath [::pix::path]Top, Main, Index
Adds a closed polygon sub-path from a list of {x y} points. The first point opens a new sub-path (moveTo), each following point is connected with a straight line (lineTo), then the sub-path is closed.
Parameters
path | path |
coordinates | A list of points, each a list {x y} |
Return value
Nothing.
quadraticCurveTo [::pix::path]Top, Main, Index
Adds a quadratic Bézier curve to the current sub-path.
Parameters
path | path |
coordinates1 | A list {x1 y1} |
coordinates2 | A list {x2 y2} |
Description
It requires two points:
The first one is a control point and the second one is the end point. The starting point is the latest point in the current path, which can be changed using pix::path::moveTo before creating the quadratic Bézier curve.
Return value
Nothing.
rect [::pix::path]Top, Main, Index
Adds a rectangle. Clockwise parameter can be used to subtract a rect from a path when using even-odd winding rule.
Parameters
path | path |
coordinates | A list {x y} |
size | A list {width height} |
ccw | Boolean value Optional, default true. |
Return value
Nothing.
roundedRect [::pix::path]Top, Main, Index
Adds a rectangle. Clockwise parameter can be used to subtract a rect from a path when using even-odd winding rule.
Parameters
path | path |
coordinates | A list {x y} |
size | A list {width height} |
radius | Double value or list radius {nw ne se sw} |
ccw | Boolean value Optional, default true. |
Return value
Nothing.
strokeOverlaps [::pix::path]Top, Main, Index
Checks whether a given point intersects the stroked outline of the path.
Parameters
path | path object handle |
coordinates | A Tcl list {x y} (the point to test) |
options | An optional dictionary of stroke rendering settings . Optional, default "". |
Description
If the dictionary is present it should contain the following keys:
| transform | The transformation matrix to apply before stroking the path. |
| strokeWidth | The width of the stroke. |
| lineCap | The line cap style (Enum). |
| lineJoin | The line join style (Enum). |
| miterLimit | The miter limit for the line join. |
| dashes | The dashes to apply to the stroke. |
Return value
True if the point overlaps the stroke outline, false otherwise.
transform [::pix::path]Top, Main, Index
Applies an affine transformation matrix to the path.
Parameters
path | path object handle |
matrix3x3 | A 3x3 transformation matrix (list of 9 numbers) |
Return value
Nothing.