npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@2112-lab/pathfinder

v1.0.38

Published

Pure JavaScript 3D pathfinding algorithm library for industrial plant pipe routing

Readme

Central Plant Pathfinder

A 3D pathfinding system that finds orthogonal paths between objects in Central Plant scenes.

Directory Structure

pathfinder/
├── src/                    # Core pathfinder library
│   ├── index.js           # Main Pathfinder class  
│   ├── Vector3.js         # 3D vector utilities
│   ├── SceneManager.js    # Scene management
│   ├── GridSystem.js      # Grid-based pathfinding
│   ├── ConnectorManager.js # Connection clustering
│   ├── PathManager.js     # A* pathfinding algorithm
│   └── TreePathManager.js # Tree-based path optimization
├── cli/                   # Command-line interface
│   ├── cli.js            # Main CLI script
│   ├── package.json      # CLI package configuration  
│   ├── README.md         # CLI documentation
│   ├── EXAMPLES.md       # Usage examples
│   ├── SUMMARY.md        # Feature summary
│   ├── test.js           # CLI test suite
│   ├── install.sh        # Installation script
│   ├── test-scene.json   # Example scene file
│   └── test-config.json  # Example configuration
├── package.json          # ES module configuration
├── README.md            # This file - main documentation
└── GATEWAY_DOCUMENTATION.md # API documentation

Quick Start

Using the Core Library

import { Pathfinder } from './src/index.js';

const pathfinder = new Pathfinder({
  grid: {
    size: 0.5,
    safetyMargin: 0,
    minSegmentLength: 0.5,
    timeout: 1000
  }
});

const results = pathfinder.findPaths(scene, connections);

Using the Command-Line Interface

cd cli/
node cli.js --help
node cli.js --input test-scene.json --format summary

Features

  • 3D Pathfinding: Finds orthogonal paths between objects in 3D space
  • Gateway Optimization: Automatically creates gateway points for complex multi-object connections
  • Grid-based Algorithm: Uses A* pathfinding on a configurable 3D grid
  • Obstacle Avoidance: Respects object bounding boxes and safety margins
  • Flexible Configuration: Customizable grid size, timeouts, and path constraints
  • CLI Interface: Command-line tool for automation and batch processing

Input Format

The pathfinder expects scene objects with worldBoundingBox data:

{
  "scene": {
    "children": [
      {
        "uuid": "OBJECT-ID",
        "userData": {
          "worldBoundingBox": {
            "min": [x, y, z],
            "max": [x, y, z]
          }
        }
      }
    ]
  },
  "connections": [
    {"from": "OBJECT-ID-1", "to": "OBJECT-ID-2"}
  ]
}

Output Format

Returns paths, rewired connections, and gateway information:

{
  "paths": [
    {
      "from": "OBJECT-1",
      "to": "OBJECT-2",
      "path": [
        {"x": 0, "y": 0, "z": 0},
        {"x": 1, "y": 0, "z": 0}
      ]
    }
  ],
  "rewiredConnections": [...],
  "gateways": [...]
}

Installation

Core Library Only

The core pathfinder library is ready to use - just import from ./src/index.js.

CLI Tool

cd cli/
./install.sh

For global CLI installation:

cd cli/
npm install -g .

Documentation

  • API Documentation: See GATEWAY_DOCUMENTATION.md
  • CLI Documentation: See cli/README.md
  • Usage Examples: See cli/EXAMPLES.md
  • Feature Summary: See cli/SUMMARY.md

Testing

Core Library

Test the core pathfinder functionality using the CLI:

cd cli/
node cli.js --input test-scene.json --verbose

CLI Tool

Run the comprehensive test suite:

cd cli/
node test.js

Integration

The pathfinder can be used both programmatically and via CLI:

Programmatic Use:

import { Pathfinder } from './src/index.js';
// Use in your application

CLI Use:

node cli/cli.js --input scene.json --output results.json

Batch Processing:

for scene in scenes/*.json; do
    node cli/cli.js --input "$scene" --format summary >> report.txt
done