TriangleAreaConstraint

class TriangleAreaConstraint(val body: Body, var compliance: Double = 0.0, var iterations: Int = 1) : Constraint(source)

Represents a constraint that maintains the area of triangles within a physical body.

The TriangleAreaConstraint ensures that the signed areas of triangles in a Body remain consistent with their rest (initial) areas during simulations. This is achieved by applying correction steps to the positions of the associated nodes over multiple iterations. It is particularly useful in preserving the structural properties of deformable bodies.

Constructors

Link copied to clipboard
constructor(body: Body, compliance: Double = 0.0, iterations: Int = 1)

Properties

Link copied to clipboard
val body: Body

the Body whose triangle areas are constrained.

Link copied to clipboard

a parameter controlling the softness of the constraint; a higher value allows more deformation.

Link copied to clipboard

the number of iterations to perform during the constraint-solving process.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun initialize()
Link copied to clipboard
open suspend override fun solve(body: Body, dt: Double)

Resolves constraints and updates the state of nodes within the given physical body over a time step.