brepjs API Reference
    Preparing search index...

    Class Evaluator

    Implements

    • Disposable
    Index

    Constructors

    Methods

    • Materialize a CSG IR tree against the given parameter environment. The returned shape is borrowed — callers must NOT call .delete() / [Symbol.dispose]() on it; that would invalidate the cache entry for every future call returning the same handle. By default it stays valid until the Evaluator is disposed; if maxCacheEntries is set, only until the next successful evaluate() call (LRU eviction may free older entries), and evaluate() is then non-reentrant — calling it from an onStep callback throws.

      Parameters

      Returns Result<AnyShape<Dimension>>

    • Materialize a node and mesh it, caching the mesh by the shape's content key plus the mesh parameters. The mesh cache is independent of the shape cache: a hit returns the cached mesh without evaluating or meshing — even after the shape was LRU-evicted (a mesh is plain data, not a kernel handle). The returned mesh is borrowed (do not mutate it); it stays valid for the Evaluator's lifetime, or until maxMeshCacheEntries evicts it.

      Parameters

      • node: IRNode
      • env: Env = {}
      • meshOpts: MeshOptions & { cache?: boolean; includeUVs?: boolean; skipNormals?: boolean } = {}

      Returns Result<ShapeMesh>