pix 0.7: Reference Manual

::pix::pathTop, Main, Index

Enum Winding rules:Top, Main, Index

WindingRuleenum
NonZero 
EvenOdd 

Enum Line cap type for strokes:Top, Main, Index

LineCapenum
ButtCap 
RoundCap 
SquareCap 

Enum Line join type for strokes:Top, Main, Index

LineJoinenum
MiterJoin 
RoundJoin 
BevelJoin 

CommandsTop, Main, Index

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

Adds a path to the current path.

addPath path1 path2
Parameters
path1path
path2path
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::new
coordinateslist 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. Commonly used for making rounded corners.

arcTo path coordinates1 coordinates2 radius
Parameters
pathpath::new
coordinates1list x1,y1
coordinates2list 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::new
coordinates1list x1,y1
coordinates2list x2,y2
coordinates3list 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
coordinateslist 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. If the shape has already been closed or has only one point, this function does nothing.

closePath path
Parameters
pathpath
Return value

Nothing.

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

Compute the bounds of the path.

computeBounds path matrix
Parameters
pathpath
matrixlist
Return value

A Tcl dictionary with keys (x, y, w, h).

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

Copy path.

copy path
Parameters
pathpath
Return value

A new path object.

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

Destroy current 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
coordinateslist 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_radius xAxisRotation largeArcFlag sweepFlag coordinates
Parameters
pathpath
coordinates_radiuslist rx,ry
xAxisRotationdouble value
largeArcFlagboolean value
sweepFlagboolean value
coordinateslist x,y
Return value

Nothing.

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

Returns whether or not the specified point is contained in the current path.

fillOverlaps path coordinates ?matrix? ?windingRule?
Parameters
pathpath
coordinateslist x,y
matrixlist Optional, default mat3.
windingRuleEnum value Optional, default NonZero.
Description

The point is transformed into the path's coordinate system before the overlap check is done. The transformation matrix is given in the 'matrix' argument, which is a list of 9 double values. If the 'matrix' argument is not given, the identity matrix is used. The overlap check is done with the given 'windingRule' argument, which is a enum value. If the 'windingRule' argument is not given, the default value 'NonZero' is used.

Return value

Returns whether or not the specified point is contained in the current path.

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
coordinateslist 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
coordinateslist x,y
Return value

Nothing.

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

Sets a new path.

new
Return value

A new path object.

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

Adds an n-sided regular polygon at (x, y) with the parameter size. Polygons "face" north.

polygon path coordinates size sides
Parameters
pathpath
coordinateslist x,y
sizedouble value
sidesinteger value
Return value

Nothing.

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

Adds a quadratic Bézier curve to the current sub-path. 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 moveTo() before creating the quadratic Bézier curve.

quadraticCurveTo path coordinates1 coordinates2
Parameters
pathpath
coordinates1list x1,y1
coordinates2list x2,y2
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
coordinateslist x,y
sizelist 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
coordinateslist x,y
sizelist width,height
radiuslist {nw ne se sw}
ccwboolean value Optional, default true.
Return value

Nothing.

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

Checks if a point is inside the stroking of a path.

strokeOverlaps path coordinates ?options?
Parameters
pathThe path object to check.
coordinatesThe coordinates x,y to check against the path.
optionsTcl dictionary 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

Returns whether or not the specified point is inside the area contained by the stroking of a path. The point is considered inside if it is contained in the stroked path and not in any holes.

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

Apply a matrix transform to a path.

transform path matrix
Parameters
pathpath
matrixlist
Return value

Nothing.