Expand description
Triangle meshes and point clouds for the 3D preview.
Pure-Rust readers for the common mesh, 3D-printing, visualisation and
point-cloud formats, plus STEP B-rep tessellation with the truck CAD
kernel (Apache-2.0). Every reader produces one Mesh in model
coordinates; Mesh::encode writes the compact binary form that
shared/js/viewer.js draws (TCMESH01, little endian).
Simulation results (VTK, VTU/VTP, CalculiX FRD, see crate::simmesh)
additionally carry per-vertex scalar Fields that the viewer colours
with a colour map; the section is optional and flagged, so older viewers
and cached meshes keep working.
The readers are defensive: sizes are limited, indices are checked and a
malformed file is an error, never a panic or an endless loop. The server
still runs them in a separate process with a time limit (see preview).
Modules§
- creo
- PTC Creo parts (
.prt.N): a preview mesh tessellated from the exact B-rep the file stores – Creo keeps no display tessellation of the body. Seedocs/src/research/creo-brep-preview.md. Assemblies (.asm.N) are put together from their parts (asm,services::assemblies). - render
- A small software renderer for thumbnails: an isometric view of a
Meshwith a z-buffer, flat shading and dark outlines where the depth jumps (silhouettes, steps), written as an RGBA PNG with a transparent background, so it sits on light and dark skins alike. - rhino
- Rhino models (
.3dm, versions 1 to 8).
Structs§
- Field
- A scalar result field on the vertices of a
Mesh: a measured value, the magnitude of a vector or the von Mises stress of a tensor. Values that are not finite mark vertices without a value (drawn neutral). - Mesh
- Triangles (or points when
indicesis empty) in model coordinates.
Constants§
- MAX_
FIELDS - Fields a mesh carries at most (the viewer offers them in a selector).
- MAX_
POINTS - Point clouds with more points are thinned out evenly.
- MAX_
STEP_ BYTES - Larger STEP files are not previewed (the kernel needs several times the file size in memory and would not finish within the time limit).
- MAX_
TRIANGLES - Largest triangle count that is previewed.