Tests whether a 3D point is on the surface of a polyhedron (within a tolerance).
The 3D point to test as a Vector3Tuple [x, y, z]
The BufferGeometry representing the polyhedron
Distance tolerance in the same units as the geometry (default: 0.001)
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 surfaceisPointOnSurface([0, 0, 0], box, 0.1); // false - at center Copy
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 surfaceisPointOnSurface([0, 0, 0], box, 0.1); // false - at center
Tests whether a 3D point is on the surface of a polyhedron (within a tolerance).