Skip to content

spirometaxas/v-tree-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v-tree-cli

Print the V-Tree Fractal to the console!

What sierpinski-triangle-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 v-tree-cli <n>
$ npx v-tree-cli <n> [size] [options]

where n >= 0 and size >= n (if provided).

Via Global Install

$ npm install --global v-tree-cli
$ v-tree-cli <n>
$ v-tree-cli <n> [size] [options]

where n >= 0 and size >= n (if provided).

Via Import

$ npm install v-tree-cli

then:

const v_tree = require('v-tree-cli');
console.log(v_tree.create(<n>);
console.log(v_tree.create(<n>, { 
    size: <number>, 
    rotate: <left|right|flip|standard>,
    line: <bold|double|standard> 
}));

The config params are optional.

Options

Recursive Step

$ v-tree-cli <n>

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

Examples:

$ v-tree-cli 3

What v-tree-cli prints to the console

$ v-tree-cli 4

What v-tree-cli prints to the console

Size

$ v-tree-cli <n> [size]

The optional [size] param allows the V-Tree to be drawn at larger sizes. [size] should be an integer greater than or equal to <n>. Including size will draw a V-Tree of <n> recursive steps the size of a triangle with [size] recursive steps.

Example:

$ v-tree-cli 2 4

What v-tree-cli prints to the console

Rotation

$ v-tree-cli <n> --rotate=<left|right|standard>

The optional --rotate param rotates the V-Tree. Supported values:

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

Example:

$ v-tree-cli 4 --rotate=right

What v-tree-cli prints to the console

$ v-tree-cli 4 --rotate=flip

What v-tree-cli prints to the console

$ v-tree-cli 4 --rotate=left

What v-tree-cli prints to the console

Line Type

$ v-tree-cli <n> --line=<bold|double|standard>

The optional --line param draws the V-Tree using different line types. Supported values:

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

Examples:

$ v-tree-cli 4 --line=bold

What v-tree-cli prints to the console

$ v-tree-cli 4 --line=double

What v-tree-cli prints to the console

Related

Main Project

Fractal Shapes

Fractal Patterns

Space Filling Curves

License

About

Print the V-Tree Fractal to the console!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published