pub struct Tessellation { /* private fields */ }Implementations§
Source§impl Tessellation
impl Tessellation
pub fn mesh(&self) -> &Mesh<D>
pub fn normals(&self) -> &TensorRank1Vec2D<D, Reference, Dimensionless>
pub fn bvh(&self) -> &BoundingVolumeHierarchy<D>
pub fn features(&self) -> &Features
pub fn smooth(&mut self, smoothing: Smoothing) -> Result<(), &'static str>
pub fn smooth_welded( &mut self, smoothing: Smoothing, ) -> Result<(), &'static str>
Source§impl Tessellation
impl Tessellation
Source§impl Tessellation
impl Tessellation
Sourcepub fn dual_background(
&self,
balancing: Balancing,
scale: Scalar,
) -> Result<(Mesh<D>, Vec<Class>), &'static str>
pub fn dual_background( &self, balancing: Balancing, scale: Scalar, ) -> Result<(Mesh<D>, Vec<Class>), &'static str>
Builds the dual of an octree fitted to this tessellation, with each cell classified against the surface.
The background for cut. balancing must be Strong(1)
or Weak(1), which is what dualization requires.
Sourcepub fn lattice_background(
&self,
spacing: Quantity<Length>,
) -> Result<(Mesh<D>, Vec<Class>), &'static str>
pub fn lattice_background( &self, spacing: Quantity<Length>, ) -> Result<(Mesh<D>, Vec<Class>), &'static str>
Builds a uniform lattice of cubes of the given edge length around this tessellation, with each cell classified against the surface.
The lattice spans the cells the surface passes through, those its interior encloses, and a single shell of cells beyond them, so it is a background to be cut, or trimmed and buffered, rather than a finished mesh.
Unlike dual_background the cells are all
axis-aligned cubes, at the cost of the grading a tree provides, and
the classes fall out of rasterizing rather than being found again.
Sourcepub fn lattice_tet_background(
&self,
spacing: Quantity<Length>,
) -> Result<(Mesh<D>, Vec<Class>), &'static str>
pub fn lattice_tet_background( &self, spacing: Quantity<Length>, ) -> Result<(Mesh<D>, Vec<Class>), &'static str>
Builds a uniform lattice around this tessellation and splits every cell into six tetrahedra, with each one classified against the surface.
The tetrahedral counterpart of
lattice_background. The cells are still
classified by rasterizing, so the six tetrahedra of a cell all take the
class of the cell they came from.
Sourcepub fn octree_background(
&self,
balancing: Balancing,
scale: Scalar,
) -> Result<(Mesh<D>, Vec<Class>), &'static str>
pub fn octree_background( &self, balancing: Balancing, scale: Scalar, ) -> Result<(Mesh<D>, Vec<Class>), &'static str>
Builds an octree fitted to this tessellation, with each cell classified against the surface.
The background for cut_polyhedral, taking
the octree directly rather than its dual. This places no 2:1
requirement on balancing, since hanging nodes become extra vertices
on a face rather than something to be dualized away. Weak(n) and
Strong(n) for n > 1 are therefore available here, permitting
coarser trees than dualization allows.
Sourcepub fn octree_tet_background(
&self,
balancing: Balancing,
pairing: Pairing,
scale: Scalar,
tolerance: Option<Quantity<Length>>,
) -> Result<(Mesh<D>, Vec<Class>), &'static str>
pub fn octree_tet_background( &self, balancing: Balancing, pairing: Pairing, scale: Scalar, tolerance: Option<Quantity<Length>>, ) -> Result<(Mesh<D>, Vec<Class>), &'static str>
Builds an octree fitted to this tessellation and meshes it as tetrahedra, with each one classified against the surface.
The tetrahedral counterpart of
octree_background, to be
trimmed. balancing must be Strong(1): the templates
filling a graded cell only span a one-level difference, and only a
balance over edges and vertices as well as faces holds them to it.
pairing need not be Regular; the tetrahedra conform under any
pairing, and None yields a smaller background.
tolerance is the Dunyach chord-error tolerance for curvature-driven
refinement; None disables it.
Sourcepub fn cut(
&self,
mesh: Mesh<D>,
classes: &[Class],
) -> Result<Mesh<D>, &'static str>
pub fn cut( &self, mesh: Mesh<D>, classes: &[Class], ) -> Result<Mesh<D>, &'static str>
Cuts a classified background mesh to this tessellation, leaving hexahedra everywhere but at the boundary.
Snaps the nodes that nearly lie on the surface onto it, builds the crossing tables, and assembles the cut cells into polyhedra.
Source§impl Tessellation
impl Tessellation
Sourcepub fn shape_diameter_function(
&self,
half_angle: Scalar,
rings: usize,
azimuthal: usize,
) -> QuantityVector<Length>
pub fn shape_diameter_function( &self, half_angle: Scalar, rings: usize, azimuthal: usize, ) -> QuantityVector<Length>
Estimates local thickness at each node via the shape diameter function.1
L. Shapira, A. Shamir, and D. Cohen-Or, Visual Comp. 24, 249 (2008). ↩
Source§impl Tessellation
impl Tessellation
Sourcepub fn trim(&self, mesh: &mut Mesh<D>) -> Result<(), &'static str>
pub fn trim(&self, mesh: &mut Mesh<D>) -> Result<(), &'static str>
Discards the cells of a background mesh lying outside this tessellation, leaving a mesh that covers the volume it encloses.
A cell survives when the signed distances at its nodes satisfy
minimum + 0.1 * maximum >= 0, so the cells straddling the surface
are kept for buffer to fit onto it.