Skip to main content

Tessellation

Struct Tessellation 

Source
pub struct Tessellation { /* private fields */ }

Implementations§

Source§

impl Tessellation

Source

pub fn mesh(&self) -> &Mesh<D>

Source

pub fn normals(&self) -> &TensorRank1Vec2D<D, Reference, Dimensionless>

Source

pub fn bvh(&self) -> &BoundingVolumeHierarchy<D>

Source

pub fn features(&self) -> &Features

Source

pub fn smooth(&mut self, smoothing: Smoothing) -> Result<(), &'static str>

Source

pub fn smooth_welded( &mut self, smoothing: Smoothing, ) -> Result<(), &'static str>

Source§

impl Tessellation

Source

pub fn classify(&self, mesh: &Mesh<D>) -> Vec<Class>

Source§

impl Tessellation

Source

pub fn tables( &self, mesh: &Mesh<D>, classes: &[Class], snapped: &HashSet<usize>, ) -> Result<Tables, &'static str>

Source§

impl Tessellation

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

pub fn cut_polyhedral( &self, mesh: Mesh<D>, classes: &[Class], ) -> Result<Mesh<D>, &'static str>

Cuts a classified background mesh to this tessellation, leaving polyhedra throughout.

The counterpart of cut for a background whose cells carry hanging nodes, such as an octree taken directly.

Source§

impl Tessellation

Source

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


  1. L. Shapira, A. Shamir, and D. Cohen-Or, Visual Comp. 24, 249 (2008)

Source§

impl Tessellation

Source

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.

Trait Implementations§

Source§

impl From<&Tessellation> for BoundingVolumeHierarchy<3>

Source§

fn from(tessellation: &Tessellation) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Grid<3, T>> for Tessellation
where T: Copy + Default + Ord,

Source§

fn from(voxels: Voxels<T>) -> Self

Converts to this type from the input type.
Source§

impl From<Mesh<D>> for Tessellation

Source§

fn from(mesh: Mesh<D>) -> Self

Converts to this type from the input type.
Source§

impl From<Tessellation> for Mesh<D>

Source§

fn from(tessellation: Tessellation) -> Self

Converts to this type from the input type.
Source§

impl From<Tessellation> for (Connectivities, Coordinates<D>, TensorRank1Vec2D<D, Reference, Dimensionless>)

Source§

fn from(tessellation: Tessellation) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<&Path> for Tessellation

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(path: &Path) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<P> Write<Stl<P>> for Tessellation
where P: AsRef<Path>,

Source§

type Error = Error

Source§

fn write(&self, output: Stl<P>) -> Result<(), Self::Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Is<T> for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.