threers 0.1.0

Drop-in three.js replacement for Rust and WebAssembly (wgpu) — THREE.* API, scene graph, PBR, post-fx, mesh BVH, CSG, an OpenSCAD front end with a watertight exact-CSG kernel, headless render, and native media codecs
Documentation
//! BVH-accelerated raycasting for `BufferGeometry` (three-mesh-bvh compatible).
//!
//! # Two kinds of caller, and why the defaults suit the other one
//!
//! Most callers *query* a tree — cast a ray, find a closest point — and want it
//! well shaped, because a subtree that failed to split is a linear scan. Build
//! those with [`BuildOptions::split_degenerate`] on.
//!
//! A second kind reads the tree's *shape*. [`bvhcast`](crate::mesh_bvh) walks
//! two trees together and reports the pairs of leaves that overlap, and the CSG
//! evaluator takes those pairs as its candidate set — so how finely the trees
//! were split decides how many candidates it sees, and with them what a boolean
//! returns. The defaults build three-mesh-bvh 0.7.6's tree split for split,
//! so those callers get three-bvh-csg's answer (`tests/csg_upstream.rs`).

mod build;
mod bvhcast;
mod hit;
// The type lives in a file named after the module it defines; the parent is
// the facade that re-exports it.
#[allow(clippy::module_inception)]
mod mesh_bvh;
mod node;
mod serialize;

pub use build::{BuildOptions, AVERAGE, CENTER, SAH};
pub use hit::BvhHit;
pub use mesh_bvh::{BvhNodeView, JsRayHit, MeshBvh};
pub use serialize::{SerializedMeshBvh, SERIALIZE_VERSION};

/// Material side constants (mirror three.js).
pub const FRONT_SIDE: u32 = 0;
pub const BACK_SIDE: u32 = 1;
pub const DOUBLE_SIDE: u32 = 2;

/// Shapecast traversal result constants (mirror three-mesh-bvh).
pub const NOT_INTERSECTED: i32 = 0;
pub const INTERSECTED: i32 = 1;
pub const CONTAINED: i32 = 2;