Wildmeshing Toolkit
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
wmtk::components::tracking::volume Namespace Reference

Classes

struct  Decomposition
 
struct  Location
 
struct  Outside
 
struct  PairSpec
 
class  StarPatch
 Tets embedded with every one the same way round, and a centre that sees every boundary face from inside: a ray from it leaves the patch through one face, once. More...
 

Typedefs

using Vid = uint32_t
 
using Tet = std::array< Vid, 4 >
 
using Tri = std::array< Vid, 3 >
 
using Tets = std::vector< Tet >
 
using Faces = std::set< Tri >
 Faces by their corners, sorted.
 
using Positions = std::vector< Eigen::Vector3d >
 

Functions

Tri sorted (Tri t)
 
Tet sorted (Tet t)
 
bool contains (const Tet &t, const Vid v)
 
bool contains (const Tri &t, const Vid v)
 
std::array< Tri, 4 > faces_of (const Tet &t)
 The four faces of a tet, each sorted.
 
std::set< Tet > keys (const Tets &T)
 The tets as a set of sorted tets.
 
std::optional< Faces > boundary (const Tets &T)
 The faces of T on one tet only; nothing if a face is on more than two.
 
bool is_ball (const Tets &T)
 
std::optional< std::vector< Vid > > disk_cycle (const Faces &F)
 
std::optional< Tets > collapse (const Tets &T, const Vid a, const Vid b)
 
std::vector< Tets > sides (const Tets &T, Vid c, const Faces &surf)
 The tets of T at c, grouped across the faces at c that are not in surf.
 
std::vector< Tets > side_groups (const Tets &T, const Faces &surf)
 
Faces surf_after (const Faces &surf, Vid i, Vid j)
 surf after collapsing (i, j) into j.
 
std::optional< PairSpec > make_pair (const std::string &kind, const Tets &Tb, const Tets &Ta, const Faces &sb, const Faces &sa, std::string *why=nullptr)
 The pair (Tb, Ta) if it is one; sb and sa are the tracked faces before and after.
 
std::vector< Vid > chords (const Tets &M, Vid i, Vid j)
 The ring vertices x of side M with a triangle (i, j, x) inside it.
 
char side_class (const Tets &M, const Vid i, const Vid j)
 
std::optional< Decomposition > decompose_collapse (const Tets &K, const Vid i, const Vid j, const Faces &surf, const Vid first_virtual, std::string *why)
 
int orient (const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const Eigen::Vector3d &d)
 The sign of det(b - a, c - a, d - a), exactly.
 
bool inside (const Eigen::Vector3d &p, const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const Eigen::Vector3d &d)
 Whether p is in the closed tet (a, b, c, d), exactly.
 
Eigen::Vector4d barycentric (const Eigen::Vector3d &p, const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const Eigen::Vector3d &d)
 
Outside outside_of (const Eigen::Vector3d &p, const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const Eigen::Vector3d &d)
 
Eigen::Vector4d exact_barycentric (const Eigen::Vector3d &p, const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const Eigen::Vector3d &d)
 
std::optional< std::pair< Eigen::Vector3d, double > > chebyshev (const std::vector< Eigen::Vector3d > &N, const std::vector< double > &b, const Eigen::Vector3d &x0, double L, double t_max)
 max t subject to N_i . x + t <= b_i, |x - x0|_inf <= L and t <= t_max, by a dense simplex: the largest ball (in the normals' metric) around a point of the polytope. x0 need not be inside: the start is t at its most negative. Returns (x, t), nothing if the solver fails.
 
std::optional< Eigen::Vector3d > kernel (const std::vector< const StarPatch * > &patches)
 
std::optional< Eigen::Vector3d > apex_centre (const StarPatch &S)
 
std::optional< Eigen::Vector3d > centre_of (const StarPatch &S, bool *thin)
 
std::optional< Positions > spherical (const Tets &T, const Positions &P, double fat=0.05)
 A fallback embedding of a cone from a boundary apex c: every vertex keeps its distance from c, and its direction from c is laid out again, on the sphere, so the cone is star-shaped about a point next to c. The directions live in the gnomonic plane of a direction d; the link's triangles rest in the shapes of their real spherical triangles (near-degenerate ones opened to a height of fat of their longest edge), the outline is kept star-shaped about the origin by a scaffold of fan triangles (SLIM). Then the directions and radii are polished by L-BFGS on the symmetric Dirichlet energy of the tets themselves. Nothing if T is not a cone with a disk for a link.
 
std::optional< Positions > bowl (const Tets &T, const Positions &P)
 
std::optional< Positions > convex (const Tets &T, const Positions &P)
 
template<typename Accept >
std::optional< Location > locate_in (const Tets &T, const Positions &X, const Eigen::Vector3d &p, const Accept &accept)
 

Detailed Description

The combinatorics of a volume map's local maps: patches of tets on the vertices of one operation (VolumeEdit's local ids, and virtual vertices past them).

The geometry of a volume map's local maps: patches embedded star-shaped, and the radial map between two of them.

Typedef Documentation

◆ Positions

using wmtk::components::tracking::volume::Positions = typedef std::vector<Eigen::Vector3d>

Positions by vertex id (local ids, then virtual ones); a vertex a patch does not use may hold anything.

Function Documentation

◆ apex_centre()

std::optional< Eigen::Vector3d > wmtk::components::tracking::volume::apex_centre ( const StarPatch &  S)

For a cone from a boundary apex c whose faces at c share an inward direction d: c + eps d, eps halved from the patch size until the centre sees every face. Nothing otherwise.

◆ barycentric()

Eigen::Vector4d wmtk::components::tracking::volume::barycentric ( const Eigen::Vector3d &  p,
const Eigen::Vector3d &  a,
const Eigen::Vector3d &  b,
const Eigen::Vector3d &  c,
const Eigen::Vector3d &  d 
)

p's barycentric coordinates in the tet (a, b, c, d), by a backward stable solve: in a tet that is nearly flat they put p back where it is, to rounding, which an inverse of the edge matrix computed once does not.

◆ bowl()

std::optional< Positions > wmtk::components::tracking::volume::bowl ( const Tets &  T,
const Positions &  P 
)

A cone from a boundary apex: the disk of its faces away from the apex laid out by Tutte on a circle and lifted into a convex bowl (Maxwell-Cremona), the apex above it. Scaled to the size of P's patch.

◆ centre_of()

std::optional< Eigen::Vector3d > wmtk::components::tracking::volume::centre_of ( const StarPatch &  S,
bool *  thin = nullptr 
)

A centre for S: kernel(), else apex_centre(), else an interior apex that sees every face. thin tells whether the kernel was too thin for the LP.

◆ collapse()

std::optional< Tets > wmtk::components::tracking::volume::collapse ( const Tets &  T,
Vid  a,
Vid  b 
)

T with edge (a, b) collapsed into b: the tets on it go, a is renamed b. Nothing if that makes a tet twice.

◆ convex()

std::optional< Positions > wmtk::components::tracking::volume::convex ( const Tets &  T,
const Positions &  P 
)

A convex realization of a ball whose boundary holds every vertex but at most the one apex: Tutte on the boundary sphere, Maxwell-Cremona lift, the apex at the centroid.

◆ disk_cycle()

std::optional< std::vector< Vid > > wmtk::components::tracking::volume::disk_cycle ( const Faces &  F)

The boundary loop of a triangulated disk, from its smallest vertex; nothing if F is not a disk; empty for no faces.

◆ exact_barycentric()

Eigen::Vector4d wmtk::components::tracking::volume::exact_barycentric ( const Eigen::Vector3d &  p,
const Eigen::Vector3d &  a,
const Eigen::Vector3d &  b,
const Eigen::Vector3d &  c,
const Eigen::Vector3d &  d 
)

barycentric(), exactly (rational volume ratios), rounded once: for a nearly flat tet, whose coordinates in doubles are only right as a whole. -inf for a point that is not a number.

◆ is_ball()

bool wmtk::components::tracking::volume::is_ball ( const Tets &  T)

Whether T's boundary is a connected closed surface of Euler characteristic 2, manifold at every edge and vertex.

◆ kernel()

std::optional< Eigen::Vector3d > wmtk::components::tracking::volume::kernel ( const std::vector< const StarPatch * > &  patches)

A centre every patch sees all its faces from, as far from the face planes as can be (the farther, the better conditioned the radial map); checked exactly. Nothing if none.

◆ side_class()

char wmtk::components::tracking::volume::side_class ( const Tets &  M,
Vid  i,
Vid  j 
)

The class of one side M (a group of sides()) of a collapse of i into j: 'b' if every tet has j (the side vanishes), 'c' if it has a chord (j, x), else 'a'.

◆ side_groups()

std::vector< Tets > wmtk::components::tracking::volume::side_groups ( const Tets &  T,
const Faces &  surf 
)

The tets of T grouped across the faces two of them share that are not in surf: the sides of the tracked surface among them.