extractEigenModes

fun Shape.extractEigenModes(count: Int, resolution: Int = 64, random: Random = Random(0), boundaryCondition: EigenModeBoundaryCondition = EigenModeBoundaryCondition.DIRICHLET): List<EigenMode>(source)

Extracts the count lowest-frequency vibrational eigenmodes of this shape's interior, by rasterizing it to a grid and solving the discrete clamped- or free-membrane eigenproblem on it.

Return

The requested modes, ascending by EigenMode.eigenvalue.

Parameters

count

Number of modes to extract, ordered from lowest to highest frequency.

resolution

Grid cells along the longer side of the shape's bounding box; the shorter side is scaled to match the shape's aspect ratio. Higher values resolve finer boundary detail and higher-frequency modes at the cost of a larger eigenproblem to solve.

random

Source of the eigensolver's random initial vectors. Defaults to a fixed seed (Random(0)) for reproducible results.

boundaryCondition

Whether the shape's boundary is pinned (EigenModeBoundaryCondition.DIRICHLET, the default) or free (EigenModeBoundaryCondition.NEUMANN).