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
//! Asset loaders. Hand-written parsers, zero binary-crate deps.

pub mod alembic;
pub mod cff;
mod collada;
pub mod deflate;
pub mod draco;
mod dxf;
mod exr;
mod exr_codec;
mod exr_dwa;
mod gcode;
pub mod fbx;
mod gltf;
pub mod gltf_write;
mod gpos;
mod hdr;
pub mod json;
pub mod ktx2;
pub mod meshopt;
mod obj;
mod ply;
mod stl;
#[cfg(feature = "usd")]
pub mod usd;
// Font loading only asks whether a face has mark positioning; reading the
// attachments is for `captions`.
#[cfg_attr(not(feature = "captions"), allow(dead_code))]
pub mod mark;
mod overlap;

/// `GDEF`'s item variation store, from the table's own bytes at a normalized location.
///
/// A `GPOS` anchor and a kern value both vary through this one store. [`ttf::TtfFont`]
/// keeps the bytes only when there is mark positioning to read them for, so this is
/// `None` for most Latin fonts.
#[cfg(feature = "captions")]
#[must_use]
pub(crate) fn gdef_store<'a>(
    gdef: &'a [u8],
    coords: &[f32],
) -> Option<ttf_var::ItemVariationStore<'a>> {
    let at = gpos::gdef_var_store(gdef, 0)?;
    ttf_var::ItemVariationStore::new(gdef, at, coords)
}
pub mod shape;
mod ttf;
mod ttf_var;
pub mod typeface;
mod xml;

pub use alembic::{AlembicError, Archive as AlembicArchive, PolyMesh};
pub use collada::{ColladaError, ColladaLoader};
pub use draco::{DracoError, Header as DracoHeader};
pub use dxf::{parse_dxf, DxfError, DxfRead};
pub use exr::{ExrError, ExrLoader};
pub use fbx::{FbxError, FbxLoader, FbxScene};
pub use gcode::{
    GcodeLayer, GcodeLoader, GcodeToolpath, GCODE_EXTRUDED_COLOR, GCODE_TRAVEL_COLOR,
};
pub use gltf::{
    add_to_scene as gltf_add_to_scene, add_to_scene_mapped, GltfError, GltfImages, GltfLoader,
    GltfScene,
};
pub use gltf_write::{
    geometry_to_glb as gltf_geometry_to_glb, scene_to_glb, scene_to_glb_with, scene_to_gltf,
    scene_to_gltf_with, GltfExportOptions, GltfMaterialInfo, GltfMaterialKind,
};
pub use ktx2::{Ktx2, Ktx2Error};
pub use meshopt::MeshoptError;
/// The three.js r165 `GLTFLoader` port the one-call API above is built on.
pub mod gltf_parser {
    pub use super::gltf::{
        decode_data_uri, sanitize_node_name, supply_images, texture_constants,
        three_attribute_name, world_matrix, Accessor, Assoc, CameraParams, Document, GltfClip,
        GltfGeometry, GltfMaterial, GltfObject, GltfOptions, GltfParser, GltfSkeleton, GltfTexture,
        GltfTrack, ImageData, ImageRequest, ImageSource, Instances, LightParams, MaterialType,
        ObjectType, Param, Record, TrackInterpolation, TrackKind,
    };
}
pub use gpos::GposKerning;
pub use hdr::{HdrError, HdrLoader};
pub use obj::ObjLoader;
pub use ply::PlyLoader;
pub use stl::StlLoader;
pub use ttf::{TtfError, TtfFont, TtfGlyph};
pub use ttf_var::{wght_for_css_weight, NamedInstance, VariationAxis};
#[cfg(feature = "usd")]
pub use usd::{
    animated_scene_to_usda, animated_scene_to_usdc, animated_scene_to_usdz, geometry_to_usda,
    geometry_to_usdc, geometry_to_usdz, layer_to_usda, layer_to_usdc, layer_to_usdz, scene_to_usda,
    scene_to_usdc, scene_to_usdz, to_scene_at, UsdError, UsdExport, UsdFormat, UsdLayer, UsdLoader,
    UsdPrim, UsdScene, UsdValue, UsdzArchive, UsdzEntry, UsdzLayer,
};