Expand description
Field kernels for meshes stored in fast_mesh_store: signed distances
from points to a mesh, accelerated by its fast_mesh_bvh BVH and the
closest-point query of fast_mesh_query.
-
SignDataholds what decides the sign of a distance for one mesh. It is built once per mesh revision bySignData::buildin aSignMode, andSignData::statusreports the mesh’s topology (closed or open, consistently oriented or not, non-manifold vertices, zero-area triangles) so that an application can warn about doubtful signs.SignData::winding_numbergives the generalized winding number, fast inSignMode::Winding(Barill et al. 2018). -
signed_distanceswrites, for every point, its distance to the mesh: positive outside (in front of the surface), negative inside (behind it), zero on it, and+∞beyondmax_distance. -
signed_distances_multidoes the same against severalTargetmeshes, each with its own placement, and keeps per point the smallest value and the target it came from. -
color_ofturns a field value into an RGBA8 colour under aColorRule(Colormap, range, optional centre, out-of-range rules).
Everything works in the mesh’s local f32 coordinates. Kernels allocate
only while building SignData, never per point (with the parallel
feature, large batches of points also get one buffer per chunk).
With the parallel feature, SignData::build and large batches of
signed_distances and signed_distances_multi run on rayon’s pool.
Every value is the same, bit for bit, with the feature on or off and for
any thread count.
Structs§
- Color
Rule - How a scalar field is turned into colours.
- Sign
Build SignData::buildcut into steps, so that a caller can yield between them: the mesh’s adjacency and incidence (when not cached), then each pass of the build, a bounded number of elements per step.- Sign
Data - Per-mesh data that decides the sign of a distance, built by
SignData::buildfor one revision of a mesh and one state of its BVH. - Sign
Status - What
SignData::buildfound out about a mesh, so that an application can warn when signs are doubtful. - Target
- One mesh of
signed_distances_multi, with what measuring to it reads.
Enums§
- Colormap
- A colormap from
tin[0, 1]to RGBA8. - Fields
Error - Why a field kernel could not run.
- OutOf
Range - What to show for a value outside the colour range.
- Sign
Mode - How the sign of a distance is decided.
Functions§
- color_
of - The colour of value
vunderrule. - curvatures
- Per-vertex signed mean curvature of
mesh:out[v]gets the value for vertex slotv(see the module docs), in 1/local-units.outmust hold one entry per vertex slot. - signed_
distances - Signed distances from
points_in_b(in mesh B’s local coordinates) to mesh B:out[i]gets the value forpoints_in_b[i]. - signed_
distances_ multi - Signed distances from
pointsto the nearest of severaltargets, with the target each value came from:out[i]andnearest[i]get the value and the target index forpoints[i]. - thicknesses
- Per-vertex wall thickness of
mesh:out[v]gets the value for vertex slotv(see the module docs).
Type Aliases§
- Result
ResultwithFieldsErroras the error type.