﻿---
title: Mesh checks
description: Check a surface for problems before you use it, and find tetrahedral meshes that overlap.
url: https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/
---

# Mesh checks – Rust API Reference – Deformable v0.5.0

[`verify_surface`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#verify_surface) checks a surface for problems before you use it and reports one [`MeshIssue`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue) per problem it finds. [`meshes_intersect`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshes_intersect) tells whether two tetrahedral meshes overlap, so that objects do not start inside each other.

## SelfIntersectionCheck

**Enum** · `deformable::tools::SelfIntersectionCheck`

```rust
pub enum SelfIntersectionCheck {
    Skip,
    PerIsland,
    Full,
}
```

How far the self-intersection stage of [`verify_surface`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#verify_surface) goes: the stage that reports an
edge crossing a face it does not touch.

The stage also splits the surface into islands, the parts whose faces join through shared edges, which the
inward-normal and nesting stage of [`MeshChecks::closed_boundary`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks) needs.

**Values**

- `Skip`: No self-intersection, island, inward-normal or nesting check.
- `PerIsland`: The default: a face crossed by an edge of another island is not reported; the two islands count as
  intersecting for the inward-normal and nesting stage.
- `Full`: Every face crossed by an edge is reported, whatever the islands.

**Implements** `Clone` · `Copy` · `Debug` · `Default` · `Eq` · `PartialEq` · `Send` · `Sync`

**See also** [Guide: Check a mesh before you use it](https://help.tangerina.io/deformable/v0.5.0/user-guides/rust/tools/#check-a-mesh-before-you-use-it) · [C `DeformableSelfIntersectionCheck`](https://help.tangerina.io/deformable/v0.5.0/api-references/c/mesh-checks/#deformableselfintersectioncheck) · [Python `SelfIntersectionCheck`](https://help.tangerina.io/deformable/v0.5.0/api-references/python/mesh-checks/#selfintersectioncheck)

## MeshChecks

**Struct** · `deformable::tools::MeshChecks`

```rust
pub struct MeshChecks {
    pub angle_threshold_degrees: f64,
    pub gap_threshold: f64,
    pub planar_threshold: f64,
    pub uv_threshold: Option<f64>,
    pub same_uv: bool,
    pub convex: bool,
    pub closed_boundary: bool,
    pub self_intersection: SelfIntersectionCheck,
}
```

Which checks [`verify_surface`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#verify_surface) runs, and their thresholds.

`MeshChecks::default()` gives the defaults the fields list. Some checks run whatever the fields say: lone and
co-located vertices, co-located, non-manifold, inverted and degenerate edges, degenerate faces and holes, corners of
one face at one position, outer loops that do not wind once, and faces with holes.

The mesh radius is the largest distance of a vertex position from the mean of the distinct positions. A face's
radius is the largest distance of its corners from the mean of its outer loop's corners.

**Fields**

- `angle_threshold_degrees` (`f64`): A face whose outer loop has a corner angle below this many degrees is a
  [`MeshIssue::SmallAngle`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-smallangle). The angle is the one between the corner's two edges,
  from 0 to 180 degrees, so a reflex corner counts as 360 degrees minus its interior angle. Default `2`.
- `gap_threshold` (`f64`): Two corners of a face at different positions closer than this fraction of the mesh radius are
  [`MeshIssue::NearVertices`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-nearvertices); a negative threshold counts as its absolute
  value. At 0, only corners whose squared distance is 0 are reported: as
  [`MeshIssue::CoLocatedFaceVertices`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-colocatedfacevertices) when they sit at one position,
  which no threshold turns off, and as `NearVertices` when they are so close that the square of their distance
  rounds to 0. Default `0.001`.
- `planar_threshold` (`f64`): A face with a corner farther from its outer loop's plane than this fraction of its radius is
  [`MeshIssue::NonPlanar`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-nonplanar), and skips the
  [`MeshIssue::InconsistentUv`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-inconsistentuv) check. A triangle without holes is always
  planar. Default `0.05`.
- `uv_threshold` (`Option<f64>`): A corner farther than this fraction of the face radius from where the UV map of its face puts it is
  [`MeshIssue::InconsistentUv`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-inconsistentuv); `None` skips the check. Default `None`.
- `same_uv` (`bool`): Reports [`MeshIssue::SameUv`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-sameuv): two corners of a face at different places with
  identical UVs. Default `false`.
- `convex` (`bool`): Reports [`MeshIssue::NonConvex`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-nonconvex): a face with a reflex corner. Default `false`.
- `closed_boundary` (`bool`): Reports [`MeshIssue::NonClosedBoundary`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-nonclosedboundary), an edge with one face, and runs
  the inward-normal and nesting stage last. Default `false`.
- `self_intersection` ([`SelfIntersectionCheck`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#selfintersectioncheck)): How far the self-intersection stage goes. Default [`SelfIntersectionCheck::PerIsland`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#selfintersectioncheck-perisland).

**Implements** `Clone` · `Copy` · `Debug` · `Default` · `PartialEq` · `Send` · `Sync`

**Example**

```rust
// A cage for tetrahedralize: every edge on two faces, none crossed.
let checks = MeshChecks {
    closed_boundary: true,
    self_intersection: SelfIntersectionCheck::Full,
    ..MeshChecks::default()
};
let surface = SurfaceMesh { mesh: polygons, ..SurfaceMesh::default() };
assert!(verify_surface(&surface, &[], &checks)?.is_empty());
```

**See also** [Guide: Check a mesh before you use it](https://help.tangerina.io/deformable/v0.5.0/user-guides/rust/tools/#check-a-mesh-before-you-use-it) · [C `DeformableMeshChecks`](https://help.tangerina.io/deformable/v0.5.0/api-references/c/mesh-checks/#deformablemeshchecks) · [Python `MeshChecks`](https://help.tangerina.io/deformable/v0.5.0/api-references/python/mesh-checks/#meshchecks)

## MeshIssue

**Enum** · `deformable::tools::MeshIssue`

```rust
pub enum MeshIssue {
    LoneVertex { vertex: u32 },
    NonClosedBoundary { edge: [u32; 2] },
    NonManifold { edge: [u32; 2], use_count: u32 },
    CoLocatedVertices { vertices: Vec<u32> },
    CoLocatedEdges { edges: Vec<[u32; 2]> },
    InvertedNormal { edge: [u32; 2] },
    DegenerateEdge { edge: [u32; 2] },
    DegenerateFace { face: u32 },
    DegenerateHole { face: u32, hole: u32 },
    CoLocatedFaceVertices { face: u32, corners: [u32; 2] },
    NearVertices {
        face: u32,
        corners: [u32; 2],
        distance: f64,
        relative_distance: f64,
    },
    SmallAngle { face: u32, degrees: f64 },
    NonPlanar { face: u32, relative_deviation: f64 },
    NonConvex { face: u32, interior_angle_degrees: f64 },
    MultipleWinding { face: u32 },
    SameUv { face: u32, corners: [u32; 2], uv_set: u32 },
    InconsistentUv {
        face: u32,
        corner: u32,
        uv_set: u32,
        relative_distance: f64,
    },
    FaceHasHoles { face: u32, hole_count: u32 },
    SelfIntersection { face: u32, edge: [u32; 2] },
    InwardIslandIntersects { island: u32 },
    NestedIslands { island: u32, container: u32, inward: bool },
    InwardNormals { uncontained: Vec<u32>, island_count: u32 },
}
```

One problem [`verify_surface`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#verify_surface) found, with the elements that locate it.

Vertices are input vertex indices. An edge is named by the two vertex indices of the first loop edge on it, smaller
first. Corners count within their polygon, outer loop first, then the holes; holes count within their face in
corner order; islands, the parts of the surface whose faces join through shared edges, are numbered in order of
their lowest face.

[`NonClosedBoundary`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-nonclosedboundary) and [`NonManifold`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-nonmanifold) are checked twice: on the
edges between distinct vertex indices, then on the edges between distinct positions. So an edge of a surface without
co-located vertices is reported once by each; remove the duplicates before showing the issues.

**Values**

- `LoneVertex`: A vertex no face uses. It is reported for the vertex, then once more for its position, named by the lowest
  vertex there, when no vertex at that position is used.
  - `vertex` (`u32`): The unused vertex.
- `NonClosedBoundary`: An edge with one face; only with [`MeshChecks::closed_boundary`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks).
  - `edge` (`[u32; 2]`): The edge with one face.
- `NonManifold`: An edge with more than two faces.
  - `edge` (`[u32; 2]`): The edge with more than two faces.
  - `use_count` (`u32`): Its face count on an edge between vertex indices, its loop-edge count on an edge between positions.
- `CoLocatedVertices`: Several vertices at exactly one position; reported whatever the checks.
  - `vertices` (`Vec<u32>`): The vertices, ascending.
- `CoLocatedEdges`: Several edges between vertex indices that join the same two positions.
  - `edges` (`Vec<[u32; 2]>`): The edges, in order of first use.
- `InvertedNormal`: The two faces of an edge disagree on their orientation.
  - `edge` (`[u32; 2]`): The edge whose two faces disagree.
- `DegenerateEdge`: An edge whose two ends are at one position.
  - `edge` (`[u32; 2]`): The edge whose two ends are at one position.
- `DegenerateFace`: A face whose outer loop encloses no area, so it has no normal.
  - `face` (`u32`): The face with no area.
- `DegenerateHole`: A hole whose loop encloses no area, so it has no normal.
  - `face` (`u32`): The face that holds the hole.
  - `hole` (`u32`): The hole within the face.
- `CoLocatedFaceVertices`: Two corners of one face at one position, across its outer loop and holes.
  - `face` (`u32`): The face whose two corners meet.
  - `corners` (`[u32; 2]`): The two corners, smaller first.
- `NearVertices`: Two corners of one face at different positions, closer than
  [`MeshChecks::gap_threshold`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks) times the mesh radius.
  - `face` (`u32`): The face whose two corners are close.
  - `corners` (`[u32; 2]`): The two corners, smaller first.
  - `distance` (`f64`): Their distance.
  - `relative_distance` (`f64`): Their distance over the mesh radius.
- `SmallAngle`: The smallest corner angle of a face's outer loop is below
  [`MeshChecks::angle_threshold_degrees`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks). The angle is the one
  between the corner's two edges, from 0 to 180 degrees.
  - `face` (`u32`): The face with the small angle.
  - `degrees` (`f64`): That angle, in degrees.
- `NonPlanar`: A corner of a face lies farther from its outer loop's plane than
  [`MeshChecks::planar_threshold`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks) times the face radius.
  - `face` (`u32`): The face that is not flat.
  - `relative_deviation` (`f64`): The largest distance of a corner from the plane, over the face radius.
- `NonConvex`: The outer loop of a face has a reflex corner; only with [`MeshChecks::convex`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks).
  - `face` (`u32`): The face with the reflex corner.
  - `interior_angle_degrees` (`f64`): The interior angle of its most reflex corner, in degrees, above 180.
- `MultipleWinding`: The turns of a face's outer loop do not add up to one turn, within a quarter turn; reported whatever
  [`MeshChecks::convex`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks) says.
  - `face` (`u32`): The face whose outer loop turns more than once.
- `SameUv`: Two corners of a face at different places with identical coordinates in a UV set; only with
  [`MeshChecks::same_uv`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks). The two corners then drop out of the
  [`InconsistentUv`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue-inconsistentuv) check of that set.
  - `face` (`u32`): The face whose two corners share their UV coordinates.
  - `corners` (`[u32; 2]`): The two corners, smaller first.
  - `uv_set` (`u32`): The UV set, 0 or 1.
- `InconsistentUv`: A corner lies farther than [`MeshChecks::uv_threshold`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks) times the face radius
  from where the UV map of its face puts it. The map is the affine one that fits the face's best-shaped triple of
  outer corners; only a face within the planar threshold, with a hole or more than three outer corners, is
  checked.
  - `face` (`u32`): The face whose UV map misplaces a corner.
  - `corner` (`u32`): The misplaced corner, within the face.
  - `uv_set` (`u32`): The UV set, 0 or 1.
  - `relative_distance` (`f64`): The distance between the corner and where the map puts it, over the face radius.
- `FaceHasHoles`: A face with holes; reported for every such face, whatever the checks.
  - `face` (`u32`): The face with holes.
  - `hole_count` (`u32`): Its number of holes.
- `SelfIntersection`: An edge crosses a face it does not touch. With
  [`SelfIntersectionCheck::PerIsland`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#selfintersectioncheck-perisland), only an edge and a face of one
  island are reported.
  - `face` (`u32`): The crossed face.
  - `edge` (`[u32; 2]`): The crossing edge.
- `InwardIslandIntersects`: From the inward-normal and nesting stage: an island with inward face normals intersects another island. The
  stage reports nothing else then.
  - `island` (`u32`): The inward island.
- `NestedIslands`: From the inward-normal and nesting stage: an island lies inside an island of the same orientation, its
  innermost container.
  - `island` (`u32`): The contained island.
  - `container` (`u32`): Its innermost container.
  - `inward` (`bool`): Whether both have inward face normals.
- `InwardNormals`: From the inward-normal and nesting stage: islands with inward face normals that no island contains.
  - `uncontained` (`Vec<u32>`): Those islands, ascending.
  - `island_count` (`u32`): The number of islands of the surface.

**Implements** `Clone` · `Debug` · `PartialEq` · `Send` · `Sync`

**See also** [Guide: Check a mesh before you use it](https://help.tangerina.io/deformable/v0.5.0/user-guides/rust/tools/#check-a-mesh-before-you-use-it) · [C `DeformableMeshIssue`](https://help.tangerina.io/deformable/v0.5.0/api-references/c/mesh-checks/#deformablemeshissue) · [Python `MeshIssue`](https://help.tangerina.io/deformable/v0.5.0/api-references/python/mesh-checks/#meshissue)

## verify_surface

**Function** · `deformable::tools::verify_surface`

```rust
pub fn verify_surface(
    mesh: &SurfaceMesh,
    holes: &[FaceHole],
    checks: &MeshChecks,
) -> Result<Vec<MeshIssue>, Error>
```

Checks the polygon mesh of a surface mesh for problems before you use it, such as a cage before
[`triangulate`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/tools/#triangulate), and returns one [`MeshIssue`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue) per problem found.

The checks read the positions, the polygons, the holes and the first two UV sets of `mesh`, not its normals or
colours. Malformed input is an error, not an issue. With [`MeshChecks::closed_boundary`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks), a last stage looks for
islands with inward face normals and for islands nested inside an island of the same orientation; it runs only
when every check before it passed. Its containment rays come from a stream with a fixed seed, so equal calls give
equal results.

**Parameters**

- `mesh` ([`&SurfaceMesh`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/meshes/#surfacemesh)): The surface mesh to check.
- `holes` ([`&[FaceHole]`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/meshes/#facehole)): The runs of polygon corners that form hole loops; empty when no polygon has a hole.
- `checks` ([`&MeshChecks`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshchecks)): Which checks run, and their thresholds.

**Returns**

[`Vec<MeshIssue>`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/mesh-checks/#meshissue): The issues in check order; an empty list means the mesh passes.

**Errors**

- [`IndexOutOfRange`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-indexoutofrange): A corner names a vertex past the end of the positions, a polygon has no
  corners, a hole names a polygon past the last, or a polygon's hole runs do not cover the corners after its
  outer loop end to end. Each run needs at least one corner, and so does the outer loop.
- [`LengthMismatch`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-lengthmismatch): The polygon sizes do not add up to the number of corners, or a UV set does not
  have one coordinate pair per corner.
- [`NonFiniteValue`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-nonfinitevalue): A position or a UV of the first two sets is NaN or infinite, or so is
  `angle_threshold_degrees`, `gap_threshold`, `planar_threshold` or a `uv_threshold` that is not `None`.
- [`Unrecognized`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-unrecognized): The library reports an issue kind this crate does not know, which only a newer
  library does; the checks have run.

**Example**

```rust
// The unit cube without its last face.
let mut open_box = polygons;
open_box.polygon_sizes.pop();
open_box.polygon_vertices.truncate(20);
let surface = SurfaceMesh { mesh: open_box, ..SurfaceMesh::default() };
let checks = MeshChecks {
    closed_boundary: true,
    ..MeshChecks::default()
};
let issues = verify_surface(&surface, &[], &checks)?;
assert_eq!(issues[0], MeshIssue::NonClosedBoundary { edge: [1, 3] });
```

**See also** [Guide: Check a mesh before you use it](https://help.tangerina.io/deformable/v0.5.0/user-guides/rust/tools/#check-a-mesh-before-you-use-it) · [C `deformable_verify_surface`](https://help.tangerina.io/deformable/v0.5.0/api-references/c/mesh-checks/#deformable_verify_surface) · [Python `verify_surface`](https://help.tangerina.io/deformable/v0.5.0/api-references/python/mesh-checks/#verify_surface)

## meshes_intersect

**Function** · `deformable::tools::meshes_intersect`

```rust
pub fn meshes_intersect(
    first: &TetrahedralMesh,
    second: &TetrahedralMesh,
) -> Result<bool, Error>
```

Whether two tetrahedral meshes in world space overlap, to find objects that start inside each other: true when a
tetrahedron of `first` and one of `second` have bounding boxes that meet and an overlap volume above 1e-10 with a
nonzero normal.

The normal of a pair is the summed area of the second tetrahedron's faces clipped to the first. It vanishes, and the
pair does not count, when either tetrahedron lies inside the other, the two coincide, or their overlap is symmetric
about its centre, as some partial overlaps are: two identical meshes do not intersect, and faces on each other's
planes can make the answer depend on the argument order. The clipping tolerance, 1e-12 times the longest edge, also
comes from the first tetrahedron alone.

**Parameters**

- `first` ([`&TetrahedralMesh`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/meshes/#tetrahedralmesh)): One mesh, in world space.
- `second` ([`&TetrahedralMesh`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/meshes/#tetrahedralmesh)): The other mesh, in world space.

**Errors**

- [`EmptyMesh`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-emptymesh): `first` or `second` has no tetrahedrons.
- [`IndexOutOfRange`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-indexoutofrange): A tetrahedron names a node past the end of
  its mesh's positions.
- [`NonFiniteValue`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-nonfinitevalue): A position is NaN or infinite.

**Example**

```rust
// A copy of mesh moved half a unit along x overlaps it.
let mut moved = mesh.clone();
for position in &mut moved.positions {
    position.x += 0.5;
}
assert!(meshes_intersect(&mesh, &moved)?);
```

**See also** [Guide: Find objects that start inside each other](https://help.tangerina.io/deformable/v0.5.0/user-guides/rust/tools/#find-objects-that-start-inside-each-other) · [C `deformable_meshes_intersect`](https://help.tangerina.io/deformable/v0.5.0/api-references/c/mesh-checks/#deformable_meshes_intersect) · [Python `meshes_intersect`](https://help.tangerina.io/deformable/v0.5.0/api-references/python/mesh-checks/#meshes_intersect)

## DegenerateKind

**Enum** · `deformable::mesh::DegenerateKind`

```rust
pub enum DegenerateKind {
    TooSmall,
    Flat,
    Inverted,
}
```

How a tetrahedron fails the quality check of
[`Scene::add_object`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/scene/#scene-add_object), which needs its orientation determinant
above 1e-9; [`ErrorKind::DegenerateTetrahedron`](https://help.tangerina.io/deformable/v0.5.0/api-references/rust/errors/#errorkind-degeneratetetrahedron) carries it.

The orientation determinant is six times the tetrahedron's signed volume: positive when its corners are ordered
left-handed, as every mesh of this crate orders them, and negative when they are ordered right-handed. A kind
prints as `too small`, `flat` or `inverted`.

**Values**

- `TooSmall`: The determinant is above 1e-15 but at most 1e-9, or NaN: the tetrahedron is positively oriented but too small.
  Remesh it.
- `Flat`: The determinant lies between -1e-15 and 1e-15: the corners lie in one plane, or nearly. Remesh it.
- `Inverted`: The determinant is below -1e-15: the corners are ordered right-handed. Swap two of them.

**Implements** `Clone` · `Copy` · `Debug` · `Display` · `Eq` · `Hash` · `PartialEq` · `Send` · `Sync`

**See also** [Guide: The error type](https://help.tangerina.io/deformable/v0.5.0/user-guides/rust/errors/#the-error-type)

### DegenerateKind::classify

**Associated function** · `deformable::mesh::DegenerateKind::classify`

```rust
pub fn classify(orientation_determinant: f64) -> Option<Self>
```

The failure an orientation determinant gives, or `None` when it is above 1e-9 and the tetrahedron passes.

**Parameters**

- `orientation_determinant` (`f64`): Six times the signed volume of a tetrahedron, positive when its corners are
  ordered left-handed.
