Skip to main content

Module world_api

Module world_api 

Source
Expand description

High-level physics world API designed for Python consumers.

PyPhysicsWorld provides the primary interface: add/remove bodies, apply forces and impulses, step the simulation, and query state. Handles are u32 integers for easy FFI transmission. All state uses plain arrays and primitive types; no nalgebra types are exposed through the public API.

Structs§

ContactPair
Contact pair returned by get_contact_list.
FemBarElement
A single 2-node bar (truss) element for FEM assembly.
InertiaTensor
Inertia tensor (3×3 matrix stored as 9 elements, row-major).
MaterialProperties
Material property record returned by query functions.
PyAabb
Axis-aligned bounding box (AABB) in 3-D.
PyConstraint
A constraint between two rigid bodies.
PyConvexHull
A convex hull stored as a list of vertices.
PyFemAssembly
FEM assembly for a truss structure.
PyFemBinding
PyO3-style binding handle for a 2-D FEM solver.
PyLbmBinding
PyO3-style binding handle for a 2-D LBM simulation.
PyLbmConfig
Configuration for a 2-D D2Q9 Lattice-Boltzmann simulation.
PyLbmGrid
D2Q9 Lattice-Boltzmann grid simulation.
PyMaterial
A material definition holding both elastic and optional plastic properties.
PyMdBinding
PyO3-style binding handle for an MD simulation.
PyPhysicsWorld
A self-contained physics simulation world.
PyRigidBody
PyRigidBody is a lightweight handle-based wrapper that exposes body-level computations (moment of inertia, etc.) without owning state.
PySphBinding
PyO3-style binding handle for a 3-D SPH simulation.
PySphConfig
Configuration for an SPH particle simulation.
PySphSim
SPH particle simulation (simplified 3-D, poly6/spiky kernels).
PySphere
Sphere geometry query helper.
SimStats
Per-step simulation performance and state statistics.

Enums§

ConstraintType
Type of constraint between two bodies.
MaterialClass
Classification of material behaviour.

Functions§

array_to_vec3
Convert a [f64; 3] array to PyVec3.
py_p_wave_speed
PyO3-callable: return P-wave speed for a named material, or 0.0.
py_query_material
PyO3-callable: look up a material and return [density, E, nu, UTS, visc, yield] or an empty vec if the name is unknown.
py_s_wave_speed
PyO3-callable: return S-wave speed for a named material, or 0.0.
quat_conjugate
Conjugate (inverse for unit quaternion) of [x, y, z, w].
quat_from_axis_angle
Create a quaternion from an axis-angle representation.
quat_mul
Multiply two quaternions q1 * q2 (Hamilton product).
quat_normalize
Normalize a quaternion [x, y, z, w] and return it.
quat_rotate_vec
Rotate a vector v by unit quaternion q.
vec3_to_array
Convert PyVec3 to a [f64; 3] array.