UNPKG

@2112-lab/pathfinder

Version:

A lightweight 3D pathfinding library for finding orthogonal paths between objects in 3D space

71 lines (58 loc) 1.58 kB
# @2112-lab/pathfinder A lightweight JavaScript library for finding orthogonal paths between objects in 3D space. ## Installation ```bash npm install @2112-lab/pathfinder ``` ## Usage ```javascript import { Pathfinder } from '@2112-lab/pathfinder'; const config = { scene: { object: { children: [ { uuid: 'object1', name: 'Box1', position: { x: 0, y: 0, z: 0 }, geometry: { uuid: 'geometry1', width: 1, height: 1, depth: 1 } }, { uuid: 'object2', name: 'Box2', position: { x: 5, y: 0, z: 5 }, geometry: { uuid: 'geometry2', width: 1, height: 1, depth: 1 } } ] } }, connections: [ { from: 'object1', to: 'object2' } ] }; const pathfinding = new Pathfinder(config); const paths = pathfinding.findPaths(); ``` ## Features - Finds orthogonal paths between objects in 3D space - Avoids obstacles and other objects - Uses A* pathfinding algorithm - Configurable grid size and safety margins - Framework-agnostic (no dependencies) ## API Documentation For detailed API documentation, see [API.md](docs/API.md). ## License MIT