You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

rectilinear-router

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

rectilinear-router

Rectilinear router in typescript. This will help you find a rectilinear path between two or more points.


Version published
Maintainers
1
Created

Readme

Source

Rectilinear Router

Rectilinear router in typescript. This will help you find a rectilinear path between two or more points.

A rectilinear path is a path composed of straight lines and 90 degree turns, it is common to route this way for schematics or PCBs.

This uses rtms-ts under the hood for fast computation of the minimal rectilinear steiner tree.

Usage

import findRectilinearRoute from "rectilinear-router"

const route = await findRectilinearRoute({
  // terminals are points that the route must go through
  terminals: [
    [0, 400],
    [0, 200],
    [300, 0],
    [800, 800],
    [600, 1000],
    [500, 500],
    [200, 700],
    [700, 300],
  ],
})

// console.log(route)
;[
  { from: [300, 200], to: [300, 300] },
  { from: [500, 700], to: [500, 800] },
  { from: [600, 800], to: [500, 800] },
  {
    from: [0, 400],
    to: [0, 200],
    fromTerminalIndex: 0,
    toTerminalIndex: 1,
  },
  { from: [300, 0], to: [300, 200], fromTerminalIndex: 2 },
  { from: [800, 800], to: [600, 800], fromTerminalIndex: 3 },
  { from: [600, 1000], to: [600, 800], fromTerminalIndex: 4 },
  { from: [500, 500], to: [500, 300], fromTerminalIndex: 5 },
  { from: [500, 500], to: [500, 700], fromTerminalIndex: 5 },
  { from: [700, 300], to: [500, 300], fromTerminalIndex: 7 },
  { from: [500, 300], to: [300, 300] },
  { from: [0, 200], to: [300, 200], fromTerminalIndex: 1 },
  { from: [200, 700], to: [500, 700], fromTerminalIndex: 6 },
]

example route

FAQs

Package last updated on 21 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc