A small utility module — not a standalone binary — providing geometric measurement (length, area, volume) for MOAB entity types. Used internally by other tools in this directory (mbsize, etc.) and available for embedding in client code.
measure.hpp — public APImeasure.cpp — implementationReturns the Euclidean distance between two 3-D points. The two arguments must each point to three contiguous doubles holding {x, y, z}.
Returns the geometric measure (length, area, or volume) of a single entity of the given moab::EntityType. coords is the flat XYZ coordinate array for the entity's vertices, in canonical MOAB ordering (3 × num_vertices doubles).
The function returns 0.0 for entity types it does not handle.
| Entity type | Measure | Formula |
|---|---|---|
MBEDGE | length | \|p1 − p0\| |
MBTRI | area | ½ \|(p1−p0) × (p2−p0)\| |
MBQUAD | area | Fan-triangulation around centroid (4 vertices) |
MBPOLYGON | area | Fan-triangulation around centroid (num_vertices corners) |
MBTET | volume | ⅙ ((p1−p0) × (p2−p0)) · (p3−p0) |
MBPYRAMID | volume | Two-tet decomposition through apex (vertex 4) |
MBPRISM | volume | Three-tet decomposition |
MBHEX | volume | Five-tet decomposition (canonical hex split) |
| anything else | — | returns 0.0 |
moab::IntxMesh::IntxUtils for that.Original code copyright Lawrence Livermore National Laboratory (LLNS contract B545069 with UW–Madison). BSD-2-Clause; see source header for the full notice.