Skip to main content

compile_product_mesh_with

Function compile_product_mesh_with 

Source
pub fn compile_product_mesh_with<B: MeshCompiler>(
    backend: &B,
    model: &Model,
    product: EntityId,
    tolerance: Tolerance,
) -> GeometryResult<Option<TriMesh>>
Expand description

Compile one product’s body representation with a caller-supplied backend.

The backend is borrowed, so one instance serves a whole run: building a compiler per product would discard whatever caches or device handles an implementation holds.

§Errors

Returns GeometryError::CompilationRefused when the backend cannot produce a mesh, and any lowering error the representation raises first.

§Examples

Swapping only boolean evaluation, keeping the reference traversal:

let backend = ReferenceMeshCompiler::new(BoolmeshBoolean);
let mesh = compile_product_mesh_with(&backend, model, product, Tolerance::MILLIMETRE)?;