1.2.0 • Published 1 year ago

peano-curve-cli v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

peano-curve-cli

Print the Peano Curve to the console!

What peano-curve-cli prints to the console

npm version bundle size downloads license

Why the console? Because it's the cool way.

See All Fractals in the fractals-cli project.

Usage

Via npx:

$ npx peano-curve-cli <n>
$ npx peano-curve-cli <n> [options]

where n >= 1.

Via Global Install

$ npm install --global peano-curve-cli
$ peano-curve-cli <n>
$ peano-curve-cli <n> [options]

where n >= 1.

Via Import

$ npm install peano-curve-cli

then:

const peano_curve = require('peano-curve-cli');
console.log(peano_curve.create(<n>);
console.log(peano_curve.create(<n>, { 
    inverse: <boolean>,
    rotation: <left|right|flip|standard>,
    line: <bold|double|standard> 
});

The config params are optional.

Options

Recursive Step

$ peano-curve-cli <n>

The first param <n> is the recursive step. <n> should be an integer greater than or equal to 1.

Examples:

$ peano-curve-cli 2

What peano-curve-cli prints to the console

$ peano-curve-cli 3

What peano-curve-cli prints to the console

Inverse

$ peano-curve-cli <n> --inverse

The optional --inverse param (or shorthand -i) will draw the inverse Peano Curve.

Example:

$ peano-curve-cli 3 --inverse

What peano-curve-cli prints to the console

Rotation

$ peano-curve-cli <n> --rotate=<left|right|flip|standard>

The optional --rotate param rotates the Peano Curve. Supported values:

  • left: Rotate left 90 degrees
  • right: Rotate right 90 degrees
  • flip: Rotate 180 degrees
  • standard: No rotation (default)

Example:

$ peano-curve-cli 3 --rotate=left

What peano-curve-cli prints to the console

Note: left and right rotations look identical. flip and standard rotations also look identical.

Line Type

$ peano-curve-cli <n> --line=<bold|double|standard>

The optional --line param draws the Peano Curve using different line types. Supported values:

  • bold: Draw using bold lines
  • double: Draw using double lines
  • standard: Draw using standard lines (default)

Examples:

$ peano-curve-cli 3 --line=bold

What peano-curve-cli prints to the console

$ peano-curve-cli 3 --line=double

What peano-curve-cli prints to the console

Related

Main Project

Fractal Shapes

Fractal Patterns

Space Filling Curves

License