Skip to main content

Crate axiolid_refine

Crate axiolid_refine 

Source
Expand description

Mesh refinement: more triangles, and optionally closer to the truth.

Splitting a triangle is easy. The question this module exists to answer is where the new vertex goes.

A mesh-only kernel has one option: the edge midpoint. That subdivides the approximation without improving it – refining a faceted cylinder forever leaves the same faceted cylinder, with more triangles.

When the mesh came from a tessellated B-rep and the source surface is still known, there is a better answer: invert the midpoint into the surface’s parameter domain and evaluate the surface there. The new vertex lands on the ACTUAL cylinder. Refinement then converges on the real geometry instead of preserving a facet forever.

Keeping the analytic surface alongside the mesh is what makes that possible, so it is the capability this module is really for.

The crate also holds the operations that add or move vertices on a HalfedgeMesh to make a surface smoother rather than closer to a known one: fill_hole (triangulate, refine and fair a hole), fair() (solve for the smoothest placement of chosen vertices) and subdivide() (Loop and Catmull-Clark subdivision surfaces).

Re-exports§

pub use fair::fair;
pub use fair::FairError;
pub use fair::FairOptions;
pub use fair::FairReport;
pub use fair::FairingOrder;
pub use fair::FairingWeights;
pub use hole::fill_hole;
pub use hole::HoleFillError;
pub use hole::HoleFillOptions;
pub use hole::HoleFillReport;
pub use subdivide::limit_positions;
pub use subdivide::subdivide;
pub use subdivide::SubdivisionError;
pub use subdivide::SubdivisionOptions;
pub use subdivide::SubdivisionScheme;

Modules§

fair
Fairing: move chosen vertices to the smoothest surface their fixed surroundings allow.
hole
Hole filling: triangulate a boundary loop, refine the patch to the density of its surroundings, and fair it.
remesh
Isotropic remeshing: rewrite a triangle mesh so its edges approach one target length and its vertices approach valence six, while the surface stays on the input.
smooth
Laplacian smoothing with an explicitly fixed boundary.
subdivide
Subdivision surfaces: Loop on triangle meshes, Catmull-Clark on polygon meshes.

Structs§

RefineReport
What a refinement actually did.
SmoothReport
What a smoothing pass actually did.

Enums§

RefineError
Why a refinement could not be performed.
RefineTarget
How much to refine.

Functions§

refine
Refine a mesh, optionally snapping new vertices onto a known surface.