brepjs API Reference
    Preparing search index...

    Function checkAllInterferences

    • Check all pairs in an array of shapes for interference.

      Returns only pairs that have interference (distance within tolerance). For N shapes, checks N*(N-1)/2 unique pairs.

      Parameters

      • shapes: readonly AnyShape[]

        Array of shapes to test pairwise.

      • tolerance: number = 1e-6

        Distance threshold for interference. Default: 1e-6.

      Returns InterferencePair[]

      Array of InterferencePair entries, one per colliding pair.

      const collisions = checkAllInterferences([box, sphere, cylinder]);
      collisions.forEach(({ i, j }) => console.log(`Shape ${i} hits shape ${j}`));