TETRAHEDRON_GRID is a MATLAB library which generates a grid of points inside a 3D tetrahedron.
Starting with any 4 points A, B, C and D that define a tetrahedron, we can divide each edge of the tetrahedron into N subintervals, and create a tetrahedral grid. This defines ((N+1)*(N+2)*(N+3))/6 points that lie on the intersections of grid lines.
The library includes a routine which allows the user to pick an arbitrary tetrahedron and an arbitrary number of subdivisions. It then returns the tetrahedral gridpoints defined by that choice.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
TETRAHEDRON_GRID is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.
BALL_GRID, a MATLAB library which computes grid points that lie inside a 3D ball.
CIRCLE_ARC_GRID, a MATLAB program which computes points equally spaced along a circular arc;
CIRCLE_GRID, a MATLAB library which computes grid points that lie inside a circle.
ELLIPSE_GRID, a MATLAB library which computes grid points that lie inside an ellipse.
ELLIPSOID_GRID, a MATLAB library which computes grid points that lie inside a 3D ellipsoid.
TRIANGLE_GRID, a MATLAB library which computes a triangular grid of points.
You can go up one level to the MATLAB source codes.