brepjs API Reference
    Preparing search index...

    Function checkInterference

    • Check for interference (collision/contact) between two shapes.

      Returns detailed proximity information including the minimum distance and closest points. Shapes are considered interfering when their minimum distance is within the given tolerance.

      Parameters

      • shape1: AnyShape

        First shape.

      • shape2: AnyShape

        Second shape.

      • tolerance: number = 1e-6

        Distance threshold below which shapes are considered interfering. Default: 1e-6.

      Returns Result<InterferenceResult>

      A Result wrapping the InterferenceResult.

      const result = unwrap(checkInterference(boxA, boxB));
      if (result.hasInterference) {
      console.log('Collision at distance', result.minDistance);
      }