Skip to content

trusty.shells

Thin-shell bodies.

MembraneModel

Bases: Enum

Koiter class-attribute instance-attribute

Koiter = 0

NeoHookean class-attribute instance-attribute

NeoHookean = 1

BendingModel

Bases: Enum

Bac class-attribute instance-attribute

Bac = 0

QuadraticLagrange class-attribute instance-attribute

QuadraticLagrange = 1

DiscreteShell class-attribute instance-attribute

DiscreteShell = 2

ShellConfig

youngs_modulus property writable

youngs_modulus: float

poisson_ratio property writable

poisson_ratio: float

thickness property writable

thickness: float

density property writable

density: float

membrane_model property writable

membrane_model: MembraneModel

bending_model property writable

bending_model: BendingModel

strain_limit property writable

strain_limit: bool

strain_limit_ratio property writable

strain_limit_ratio: float

add_shell

add_shell(
    world: World,
    V: ndarray[float64, (N, M)],
    F: ndarray[int32, (N, 3)],
    config: ShellConfig,
    *,
    friction_mu: float = 0.0,
    initial_positions: ndarray[float64, (N, 3)]
    | None = None,
) -> int

Add a triangle-mesh shell body to the world. friction_mu is the body's surface Coulomb coefficient (>= 0); 0 is frictionless. initial_positions (num_verts, 3) is where the vertices start (default: V); the rest shape is V, so a different start leaves the shell strained.

set_velocity

set_velocity(
    world: World, body: int, v: ndarray[float64, (N, 3)]
) -> None

Overwrite per-vertex velocities of a shell body. v must have shape (num_verts, 3). Applied at the next step(); only this body's history is rewritten.

positions

positions(
    world: World, body: int
) -> ndarray[float64, (N, 3)]

set_project_positive_definite

set_project_positive_definite(
    world: World, project: bool
) -> None

PSD-project this module's Hessians on every Newton iteration (default off). Call before the first step().

project_positive_definite

project_positive_definite(world: World) -> bool