primitive-geometry
Version:
Geometries for 3D rendering, including normals, UVs and cell indices (faces). Perfect if you want to supercharge your dependency folder... with 30KB of geometries.
32 lines (26 loc) • 607 B
JavaScript
/** @module tetrahedron */
import cylinder from "./cylinder.js";
import { checkArguments } from "./utils.js";
/**
* @typedef {object} TetrahedronOptions
* @property {number} [radius=0.5]
*/
/**
* @alias module:tetrahedron
* @param {TetrahedronOptions} [options={}]
* @returns {import("../types.js").SimplicialComplex}
*/
function tetrahedron({ radius = 0.5 } = {}) {
checkArguments(arguments);
return cylinder({
height: radius * 1.5,
radius,
nx: 3,
ny: 1,
radiusApex: 0,
capSegments: 0,
capApex: false,
capBaseSegments: 1,
});
}
export default tetrahedron;