ldr-stepper

0.1.3 • Public • Published

ldr-stepper Build Status

Break an LDraw (LDR) file into steps

This tool can help you create a base from which to work from when building instructions from an LDraw .ldr file.

It works by sorting on the coordinate of each piece (x, y, or z-axis), then inserts "steps" as you specify. Using the default axis, y, will result in steps which start at the "bottom" of the model, continuing to the "top". Likewise, you can change the dimension to x to start at the "top" and work your way down, or start at the "back" and work towards the "front" with the z-axis.

Don't expect the output of this tool to generate proper instructions for you. It just gives you a starting point.

Install

  1. Install NodeJS v0.10 or greater.

  2. Install globally with npm:

$ npm install -g ldr-stepper

Usage

ldr-stepper [options] <file.ldr>
 
Options:
  --version     Show version number                                    [boolean]
  --output, -o  Output file; if unspecified, will output to STDOUT      [string]
  --pieces, -p  Number of pieces per step                          [default: 10]
  --steps, -s   Maximum number of steps.  Overrides --pieces
  --axis, -a    Axis on which to sort pieces
                                         [choices: "x", "y", "z"] [default: "y"]
  --force       Overwrite any file specified by --output        [default: false]
  --help, -h    Show help                                              [boolean]

Notes

  • This tool ignores any data in the .ldr file that isn't a subfile reference (doesn't begin with 1). See the specification for details. This means the output will lose any metadata.
  • Using --steps is somewhat slower that not using --steps.
  • You can conceivably use this tool on a .dat or .mpd file, but I don't know why you'd want to.
  • The tool outputs a file with Windows (\r\n) line endings, as per the specification.
  • This module can also be used programmatically. It exports a function, generateSteps(filepath, opts). For details, see the source.

License

© 2015 Christopher Hiller. Licensed MIT.

Package Sidebar

Install

npm i ldr-stepper

Weekly Downloads

1

Version

0.1.3

License

MIT

Last publish

Collaborators

  • boneskull