1.0.15 • Published 6 months ago

@2112-lab/pathfinder v1.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@2112-lab/pathfinder

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

Installation

npm install @2112-lab/pathfinder

Usage

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.

License

MIT

1.0.15

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago