# SilhouetteGenerator

class in `three-edge-projection`

```js
import { SilhouetteGenerator } from 'three-edge-projection';
```

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

### .generateAsync

```js
async .generateAsync( geometry: BufferGeometry, options?: Object ): BufferGeometry | Array<BufferGeometry>
```

Generate the silhouette geometry with a promise-style API.

- `geometry`, `BufferGeometry`
- `options`, `Object`, optional
  - `onProgress`, `SilhouetteProgressCallback`, optional
  - `signal`, `AbortSignal`, optional

### .generate

```js
.generate( geometry: BufferGeometry, options?: Object ): BufferGeometry | Array<BufferGeometry>
```

Generate the geometry using a generator function.

- `geometry`, `BufferGeometry`
- `options`, `Object`, optional
  - `onProgress`, `SilhouetteProgressCallback`, optional
