The pure-Rust physics engine swaps its remaining approximations for real algorithms — CSG that actually classifies inside from outside, surface reconstruction that fits an implicit, motion planning that respects obstacles, and a hybrid quantum/classical molecular engine.
Today we released OxiPhysics 0.1.2 — a correctness-and-capability release for the unified, pure-Rust physics engine targeting Bullet (rigid body), OpenFOAM (CFD), LAMMPS (molecular dynamics), and CalculiX (FEM). Where 0.1.0 and 0.1.1 had a few methods standing in with approximations, 0.1.2 replaces them with the real thing — and adds a hybrid quantum-mechanics / molecular-mechanics module on top.
No C. No C++. No Fortran. The engine remains 100% C/Fortran-free in default features, compiles to a single static binary or to wasm32, and installs with one cargo add. What changed is the honesty and depth of the math behind several APIs.
Why 0.1.2 is a meaningful release
A physics engine is only as trustworthy as its weakest method. If union on two meshes is secretly an AABB approximation, or a motion planner’s collision check always returns “clear,” then the API lies — it compiles and returns a plausible value that isn’t physically right. 0.1.2 hunts those down and replaces them with real implementations, each backed by a new correctness test.
- CSG that really classifies geometry.
PyCsg::union/intersection/subtractionnow delegate to the realoxiphysics-geometry::mesh_booleanalgorithm — proper winding-number/ray-cast inside-outside classification pluscleanup_mesh/weld_vertices— instead of the previous AABB-approximation stubs. - Real surface reconstruction.
PyPointCloud::poisson_reconstructnow performs genuine Implicit Moving Least Squares (IMLS) reconstruction: PCA-estimated normals when absent, a Gaussian-weighted tangent-plane signed-distance implicit, and Marching-Cubes isosurface extraction. Previously it silently returned an empty mesh. - Motion planning that sees obstacles.
MotionPlanningnow carries a realobstacles: Vec<PlanningObstacle>field (n-dimensional C-space spheres).is_collision_freechecks Euclidean distance to every obstacle, andis_segment_collision_freeprevents tunnelling in RRT/PRM edge expansion with a 10-sample discretisation. The check used to always returntrue. - A real Lattice-Boltzmann step.
LbmGrid3Dgains a genuinestep(omega)method: BGK collision (equilibrium from cachedrho/ux/uy/uz) plus pull-scheme periodic streaming, withcompute_macroscopic()updating fields each step. The dead emptystep_placeholderis gone. - Hybrid quantum/classical molecules. A new
qm_mmmodule brings QM/MM support tooxiphysics-md, with the QM region selectable across four methods and a real SCF loop and forces (details below).
All of it stays honest: zero todo!()/unimplemented!() stubs, with 16 new unit and integration tests added specifically to assert the real behavior of these fixes.
Technical Deep Dive: the new QM/MM engine and the correctness work
-
qm_mm— quantum mechanics / molecular mechanics (oxiphysics-md) The headline new module couples a quantum region to a classical force-field region. The QM region is selectable viaQmMethod: PM3 (semi-empirical NDDO), SCC-DFTB (density-functional tight-binding), HF (Hartree-Fock / STO-3G), and B3LYP (Kohn-Sham LDA/VWN). The MM region uses force-field point charges, with mechanical or electrostatic embedding and hydrogen link-atom capping at the boundary. Each engine runs a real SCF loop with a Löwdin-orthogonalised generalised eigensolver, and provides numerical Hellmann-Feynman forces — so QM/MM here is a working solver, not a label. -
Geometry & reconstruction (
oxiphysics-geometry,oxiphysics-python) The mesh-boolean path is the real winding-number classifier with mesh cleanup, and IMLS reconstruction goes PCA normals → Gaussian tangent-plane implicit → Marching Cubes via the geometry crate’sMarchingCubes. These were the two places the Python surface most needed to stop approximating, and now they don’t. -
CFD & planning (
oxiphysics-lbm,oxiphysics-rigid)LbmGrid3D::stepis a real BGK collide-and-stream with mass conservation verified by test, andMotionPlanningnow does true C-space obstacle avoidance for RRT/PRM, including segment checks that stop sampling-based planners from tunnelling through obstacles between waypoints. -
Workspace structure (splitrs refactor) Several oversized modules (>2000 LoC) —
oxiphysics-coretypes/pde/linalg,oxiphysics-geometrybspline,oxiphysics-rigidkinematics/mechanism_rigid,oxiphysics-lbmmixing_lbm,oxiphysics-mdquantum_chemistry,oxiphysics-vizmultiphysics_viz— were split into focusedtypes/functionssubmodules withsplitrs, and redundant#[allow(...)]Clippy attributes were removed across the workspace. Public APIs are unchanged: this is purely a maintainability refactor.
The workspace guarantees hold: pure Rust by default, single-binary deployment, WASM bindings, and zero C/Fortran in default features.
Getting Started
cargo add oxiphysics
The umbrella crate re-exports every domain module, so the core API is unchanged from 0.1.0/0.1.1:
use oxiphysics::core::math::Vec3;
use oxiphysics::core::Transform;
// Build a transform at a given position
let origin = Transform::default();
let offset = Vec3::new(1.0, 2.0, 3.0);
// Transform a point from local space into world space
let world_pt = origin.transform_point(&offset);
println!("world: {:?}", world_pt);
To advance a 3D Lattice-Boltzmann fluid one BGK step, build an LbmGrid3D and call the new real step(omega), then read the updated macroscopic fields via compute_macroscopic() — periodic streaming and collision now happen for real, not as a placeholder.
What’s New in 0.1.2
oxiphysics-md— newqm_mmhybrid QM/MM module:QmMethod(Pm3,SccDftb,Hf,DftB3lyp) for the QM region, force-field point charges for the MM region, mechanical/electrostatic embedding, hydrogen link-atom capping, a real SCF loop (Löwdin-orthogonalised generalised eigensolver), and numerical Hellmann-Feynman forces.oxiphysics-python—PyCsgboolean operations now use the realmesh_boolean(winding-number classification +cleanup_mesh/weld_vertices);PyPointCloud::poisson_reconstructnow performs real IMLS surface reconstruction with Marching-Cubes extraction.oxiphysics-rigid—MotionPlanninggains a realobstaclesfield,is_collision_free/is_segment_collision_freeC-space checks, and awith_obstacles(...)builder; the planner no longer reports everything collision-free.oxiphysics-lbm—LbmGrid3D::step(omega): real BGK collision + pull-scheme periodic streaming withcompute_macroscopic()updates; the deadstep_placeholderwas removed.oxiphysics-io— re-exportedparticle_formatstypes (DcdWriter/DcdReader,XyzWriter/XyzReader,ParticleFrame,ParticleTrajectory,GroReader/GroWriter, …) at the crate root, fixing a failingDcdWriterdoctest.- Structural refactor (splitrs) — oversized (>2000 LoC) modules across core, geometry, rigid, lbm, md, and viz were split into focused submodules, with redundant Clippy
#[allow(...)]attributes removed; the SPH particle data structures were reorganised. No behavioural change. - Doctest fixes —
oxiphysics-vehiclehil.rs(SimHilBridge+HilInterface, correctedget_outputtype) andoxiphysics-wasm(SharedStateBuffermutability;WebGlRenderFrame.positions()accessor). - 16 new tests across
oxiphysics-python,oxiphysics-rigid, andoxiphysics-lbmcovering CSG operations, IMLS reconstruction, obstacle and segment collision, RRT paths, LBM mass conservation, and the equilibrium fixed point.
Tips
- Pick the QM method to fit your budget. In
qm_mm, reach forPm3orSccDftbwhen you need speed across a larger QM region, andHf/DftB3lypwhen you want higher fidelity on a small active site — all four share the same embedding and link-atom machinery, so you can swap the method without rewiring the boundary. - Cap QM/MM boundaries with link atoms. When your QM/MM cut crosses a covalent bond, use the hydrogen link-atom capping that ships in the module rather than leaving a dangling bond — it’s what keeps the SCF on the QM region physically sensible.
- Give your planner real obstacles. Build
MotionPlanningwithwith_obstacles(...); because RRT/PRM edge expansion now runsis_segment_collision_free(10-sample discretisation), you get paths that don’t tunnel through C-space obstacles between waypoints. - Use IMLS when your point cloud has no normals.
poisson_reconstructnow estimates normals via PCA when they’re absent and fits a Gaussian-weighted implicit before Marching Cubes — so you can reconstruct a watertight surface straight from raw points. - Tune the LBM relaxation.
LbmGrid3D::step(omega)exposes the BGK relaxation parameter directly:omegacontrols viscosity (relaxation toward equilibrium), so dial it to match your target Reynolds number, then read results back withcompute_macroscopic(). - Upgrade in place. The splitrs refactor left public APIs unchanged, and the new capabilities are additive — bump from 0.1.1 to 0.1.2 and your existing code keeps compiling.
This is the foundation
OxiPhysics is the simulation layer of the broader COOLJAPAN pure-Rust ecosystem, and 0.1.2 keeps building on its siblings — solver paths lean on SciRS2 (scientific-computing primitives, via scirs2-integrate), OxiFFT (pure-Rust spectral transforms), and OxiARC (pure-Rust compression, via oxiarc-zstd) rather than any native C/C++ stack. With this release, more of the engine’s surface is backed by real algorithms end to end — sovereign, memory-safe, and honest by default.
Repository: https://github.com/cool-japan/oxiphysics
Star the repo if you want a physics engine whose methods compute the real answer — from CSG booleans to QM/MM — with no C toolchain in the default build.
Pure Rust physics is here — fast, safe, and sovereign.
— KitaSan at COOLJAPAN OÜ June 6, 2026