React Three Map - v1.0.9
    Preparing search index...
    • Tests whether a 3D point is on the surface of a polyhedron (within a tolerance).

      Parameters

      • point: Vector3Tuple

        The 3D point to test as a Vector3Tuple [x, y, z]

      • geometry: BufferGeometry

        The BufferGeometry representing the polyhedron

      • tolerance: number = 0.001

        Distance tolerance in the same units as the geometry (default: 0.001)

      Returns boolean

      true if the point is within tolerance of any surface

      Error if BufferGeometry has no position attribute

      import { isPointOnSurface } from '@wendylabsinc/react-three-map/maplibre';
      import { BoxGeometry } from 'three';

      const box = new BoxGeometry(100, 100, 100);
      isPointOnSurface([50, 0, 0], box, 0.1); // true - on surface
      isPointOnSurface([0, 0, 0], box, 0.1); // false - at center