pix 0.9: Reference Manual

::pix::pathTop, Main, Index

Enum WindingRule:Top, Main, Index

Enum LineCap:Top, Main, Index

Enum LineJoin:Top, Main, Index

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}).

addCopies path1 path2 coordinates
Parameters
path1destination path object handle
path2source path object handle
coordinatesA 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.

addPath path1 path2
Parameters
path1destination path object handle
path2source path object handle
Return value

Nothing.

angleToMiterLimit [::pix::path]Top, Main, Index

Converts miter-limit-angle to miter-limit-ratio.

angleToMiterLimit angle
Parameters
angleDouble value (radian)
Return value

A Tcl double value.

arc [::pix::path]Top, Main, Index

Adds a circular arc to the current sub-path.

arc path coordinates radius angle0 angle1 ?ccw?
Parameters
pathpath
coordinatesA list {x y}
radiusDouble value
angle0Double value (radian)
angle1Double value (radian)
ccwBoolean value Optional, default false.
Return value

Nothing.

arcTo [::pix::path]Top, Main, Index

Adds a circular arc using the given control points and radius.

arcTo path coordinates1 coordinates2 radius
Parameters
pathpath
coordinates1A list {x1 y1}
coordinates2A list {x2 y2}
radiusDouble value
Return value

Nothing.

bezierCurveTo [::pix::path]Top, Main, Index

Adds a cubic Bézier curve to the current sub-path.

bezierCurveTo path coordinates1 coordinates2 coordinates3
Parameters
pathpath
coordinates1A list {x1 y1}
coordinates2A list {x2 y2}
coordinates3A 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.

circle path coordinates radius
Parameters
pathpath
coordinatesA list {cx cy}
radiusDouble 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.

closePath path
Parameters
pathpath
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.

computeBounds path ?transform?
Parameters
pathpath object handle
transformAn 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.

copy path
Parameters
pathpath
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.

destroy value
Parameters
valuepath object or string.
Return value

Nothing.

ellipse [::pix::path]Top, Main, Index

Adds a ellipse.

ellipse path coordinates rx ry
Parameters
pathpath
coordinatesA list {x y}
rxDouble value
ryDouble 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.

ellipticalArcTo path coordinates xAxisRotation largeArcFlag sweepFlag coordinates
Parameters
pathpath
coordinatesA list {x y}
xAxisRotationDouble value
largeArcFlagBoolean value
sweepFlagBoolean value
coordinatesNot documented.
Return value

Nothing.

fillOverlaps [::pix::path]Top, Main, Index

Checks whether a given point is inside the filled region of the path.

fillOverlaps path coordinates windingRule ?transform?
Parameters
pathpath object handle
coordinatesA Tcl list {x y} (the point to test)
windingRuleOptional enum value (WindingRule, defaults to NonZero)
transformAn 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.

lineTo path coordinates
Parameters
pathpath
coordinatesA list {x y}
Return value

Nothing.

miterLimitToAngle [::pix::path]Top, Main, Index

Converts miter-limit-ratio to miter-limit-angle.

miterLimitToAngle angle
Parameters
angleDouble value (radian)
Return value

A Tcl double value.

moveTo [::pix::path]Top, Main, Index

Begins a new sub-path at the point {x y}.

moveTo path coordinates
Parameters
pathpath
coordinatesA list {x y}
Return value

Nothing.

new [::pix::path]Top, Main, Index

Creates and returns a new path object.

new
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.

polygon path coordinates size sides
Parameters
pathpath
coordinatesA list {x y}
sizeDouble value
sidesInteger 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.

polyLine path coordinates
Parameters
pathpath
coordinatesA 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.

polyPath path coordinates
Parameters
pathpath
coordinatesA 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.

quadraticCurveTo path coordinates1 coordinates2
Parameters
pathpath
coordinates1A list {x1 y1}
coordinates2A 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.

rect path coordinates size ?ccw?
Parameters
pathpath
coordinatesA list {x y}
sizeA list {width height}
ccwBoolean 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.

roundedRect path coordinates size radius ?ccw?
Parameters
pathpath
coordinatesA list {x y}
sizeA list {width height}
radiusDouble value or list radius {nw ne se sw}
ccwBoolean 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.

strokeOverlaps path coordinates ?options?
Parameters
pathpath object handle
coordinatesA Tcl list {x y} (the point to test)
optionsAn 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.

transform path matrix3x3
Parameters
pathpath object handle
matrix3x3A 3x3 transformation matrix (list of 9 numbers)
Return value

Nothing.