1.0.12 • Published 10 months ago

@2112-lab/3d-pathfinding v1.0.12

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

@2112-lab/3d-pathfinding

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

Installation

npm install @2112-lab/3d-pathfinding

Usage

import { Pathfinding } from '@2112-lab/3d-pathfinding';

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 Pathfinding(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.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago