BoundaryEigenMode

data class BoundaryEigenMode(val eigenvalue: Double, val frequencyRatio: Double, val contour: RectifiedContour, val ts: List<Double>, val values: DoubleArray)(source)

One eigenmode of a RectifiedContour's outline, as produced by RectifiedContour.extractBoundaryEigenModes.

Unlike EigenMode, this only considers the boundary curve itself, not the shape's interior -- it's the eigenbasis of the contour sampled as a closed graph, a generalization of the sine/cosine basis used by classical Fourier shape descriptors to non-uniformly detailed curves.

Constructors

Link copied to clipboard
constructor(eigenvalue: Double, frequencyRatio: Double, contour: RectifiedContour, ts: List<Double>, values: DoubleArray)

Properties

Link copied to clipboard

The rectified contour that was sampled. Rectification is what makes equal steps in ts equal steps in arc length, which is what the underlying graph Laplacian assumes of its nodes.

Link copied to clipboard

The Laplacian eigenvalue of this mode; larger means higher spatial frequency.

Link copied to clipboard

This mode's frequency relative to the fundamental mode. Mode 0 is always the trivial, patternless zero-eigenvalue constant mode (frequencyRatio == 0.0); the fundamental is mode 1.

Link copied to clipboard
val n: Int

Number of points/nodes around the curve.

Link copied to clipboard
val ts: List<Double>

The (rectified) contour parameters sampled around the contour, in order; ts[i] is where values[i] was taken, and contour.position(ts[i]) recovers the world-space point.

Link copied to clipboard

The mode shape, one value per parameter in ts.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun position(index: Int): Vector2

The world-space position that sample point index (0 until n) was taken at.

Link copied to clipboard

Samples this mode at point-index coordinate t, which wraps around modulo n (so both -0.5 and n - 0.5 land halfway between the last and first point), using linear interpolation between the nearest sample points.