# MeshVisibilityCuller

class in `three-edge-projection`

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

Utility for determining visible geometry from a top down orthographic perspective. This can
be run before performing projection generation to reduce the complexity of the operation at
the cost of potentially missing small details.

Constructor for the visibility culler that takes the renderer to use for culling.

Example: Projecting only the meshes visible from above

```js
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { MeshVisibilityCuller, ProjectionGenerator } from 'three-edge-projection';

const URL = 'https://example.com/building.glb';
const { scene: model } = await new GLTFLoader().loadAsync( URL );

const visibleMeshes = await new MeshVisibilityCuller( renderer, { pixelsPerMeter: 0.01 } ).cull( model );

const task = new ProjectionGenerator().generate( visibleMeshes );
let step = task.next();
while ( ! step.done ) step = task.next();
```

## Constructor

```js
new MeshVisibilityCuller( renderer: WebGLRenderer, options?: Object )
```

- `renderer`, `WebGLRenderer`
- `options`, `Object`, optional
  - `pixelsPerMeter`, `number`, optional, default `0.1`

## Properties

### .pixelsPerMeter: number

The size of a pixel on a single dimension. If this results in a texture larger than what
the graphics context can provide then the rendering is tiled.

## Methods

### .cull

```js
async .cull( object: Object3D | Array<Object3D> ): Promise<Array<Object3D>>
```

Returns the set of meshes that are visible within the given object.

- `object`, `Object3D | Array<Object3D>`
