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

VectorWave Class

Extends the Vector class with support for sine wave based paths.

The VectorWave class provides functionality for generating paths based on sine waves. This feature is not part of the SVG standard and therefore should not be used in cases where SVG compliance is a strict requirement.

The sine wave will be generated from (X,Y) across Length. The parent view height provides the vertical region for centring and path closure, while Amplitude defines the wave height. The path vertices are generated on a left-to-right basis.

Waves can be used in Kotuku's SVG implementation by using the <kotuku:wave/> element.

Structure

The VectorWave class consists of the following fields:

Access
NameTypeComment
 AmplitudeUNITDefines the generated wave height.

The Amplitude is expressed as a fixed or scaled value. Fixed values are used directly, while scaled values are resolved against the parent view height.

 CloseWVCCloses the generated wave path at either the top or bottom.

Setting the Close field to TOP or BOTTOM will close the generated wave's path so that it is suitable for being filled. This setting is not compatible with the Thickness option.

NameDescription
WVC::BOTTOMClose the path across the bottom of its area.
WVC::TOPClose the path across the top of its area.
 DecayDOUBLEDeclares a rate of decay to apply to the wave amplitude.

The amplitude of a wave can be decayed between its start and end points by setting the Decay field. A value of 1.0 is the default and applies no decay. Values between 0.0 and 1.0 set the amplitude multiplier at the end of the wave, so 0.5 tapers the wave to half amplitude and 0.999 remains visually close to no decay. If the value is negative, the start and end points for the decay will be reversed.

 EnvelopeWVESelects the interpolation envelope applied to the wave.

The Envelope field controls how the Decay value, and any FrequencyEnd sweep, is interpolated across the wave. The default LINEAR envelope uses an even taper, while QUADRATIC, SMOOTHSTEP and EXPONENTIAL apply progressively stronger curves.

NameDescription
WVE::EXPONENTIALExponential decay, weighted strongly towards the start of the wave.
WVE::LINEARLinear decay from start to end, this is the default.
WVE::QUADRATICQuadratic decay, weighted towards the end of the wave.
WVE::SMOOTHSTEPSmoothstep decay with ease-in and ease-out.
 FrequencyDOUBLEDefines the wave frequency at the start of the wave.

The frequency determines the distance between each individual wave that is generated. The default value for the frequency is 1.0. Shortening the frequency to a value closer to 0 will bring the waves closer together. If FrequencyEnd is set to a different value, Frequency is used as the start frequency for the sweep.

 FrequencyEndDOUBLEDefines the wave frequency at the end of the wave.

When FrequencyEnd differs from Frequency, the wave performs a frequency sweep between the start and end points. The frequency is interpolated across the wave using the selected Envelope, and the phase is integrated from that interpolated frequency so the result behaves as a chirp. If FrequencyEnd is not assigned, it follows Frequency and the wave uses a constant frequency.

 LengthUNITThe horizontal length of the generated wave.

The length of the generated wave is defined here as a fixed or scaled value.

 NoiseDOUBLEPerturbs the generated wave path with deterministic noise.

The Noise value ranges from 0.0 to 1.0. A value of 0.0 applies no noise and preserves the unperturbed wave, while 1.0 applies the strongest perturbation.

 PhaseDOUBLEDeclares the initial phase, in degrees, to use when generating the wave.

The phase value defines the initial position that is used when computing the wave. The default is zero.

Visually, changing the phase will affect the 'offset' of the generated wave. Gradually incrementing the value will give the wave an appearance of moving from right to left.

 ThicknessUNITExpands the diameter of the wave to the specified value to produce a closed path.

Specifying a thickness value will create a wave that forms a filled shape, rather than the default of a stroked path. The thickness (diameter) of the wave is determined by the provided value. If defined as a percentage, the value is resolved against the normalised diagonal of the parent viewport, matching the scaling rule used for Vector⇒StrokeWidth. Thickness is not compatible with the Close option, and takes precedence over it.

 TypeWVTSelects an alternative wave style.

By default, waves are generated in the style of a sine wave. Alternative styles can be selected by setting this field. The SINE style generates a sine wave, TRIANGLE generates a triangular wave, SAWTOOTH generates a ramp with a sharp return edge and SQUARE generates a stepped wave with vertical transitions.

NameDescription
WVT::SAWTOOTHSawtooth patterns rise at 45 degrees to the peak, then direct 90 degrees to the bottom.
WVT::SINEStandard sine-wave curvature, this is the default.
WVT::SQUAREStepped pattern that alternates between the peak and bottom edge with vertical transitions.
WVT::TRIANGLEChevron style angles at 45 degrees either side of the peak and bottom edge.
 XUNITThe x coordinate of the wave. Can be expressed as a fixed or scaled coordinate.

The x coordinate of the wave is defined here as either a fixed or scaled value.

 YUNITThe y coordinate of the wave. Can be expressed as a fixed or scaled coordinate.

The y coordinate of the wave is defined here as either a fixed or scaled value.

Actions

The following actions are currently supported:

MoveMoves the vector 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 vector 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.
ResizeChanges the vector's length and amplitude.
ERR acResize(*Object, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
ParameterDescription
WidthThe new width of the object.
HeightThe new height of the object.
DepthThe new depth of the object.
VectorWave class documentation © Paul Manias © 2010-2026

WVC Type

Wave options.

NameDescription
WVC::BOTTOMClose the path across the bottom of its area.
WVC::TOPClose the path across the top of its area.
VectorWave module documentation © Paul Manias © 2010-2026

WVE Type

Wave envelope options.

NameDescription
WVE::EXPONENTIALExponential decay, weighted strongly towards the start of the wave.
WVE::LINEARLinear decay from start to end, this is the default.
WVE::QUADRATICQuadratic decay, weighted towards the end of the wave.
WVE::SMOOTHSTEPSmoothstep decay with ease-in and ease-out.
VectorWave module documentation © Paul Manias © 2010-2026

WVT Type

Wave style options.

NameDescription
WVT::SAWTOOTHSawtooth patterns rise at 45 degrees to the peak, then direct 90 degrees to the bottom.
WVT::SINEStandard sine-wave curvature, this is the default.
WVT::SQUAREStepped pattern that alternates between the peak and bottom edge with vertical transitions.
WVT::TRIANGLEChevron style angles at 45 degrees either side of the peak and bottom edge.
VectorWave module documentation © Paul Manias © 2010-2026