looks up a cell's height by its integer grid coordinate in O(1) rather than scanning cells on every query
cells
import { buildHeightIndex, heightAt } from '@datamoc/mwg/3d';const heights = buildHeightIndex([ { x: 0, y: 0 }, { x: 1, y: 0, height: 2 },]);console.log(heightAt(heights, 'square', 1.2, 0.1)); // 2 Copy
import { buildHeightIndex, heightAt } from '@datamoc/mwg/3d';const heights = buildHeightIndex([ { x: 0, y: 0 }, { x: 1, y: 0, height: 2 },]);console.log(heightAt(heights, 'square', 1.2, 0.1)); // 2
looks up a cell's height by its integer grid coordinate in O(1) rather than scanning
cellson every query