Skip to content

novaphy

The top-level novaphy namespace is the primary import root for scene construction, immutable models, runtime buffers, joints, geometry, contact data, and engine-wide utilities. Solver classes and configuration objects intentionally live in novaphy.solvers instead of the top level (mirroring newton.solvers); other category pages on this site (novaphy.geometry, novaphy.math, novaphy.io, novaphy.utils) are conceptual groupings of these top-level symbols.

import novaphy

Build Pipeline

The canonical NovaPhy data flow is:

ModelBuilder  ──finalize──▶  Model  ──state()/control() + CollisionPipeline.contacts()──▶ runtime buffers
                                │                                          │
                                ├── CollisionPipeline.collide(state, contacts)
                                │                                          ▼
                                └── SolverBase.step(state_in, state_out, control, contacts, dt)

A minimal end-to-end example:

import numpy as np
import novaphy

builder = novaphy.ModelBuilder()
builder.add_ground_plane(y=0.0)

body = novaphy.RigidBody.from_box(1.0, np.array([0.5, 0.5, 0.5], dtype=np.float32))
idx = builder.add_body(body, novaphy.Transform.from_translation(np.array([0, 5, 0])))
builder.add_shape(novaphy.CollisionShape.make_box(np.array([0.5, 0.5, 0.5]), idx))

model = builder.finalize()
solver = novaphy.solvers.SolverSemiImplicit(model)

state    = model.state()
control  = model.control()
pipeline = novaphy.CollisionPipeline(model)
contacts = pipeline.contacts()

for _ in range(600):
    pipeline.collide(state, contacts)
    solver.step(state, state, control, contacts, 1.0 / 120.0)

For a fuller walkthrough including setup, runtime contract, and partner integration notes, see the Quick Start guide.

Classes

Class Description
AABB Axis-aligned bounding box.
Axis Coordinate-axis enumeration.
BroadPhaseMode Collision broadphase mode.
BroadPhasePair Candidate pair emitted by standalone broadphase utilities.
CollisionFilterPair Disabled shape pair entry for narrowphase filtering.
CollisionPipeline Broad + narrow phase collision pipeline used before solver steps.
CollisionShape Collision shape descriptor.
Contacts Structure-of-arrays contact aggregate (rigid_contact_*, soft_contact_*).
Control Caller-owned runtime control inputs (joint forces, targets).
Device CPU / CUDA device descriptor.
DeviceType Device kind enum.
Joint Per-link joint descriptor used by Featherstone helpers.
JointDofConfig Per-DOF joint configuration consumed by ModelBuilder.add_joint_*.
JointTargetMode Joint target control mode (Off, TargetPosition, TargetVelocity).
JointType Joint type enumeration.
Mesh Triangle mesh with optional precomputed inertia.
Model Immutable simulation model produced by ModelBuilder.finalize().
ModelBuilder Mutable scene builder for bodies, shapes, joints, articulations, particles, and imported assets.
RigidBody Rigid body mass and inertia descriptor.
ShapeConfig Shape parameters consumed by ModelBuilder.add_shape_*.
ShapeFlags Shape visibility and collision bit flags.
ShapeType Collision shape type enumeration.
SimState Caller-owned runtime body / particle / joint state.
Site Named attachment point used by sensors and importers.
SpatialTransform 6D spatial transform for Featherstone algebra.
SweepAndPrune Standalone SAP broadphase utility.
Transform 3D rigid transform (position + rotation).

Functions

Function Description
axis_to_vec3() Convert an Axis enum value to a 3D unit vector.
apply_particle_contact_reactions() Apply particle velocity reactions from Contacts.soft_contact_*.
apply_particle_coupling_contacts() Apply particle / soft-point contact forces back to rigid bodies.
batch_transform_vertices() Apply a transform to a batch of vertex positions.
eval_fk() Newton-aligned forward kinematics over a Model and SimState.
has_ipc() Returns whether the package was built with IPC / libuipc support.
has_sph_cuda() Returns whether the SPH CUDA backend is available.
version() Returns the engine version string.

Constants

Name Description
__version__ Same string as novaphy.version().

Submodules

Submodule Purpose
novaphy.actuators Actuator framework.
novaphy.sensors Sensor framework.
novaphy.solvers Solver classes and configuration.