Skip to main content

EdgeProjector

Component that generates 2D edge projections from fragment model items.

Extends​

Implements​

Properties​

cullerPixelsPerMeter​

cullerPixelsPerMeter: number = 0.05

Size of one visibility-culling pixel, in meters (despite the name, the value is meters per pixel). LOWER values mean finer culling — fewer small meshes are discarded — at the cost of a larger render target, more tiles and more readback time. Higher values are coarser and faster. Default is 0.05 (one culling pixel covers 5 cm).

Note: meshes without a single visible pixel are removed from BOTH the visible and the hidden line sets, so this value bounds how much small geometry a projection loses.


farPlane​

farPlane: number = Infinity

Far clipping plane along the projection direction. Meshes whose AABB is fully "beyond" this plane (farther from the viewer) are excluded. Set to Infinity to disable.


generator​

readonly generator: any

The underlying ProjectionGenerator from three-edge-projection. You can configure angleThreshold, iterationTime, includeIntersectionEdges, and useWebGPU.


nearPlane​

nearPlane: number = -Infinity

Near clipping plane along the projection direction. Meshes whose AABB is fully "behind" this plane (closer to the viewer) are excluded. Set to -Infinity to disable.


projectionDirection​

readonly projectionDirection: Vector3

The direction the projector looks along. Meshes are projected onto the plane perpendicular to this direction. Default is top-down (plan view).

Common values:

  • Top/Plan: (0, -1, 0)
  • Front: (0, 0, -1)
  • Back: (0, 0, 1)
  • Left: (-1, 0, 0)
  • Right: (1, 0, 0)

Accessors​

cullerMetersPerPixel​

get cullerMetersPerPixel(): number

Alias of EdgeProjector.cullerPixelsPerMeter under a name that matches what the value actually is. Reads and writes the same setting.

Returns​

number

Methods​

get()​

get(modelIdMap, world, config?): Promise <EdgeProjectionResult>

Generates 2D edge projections for the given model items.

Parameters​

ParameterTypeDescription
modelIdMapModelIdMapA map of model IDs to sets of local IDs specifying items to project.
worldWorldThe world whose renderer will be used for visibility culling.
config?objectOptional configuration.
config.onProgress?(message, progress?) => voidOptional progress callback receiving (message, progress?, collector?).
config.signal?AbortSignalOptional AbortSignal. The generator pumps itself on
requestAnimationFrame and checks it on every frame, so aborting rejects the
returned promise and stops the pump instead of draining the whole task.

Returns​

Promise <EdgeProjectionResult>

Visible/hidden geometries with a group vertex attribute, and a groups mapping.


isConfigurable()​

isConfigurable(): this is Configurable<any, any>

Whether is component is Configurable.

Returns​

this is Configurable<any, any>

Inherited from​

Component . isConfigurable


isDisposeable()​

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns​

this is Disposable

Inherited from​

Component . isDisposeable


isHideable()​

isHideable(): this is Hideable

Whether is component is Hideable.

Returns​

this is Hideable

Inherited from​

Component . isHideable


isResizeable()​

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns​

this is Resizeable

Inherited from​

Component . isResizeable


isSerializable()​

isSerializable(): this is Serializable<any, Record<string, any>>

Whether is component is Serializable.

Returns​

this is Serializable<any, Record<string, any>>

Inherited from​

Component . isSerializable


isUpdateable()​

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns​

this is Updateable

Inherited from​

Component . isUpdateable