Routines for fast, geometrically robust clipping operations and analytic volume/moment computations over polytopes in 2D and 3D (as well as experimental ND). This software forms the kernel for an exact general remeshing scheme. Also includes physically conservative voxelization (volume sampling) of polytopes to a Cartesian grid in 2D and 3D.
As described in
Powell & Abel (2015) and
LA-UR-15-26964. For information about the API itself, see
LA-UR-15-26964. The now-deprecated version of the code used for
Powell & Abel (2015)
Robustly clip polytopes against planes.
Compute volumes and moments over polytopes using the optimal recursive method of Koehl (2012).
Voxelize 2D and 3D polytopes onto a Cartesian grid by calculating the exact coordinate moments of the intersections between the polytope and each underlying grid cell.
Utility functions for orientation tests, box initialization, conversion between polyhedral representations, and more.
A set of rigorous unit-tests, located in
tests. These tests also serve as examples of how to use
All declarations and documentation are located in
- To build, type
- To compile into your code,
#include <v2d.h> as you require.
- To link,
rNd.h, and contents of
Copyright (C) 2015, DOE and Los Alamos National Security, LLC.
v2d.h, and contents of
deprecated Copyright (C) 2015, Stanford University,
through SLAC National Accelerator Laboratory.
See source file headers for full license text. All code is open-source, subject to terms of the respective license. We request that you cite Powell & Abel (2015) and LA-UR-15-26964 when using this code for research purposes.