Expand description
Python-friendly wrapper/bridge layer for the OxiPhysics engine.
This crate provides Python-friendly types and a high-level API surface designed for future PyO3/pyo3 FFI integration. All types use simple owned data (no lifetimes) and derive Serialize/Deserialize for easy JSON interchange.
§Quick start
use oxiphysics_python::world_api::PyPhysicsWorld;
use oxiphysics_python::types::{PySimConfig, PyRigidBodyConfig};
let mut world = PyPhysicsWorld::new(PySimConfig::earth_gravity());
let h = world.add_rigid_body(PyRigidBodyConfig::dynamic(1.0, [0.0, 10.0, 0.0]));
world.step(1.0 / 60.0);
let pos = world.get_position(h).expect("body exists");
assert!(pos[1] < 10.0); // body has fallen under gravityRe-exports§
pub use fem_api::PyFemDirichletBC;pub use fem_api::PyFemElement;pub use fem_api::PyFemMaterial;pub use fem_api::PyFemMesh;pub use fem_api::PyFemNodalForce;pub use fem_api::PyFemNode;pub use fem_api::PyFemSolveResult;pub use fem_api::PyFemSolver;pub use lbm_api::LbmBoundary;pub use lbm_api::PyLbmConfig;pub use lbm_api::PyLbmSimulation;pub use md_api::PyMdAtom;pub use md_api::PyMdConfig;pub use md_api::PyMdSimulation;pub use sph_api::PySphConfig;pub use sph_api::PySphSimulation;pub use world_api::PyPhysicsWorld;pub use types::*;
Modules§
- analytics_
api - Physics analytics Python bindings.
- constraints_
api - Constraint system API for Python interop.
- fem_api
- Finite Element Method (FEM) simulation API for Python interop.
- geometry_
api - Python geometry bindings.
- io_api
- I/O API for Python interop.
- lbm_api
- Lattice Boltzmann Method (LBM) simulation API for Python interop.
- materials_
api - Materials API for Python interop.
- md_api
- Molecular Dynamics (MD) simulation API for Python interop.
- rigid_
api - Python rigid body bindings.
- serialization
- Auto-generated module structure
- sph_api
- Smoothed Particle Hydrodynamics (SPH) simulation API for Python interop.
- types
- Python-friendly wrapper types with serde support.
- vehicle_
api - Vehicle simulation API for Python interop.
- viz_api
- Visualization API for Python interop.
- world_
api - High-level physics world API designed for Python consumers.
Enums§
- Error
- Comprehensive error type for the
oxiphysics-pythonbridge.
Type Aliases§
- Result
- Result type alias for
oxiphysics-pythonoperations.