React Three Map - v1.0.9
    Preparing search index...
    • Extracts triangular faces from a BufferGeometry as geographic coordinates.

      Parameters

      • geometry: BufferGeometry

        The Three.js BufferGeometry to extract faces from

      • origin: Coords

        The geographic origin for coordinate conversion

      Returns GeoTriangle[]

      An array of GeoTriangle objects representing the polyhedral surface

      Error if BufferGeometry has no position attribute

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

      const geometry = new BoxGeometry(100, 100, 100);
      const origin = { latitude: 51.5074, longitude: -0.1278, altitude: 0 };
      const triangles = extractGeoTriangles(geometry, origin);