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 🙏

© 2025 – Pkg Stats / Ryan Hefner

inform-2d

v2.0.0

Published

convert vector paths to MOTOMAN INFORM (.JBI) files

Downloads

13

Readme

inform-2d

convert vector paths to MOTOMAN INFORM (.JBI) files in rectangular coordinates with tool up/down in z

This file format is used on big industrial robot arms, like the one at sudoroom.

Watch the algorithm in action.

online svg to inform converter

example

var inform = require('inform-2d');
var points = require('./points.json');

var src = inform(points, {
    name: 'wow',
    xangle: -168.90,
    yangle: -11.30,
    zangle: -68.01,
    xmin: 900, xmax: 1200,
    ymin: -650, ymax: -350,
    zup: 150.4, zdown: 140.4

});
console.log(src);

For this points.json file as input:

[ [ [ 108.10421752929688, 74.8239974975586 ], [ 95.56915283203125, 94.93888092041016 ], [ 95.31151580810547, 96.2403793334961 ], [ 102.90857696533203, 113.43411254882812 ], [ 104.03355407714844, 114.13746643066406 ], [ 121.85356903076172, 114.98860168457031 ], [ 123.01776885986328, 114.35240936279297 ], [ 137.21041870117188, 92.79154205322266 ], [ 137.24737548828125, 91.46550750732422 ], [ 129.8736572265625, 79.62474060058594 ], [ 128.72239685058594, 78.96514129638672 ], [ 108.10421752929688, 74.8239974975586 ] ], [ [ 276.0107727050781, 81.7242660522461 ], [ 257.1794738769531, 95.9311752319336 ], [ 256.23870849609375, 97.2276611328125 ], [ 253.68801879882812, 116.92826080322266 ], [ 254.5357666015625, 118.2863540649414 ], [ 276.5599365234375, 125.3462905883789 ], [ 278.153564453125, 125.1825942993164 ], [ 300.3292541503906, 113.54671478271484 ], [ 300.6111755371094, 112.25702667236328 ], [ 297.1383972167969, 91.92383575439453 ], [ 296.3144226074219, 90.55220794677734 ], [ 276.0107727050781, 81.72425842285156 ] ], [ [ 98.73597717285156, 162.2274169921875 ], [ 298.413330078125, 168.28604125976562 ], [ 303.9494934082031, 168.68817138671875 ], [ 303.54071044921875, 189.12786865234375 ], [ 302.4870300292969, 194.5781707763672 ], [ 292.7845153808594, 226.38218688964844 ], [ 290.4404296875, 231.41366577148438 ], [ 268.3999328613281, 255.50604248046875 ], [ 263.2607116699219, 257.598876953125 ], [ 176.0184326171875, 273.0849609375 ], [ 170.74020385742188, 271.4090270996094 ], [ 145.1450653076172, 260.71746826171875 ], [ 140.2852783203125, 258.03570556640625 ], [ 123.30693817138672, 243.90589904785156 ], [ 120.06871032714844, 239.40306091308594 ], [ 113.86951446533203, 224.5026397705078 ], [ 115.03231048583984, 219.08340454101562 ], [ 103.79267883300781, 200.3572540283203 ], [ 102.04824829101562, 195.0880126953125 ], [ 98.73596954345703, 162.22743225097656 ] ] ]

the script generates a JBI INFORM file:

/JOB
//NAME WOW
//POS
///NPOS 50,0,0,0
///TOOL 0
///RECTAN
///RCONF 0,0,0,0,0
C000=975.182,-600.551,150.400,-168.90,-11.30,-68.01
C001=975.182,-600.551,140.400,-168.90,-11.30,-68.01
C002=966.465,-587.258,140.400,-168.90,-11.30,-68.01
C003=966.285,-586.398,140.400,-168.90,-11.30,-68.01
C004=971.569,-575.035,140.400,-168.90,-11.30,-68.01
C005=972.351,-574.570,140.400,-168.90,-11.30,-68.01
C006=984.744,-574.007,140.400,-168.90,-11.30,-68.01
C007=985.554,-574.428,140.400,-168.90,-11.30,-68.01
C008=995.424,-588.677,140.400,-168.90,-11.30,-68.01
C009=995.450,-589.553,140.400,-168.90,-11.30,-68.01
C010=990.322,-597.378,140.400,-168.90,-11.30,-68.01
C011=989.521,-597.814,140.400,-168.90,-11.30,-68.01
C012=975.182,-600.551,140.400,-168.90,-11.30,-68.01
C013=975.182,-600.551,150.400,-168.90,-11.30,-68.01
C014=1091.954,-595.991,150.400,-168.90,-11.30,-68.01
C015=1091.954,-595.991,140.400,-168.90,-11.30,-68.01
C016=1078.858,-586.602,140.400,-168.90,-11.30,-68.01
C017=1078.204,-585.745,140.400,-168.90,-11.30,-68.01
C018=1076.430,-572.726,140.400,-168.90,-11.30,-68.01
C019=1077.019,-571.828,140.400,-168.90,-11.30,-68.01
C020=1092.336,-567.162,140.400,-168.90,-11.30,-68.01
C021=1093.445,-567.271,140.400,-168.90,-11.30,-68.01
C022=1108.867,-574.960,140.400,-168.90,-11.30,-68.01
C023=1109.063,-575.813,140.400,-168.90,-11.30,-68.01
C024=1106.648,-589.250,140.400,-168.90,-11.30,-68.01
C025=1106.075,-590.157,140.400,-168.90,-11.30,-68.01
C026=1091.954,-595.991,140.400,-168.90,-11.30,-68.01
C027=1091.954,-595.991,150.400,-168.90,-11.30,-68.01
C028=968.667,-542.789,150.400,-168.90,-11.30,-68.01
C029=968.667,-542.789,140.400,-168.90,-11.30,-68.01
C030=1107.535,-538.785,140.400,-168.90,-11.30,-68.01
C031=1111.385,-538.519,140.400,-168.90,-11.30,-68.01
C032=1111.100,-525.011,140.400,-168.90,-11.30,-68.01
C033=1110.368,-521.409,140.400,-168.90,-11.30,-68.01
C034=1103.620,-500.391,140.400,-168.90,-11.30,-68.01
C035=1101.990,-497.066,140.400,-168.90,-11.30,-68.01
C036=1086.661,-481.144,140.400,-168.90,-11.30,-68.01
C037=1083.087,-479.761,140.400,-168.90,-11.30,-68.01
C038=1022.414,-469.526,140.400,-168.90,-11.30,-68.01
C039=1018.743,-470.634,140.400,-168.90,-11.30,-68.01
C040=1000.943,-477.700,140.400,-168.90,-11.30,-68.01
C041=997.563,-479.472,140.400,-168.90,-11.30,-68.01
C042=985.755,-488.810,140.400,-168.90,-11.30,-68.01
C043=983.503,-491.786,140.400,-168.90,-11.30,-68.01
C044=979.192,-501.633,140.400,-168.90,-11.30,-68.01
C045=980.000,-505.214,140.400,-168.90,-11.30,-68.01
C046=972.184,-517.590,140.400,-168.90,-11.30,-68.01
C047=970.970,-521.072,140.400,-168.90,-11.30,-68.01
C048=968.667,-542.789,140.400,-168.90,-11.30,-68.01
C049=968.667,-542.789,150.400,-168.90,-11.30,-68.01
//INST
///DATE 2014/11/05 13:45
///ATTR 0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0
///FRAME BASE
NOP
*1
MOVL C000 V=200 CONT
PAUSE
MOVL C001 V=50 CONT
MOVL C002 V=50 CONT
MOVL C003 V=50 CONT
MOVL C004 V=50 CONT
MOVL C005 V=50 CONT
MOVL C006 V=50 CONT
MOVL C007 V=50 CONT
MOVL C008 V=50 CONT
MOVL C009 V=50 CONT
MOVL C010 V=50 CONT
MOVL C011 V=50 CONT
MOVL C012 V=50 CONT
MOVL C013 V=200 CONT
MOVL C014 V=200 CONT
MOVL C015 V=50 CONT
MOVL C016 V=50 CONT
MOVL C017 V=50 CONT
MOVL C018 V=50 CONT
MOVL C019 V=50 CONT
MOVL C020 V=50 CONT
MOVL C021 V=50 CONT
MOVL C022 V=50 CONT
MOVL C023 V=50 CONT
MOVL C024 V=50 CONT
MOVL C025 V=50 CONT
MOVL C026 V=50 CONT
MOVL C027 V=200 CONT
MOVL C028 V=200 CONT
MOVL C029 V=50 CONT
MOVL C030 V=50 CONT
MOVL C031 V=50 CONT
MOVL C032 V=50 CONT
MOVL C033 V=50 CONT
MOVL C034 V=50 CONT
MOVL C035 V=50 CONT
MOVL C036 V=50 CONT
MOVL C037 V=50 CONT
MOVL C038 V=50 CONT
MOVL C039 V=50 CONT
MOVL C040 V=50 CONT
MOVL C041 V=50 CONT
MOVL C042 V=50 CONT
MOVL C043 V=50 CONT
MOVL C044 V=50 CONT
MOVL C045 V=50 CONT
MOVL C046 V=50 CONT
MOVL C047 V=50 CONT
MOVL C048 V=50 CONT
MOVL C049 V=200 CONT
JUMP *1
END

Make sure you don't accidentally strip the '\r' characters, since MOTOMAN expects '\r\n' separators.

methods

var inform = require('inform-2d')

var src = inform(paths, opts)

Return a JBI file string src that will trace out the vector image described by paths. Each item in paths is an array of points of the form [x,y] that describe a path.

Optionally, configure:

  • opts.name - the name to use, uppercased, truncated to 8 chars
  • opts.xangle - x axis euler angle to hold the tool
  • opts.yangle - y axis euler angle to hold the tool
  • opts.zangle - z axis euler angle to hold the tool
  • opts.zup - z value to hold the tool in the up (not tracing) position
  • opts.zdown - z value to hold the tool in the down (tracing) position
  • opts.vup - velocity to use when z is up (not tracing) in mm/sec
  • opts.vdown - velocity to use when z is down (tracing) in mm/sec
  • opts.xmin, opts.xmax - path x coordinates are scaled to this domain
  • opts.ymin, opts.ymax - path y coordinates are scaled to this domain

install

With npm do:

npm install inform-2d

license

MIT