brepjs API Reference
    Preparing search index...

    Interface KernelTopologyOps

    interface KernelTopologyOps {
        adjacentFaces(shape: any, face: any): any[];
        copyShape(shape: any): any;
        downcast(shape: any, type?: ShapeType): any;
        edgeToFaceMap(shape: any): string;
        hashCode(shape: any, upperBound: number): number;
        isEqual(a: any, b: any): boolean;
        isNull(shape: any): boolean;
        isSame(a: any, b: any): boolean;
        iterShapeList(list: any, callback: (item: any) => void): void;
        iterShapes(shape: any, type: ShapeType): any[];
        sew(shapes: any[], tolerance?: number): any;
        shapeOrientation(shape: any): ShapeOrientation;
        shapeType(shape: any): ShapeType;
        sharedEdges(faceA: any, faceB: any): any[];
        subShapeCount?(shape: any, type: ShapeType): number;
        subShapeHashes?(
            shape: any,
            type: ShapeType,
            hashUpperBound: number,
        ): number[];
    }
    Index
    • Return an independently-disposable duplicate of a shape.

      downcast is a cast, not a copy: on the occt-wasm arena kernel a same-type downcast returns the very same handle id, so disposing the "copy" would free the source. copyShape guarantees a handle that can be disposed without affecting the source — a real geometric copy where a primitive exists (occt-wasm k.copy, brepkit copySolid for solids), a new wrapper over the same id where nothing changes that shape in place (other brepkit shapes), or the safe existing duplicate on kernels that never free handles individually (manifold) or share refcounted geometry (occt Embind).

      Parameters

      • shape: any

      Returns any

    • Compute a hash code for a shape (used for face tracking).

      Parameters

      • shape: any
      • upperBound: number

      Returns number

    • Test if two shapes are geometrically equal (same location + orientation).

      Parameters

      • a: any
      • b: any

      Returns boolean

    • Iterate a TopTools_ListOfShape, calling a callback for each item.

      Parameters

      • list: any
      • callback: (item: any) => void

      Returns void

    • Sew shapes together at shared edges.

      Parameters

      • shapes: any[]
      • Optionaltolerance: number

      Returns any

    • Count sub-shapes of a type without allocating a handle per sub-shape. Optional native fast path (occt-wasm >= 3.7.0); absent kernels fall back to iterating handles. See the topology-layer subShapeCount wrapper.

      Parameters

      Returns number

    • Deduplicated sub-shape hashes at hashUpperBound, with no per-sub-shape handle allocation. Hashes agree with hashCode at the same bound. Optional native fast path (occt-wasm >= 3.7.0). See the topology-layer subShapeHashes wrapper.

      Parameters

      • shape: any
      • type: ShapeType
      • hashUpperBound: number

      Returns number[]