@kenzotakahashi/autofloor-calc-outline

Calculate the decoration outline of specified line segments

Stats

StarsIssuesVersionUpdatedCreatedSize
@kenzotakahashi/autofloor-calc-outline
001.1.53 years ago3 years agoMinified + gzip package size for @kenzotakahashi/autofloor-calc-outline in KB

Readme

autofloor-calc-outline

Calculate the decoration outline of specified line segments

A related blog post(Japanese) for more information.

Tutorial

npm install -D @kenzotakahashi/autofloor-calc-outline
import {constructWallOutline, constructOutline} from '@kenzotakahashi/autofloor-calc-outline'

const walls = [
      [[1,3],[3.5,3]],
      [[1,3],[1.2,0.8]]
]
const wallOutlines = constructWallOutline(walls)
console.log(wallOutlines)

Output:

[
    {
      "right": [
        [
          0.9167775056994335,
          3.076
        ],
        [
          3.5,
          3.076
        ]
      ],
      "left": [
        [
          1.0832224943005666,
          2.924
        ],
        [
          3.424,
          2.924
        ]
      ],
      "location": [
        [
          1,
          3
        ],
        [
          3.5,
          3
        ]
      ]
    },
    {
      "right": [
        [
          1.0832224943005666,
          2.924
        ],
        [
          1.2694043124823848,
          0.8759999999999981
        ]
      ],
      "left": [
        [
          0.9167775056994335,
          3.076
        ],
        [
          1.130595687517615,
          0.7239999999999998
        ]
      ],
      "location": [
        [
          1,
          3
        ],
        [
          1.2,
          0.8
        ]
      ]
    }
]

You can change the width of a wall(the distance between the center line and each outline).

const wallOutlines = constructWallOutline(walls, 0.08)

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.