Used for generating a projected silhouette of a geometry using the clipper2-js project. Performing these operations can be extremely slow with more complex geometry and not always yield a stable result.
Properties
iterationTime: number
How long to spend trimming edges before yielding.
doubleSided: boolean
If false then only the triangles facing upwards are included in the silhouette.
sortTriangles: boolean
Whether to sort triangles and project them large-to-small. In some cases this can cause the performance to drop since the union operation is best performed with smooth, simple edge shapes.
output: number
Whether to output mesh geometry, line segments geometry, or both in an array
( [ mesh, line segments ] ).
Methods
async generateAsync(
geometry: BufferGeometry,
options?: {
onProgress?: ( percent: number ) => void,
signal?: AbortSignal
}
): BufferGeometry | Array<BufferGeometry>Generate the silhouette geometry with a promise-style API.
generate(
geometry: BufferGeometry,
options?: {
onProgress?: ( percent: number ) => void
}
): BufferGeometry | Array<BufferGeometry>Generate the geometry using a generator function.