Class CSGPool

A pool of workers to use for CSG operation with Manifold.

Hierarchy

  • CSGPool

Constructors

  • Create a new pool of workers. Workers will only be initialized on the first CSG operation, or after calling and waiting for initialize.

    Parameters

    • workerCount: null | number = null

      The wanted amount of workers. Note that this is a target, not a requirement. If all but one worker fails to be created, no error will be thrown.

    • workerPath: string = 'gypsum-manifold.worker.min.js'

      The path to the Gypsum<->Manifold worker script. Points to "gypsum-manifold.worker.min.js" by default.

    • manifoldPath: string = 'manifold.js'

      The path to the Manifold WASM bindings library. Points to "manifold.js" by default.

    Returns CSGPool

Properties

disposed: boolean = false
initLock: null | CallableFunction[] = null
jobs: Map<number, JobTuple> = ...
manifoldPath: string
nextJobID: number = 0
wantedWorkerCount: number
workerPath: string
workers: null | WorkerArray = null

Methods

  • Dispatch a tree of CSG operations to the best worker; first worker with the least amount of running jobs.

    Parameters

    Returns Promise<JobResult>

  • Destroys all resources associated with this pool. All jobs assigned to this pool are rejected, and all workers assigned to this pool are terminated. Does nothing if the pool is already disposed.

    Returns void

  • Returns [bestWorkerIdx: number, bestWorker: WorkerTuple]

  • Initialize all the workers in this pool. Note that calling this is not neccessary, but is recommended to avoid stuttering, as this is called automatically on the first CSG operation.

    Returns Promise<void>

  • Parameters

    • displayID: number

    Returns Promise<void>

Generated using TypeDoc