Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Config
    • Core
    • Display
    • Document
    • Font
    • HTTP
    • Network
    • Regex
    • SVG
    • Tiri
    • Vector
    • XML
    • XQuery
    • XRandR
      • Audio
      • MP3
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • CompressedStream
      • Config
      • LZMAStream
      • Script
      • Tiri
      • XML
      • XQuery
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Image
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetClient
      • NetLookup
      • NetServer
      • NetSocket
      • Proxy
      • Gradient
      • GradientConic
      • GradientContour
      • GradientDiamond
      • GradientDiffusion
      • GradientDistal
      • GradientGouraud
      • GradientLinear
      • GradientMesh
      • GradientRadial
      • GradientVoronoi
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Kōtuku Objects
      • Kōtuku In Depth
      • Kōtuku Design Patterns
      • Coding With AI
      • Regex Manual
      • XML Comparisons
      • Tiri Reference Manual
      • Config API
      • Defer Syntax
      • GUI API
      • HTTP Server API
      • I/O API
      • JSON API
      • OAuth API
      • Options API
      • Proxy Server API
      • Tempus API
      • URL API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Origo
      • Flute / Unit Testing
      • Tuku
      • Embedded Document Format
      • TDL Reference Manual
      • TDL Tools
      • Action Reference Manual
      • System Error Codes

VectorPath Class

Extends the Vector class with support for generating custom paths.

VectorPath provides support for parsing SVG styled path strings.

Structure

The VectorPath class consists of the following fields:

Access
NameTypeComment
 CommandsPathCommand[]Direct pointer to the PathCommand array.

Read the Commands field to obtain a direct pointer to the PathCommand array. This will allow the control points of the path to be modified directly, but it is not possible to resize the path. After making changes to the path, call Flush() to register the changes for the next redraw.

This field can also be written at any time with a new array of PathCommand structures. Doing so will clear the existing path, if any.

 PathLengthINTCalibrates the user agent's distance-along-a-path calculations with that of the author.

The author's computation of the total length of the path, in user units. This value is used to calibrate the user agent's own distance-along-a-path calculations with that of the author. The user agent will scale all distance-along-a-path computations by the ratio of PathLength to the user agent's own computed value for total path length. This feature potentially affects calculations for text on a path, motion animation and various stroke operations.

 SequenceSTRINGA sequence of points and instructions that will define the path.

The Sequence is a string of points and instructions that define the path. It is based on the SVG standard for the path element d attribute, but also provides some additional features that are present in the vector engine. Commands are case insensitive.

The following commands are supported:

M: Move To
L: Line To
V: Vertical Line To
H: Horizontal Line To
Q: Quadratic Curve To
T: Quadratic Smooth Curve To
C: Curve To
S: Smooth Curve To
A: Arc
Z: Close Path

The use of lower case characters will indicate that the provided coordinates are relative (based on the coordinate of the previous command).

To terminate a path without joining it to the first coordinate, omit the Z from the end of the sequence.

 TotalCommandsINTThe total number of points defined in the path sequence.

The total number of points defined in the path Sequence is reflected in this field. Modifying the total directly is permitted, although this should be used for shrinking the list because expansion will create uninitialised command entries.

 XUNITThe left-side of the path. Can be expressed as a fixed or scaled coordinate.

Setting X moves the computed path so that its left-most boundary aligns with the supplied coordinate. The path commands remain unchanged.

 YUNITThe top of the path. Can be expressed as a fixed or scaled coordinate.

Setting Y moves the computed path so that its top-most boundary aligns with the supplied coordinate. The path commands remain unchanged.

Actions

The following actions are currently supported:

ClearClears an object's data.
FlushFlush buffered data from an object.
MoveMoves the path to a new position.
ERR acMove(*Object, DOUBLE DeltaX, DOUBLE DeltaY, DOUBLE DeltaZ)
ParameterDescription
DeltaXThe number of units to move along the X axis.
DeltaYThe number of units to move along the Y axis.
DeltaZThe number of units to move along the Z axis.
MoveToPointMoves the path to a new fixed position.
ERR acMoveToPoint(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, MTF Flags)
ParameterDescription
XThe new X position to move the object to.
YThe new Y position to move the object to.
ZThe new Z position to move the object to.
FlagsSet the relevant MTF flag for each provided parameter.

This action updates the X and Y placement fields. The path commands remain unchanged.

Methods

The following methods are currently supported:

AddCommandAdd one or more commands to the end of the path sequence.
ERR vp::AddCommand(OBJECTPTR Object, std::span<const struct PathCommand> Commands)
ParameterDescription
CommandsArray of commands to add to the path.

This method will add a series of commands to the end of a Vector's existing path sequence. The commands must be provided as a sequential array. No checks will be performed to confirm the validity of the sequence.

Calling this method will also result in the path being recomputed for the next redraw.

GetCommandRetrieve a specific command from the path sequence.
ERR vp::GetCommand(OBJECTPTR Object, INT Index, struct PathCommand ** Command)
ParameterDescription
IndexThe index of the command to retrieve.
CommandThe requested command will be returned in this parameter.

Calling GetCommand() will return a direct pointer to the command identified at Index. The pointer will remain valid for as long as the VectorPath is not modified.

RemoveCommandRemove at least one command from the path sequence.
ERR vp::RemoveCommand(OBJECTPTR Object, INT Index, INT Total)
ParameterDescription
IndexThe index of the command to remove.
TotalThe total number of commands to remove, starting from the given Index.

This method will remove a series of commands from the current path, starting at the given Index. The total number of commands to remove is indicated by the Total parameter.

SetCommandCopies one or more commands into an existing path.
ERR vp::SetCommand(OBJECTPTR Object, INT Index, std::span<const struct PathCommand> Command)
ParameterDescription
IndexThe index of the command that is to be set.
CommandAn array of commands to set in the path.

Use SetCommand() to copy one or more commands into an existing path.

SetCommandListThe fastest available mechanism for setting a series of path instructions.
ERR vp::SetCommandList(OBJECTPTR Object, std::span<const struct PathCommand> Commands)
ParameterDescription
CommandsAn array of PathCommand structures.

Use SetCommandList() to copy a series of path commands to a VectorPath object. All existing commands will be cleared as a result of this process.

VectorPath class documentation © Paul Manias © 2010-2026

PE Type

NameDescription
PE::Arc
PE::ArcRel
PE::ClosePath
PE::Curve
PE::CurveRel
PE::HLine
PE::HLineRel
PE::Line
PE::LineRel
PE::Move
PE::MoveRel
PE::QuadCurve
PE::QuadCurveRel
PE::QuadSmooth
PE::QuadSmoothRel
PE::Smooth
PE::SmoothRel
PE::VLine
PE::VLineRel
VectorPath module documentation © Paul Manias © 2010-2026

PathCommand Structure

Base structure for path commands.

FieldTypeDescription
TypePEThe command type
LargeArcUINT8Equivalent to the large-arc-flag in SVG, it ensures that the arc follows the longest drawing path when TRUE.
SweepUINT8Equivalent to the sweep-flag in SVG, it inverts the default behaviour in generating arc paths.
Pad1UINT8Private
XDOUBLEThe targeted X coordinate (absolute or scaled) for the command
YDOUBLEThe targeted Y coordinate (absolute or scaled) for the command
AbsXDOUBLEPrivate
AbsYDOUBLEPrivate
X2DOUBLEThe X2 coordinate for curve commands, or RX for arcs
Y2DOUBLEThe Y2 coordinate for curve commands, or RY for arcs
X3DOUBLEThe X3 coordinate for curve-to or smooth-curve-to
Y3DOUBLEThe Y3 coordinate for curve-to or smooth-curve-to
AngleDOUBLEArc angle
VectorPath class documentation © Paul Manias © 2010-2026