@twinfinity/core
    Preparing search index...

    Interface SnapProvider

    Supplies the host/core-specific primitives the state machine needs for snapping. The orchestration (edge caching, combining with clip edges, running the snap algorithm) stays generic in the state machine; the consumer's adapter implements only the parts that require the concrete product/scene model.

    interface SnapProvider {
        getEdges(product: object): Segment3[];
        getSnapDistance(position: Vec3): number;
        loadEdges(product: object): Promise<Segment3[]>;
        resolveProduct(pick: unknown): undefined | object;
    }
    Index

    Methods

    • The product's snap edges in world space. May be empty if geometry isn't loaded yet.

      Parameters

      • product: object

      Returns Segment3[]

    • World-space max snap distance for a position (typically derived from camera + config).

      Parameters

      Returns number

    • Warm a product's edges asynchronously; resolves with the loaded edges (empty if none).

      Parameters

      • product: object

      Returns Promise<Segment3[]>

    • Resolve a pick to an opaque product handle, or undefined if it isn't snappable. Also the edge-cache key.

      Parameters

      • pick: unknown

      Returns undefined | object