@achirita/blox
Version:
A CAD library for building 3D models in the browser.
15 lines (14 loc) • 788 B
TypeScript
import { Solid, Face, Wire, Edge } from '../modeling';
/**
* Triangulates an entity (Solid, Face, Wire, or Edge) into a three.js compatible mesh.
* @param {Object} parameters - Triangulation parameters.
* @param {Solid|Face|Wire|Edge} parameters.entity - The entity to triangulate.
* @param {number} [parameters.linearTolerance=0.1] - The linear tolerance for triangulation (default is 0.1).
* @param {number} [parameters.angularTolerance=0.1] - The angular tolerance for triangulation (default is 0.1).
* @returns {Object} An object containing positions, normals, and indexes for the mesh.
*/
export function triangulate({ entity, linearTolerance, angularTolerance }: {
entity: Solid | Face | Wire | Edge;
linearTolerance?: number;
angularTolerance?: number;
}): any;