Skip to main content

compile_product_mesh

Function compile_product_mesh 

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

Compile one product’s body representation into triangles.

Uses default_backend. Call compile_product_mesh_with to supply your own.

Returns Ok(None) when the product has no body representation at all, which is ordinary – a spatial container or an annotation-only product is not an error.

§Tolerance

Lowering converts every length to metres, and the backend reads tolerance in the model’s current length unit, so Tolerance::MILLIMETRE (1e-3) is a millimetre here regardless of what the file declared. Deriving a tolerance from the file’s unit scale would double-apply the conversion.

§Errors

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