@kenzotakahashi/autofloor-lib

libraries for autofloor

Stats

StarsIssuesVersionUpdatedCreatedSize
@kenzotakahashi/autofloor-lib
0.7.43 years ago3 years agoMinified + gzip package size for @kenzotakahashi/autofloor-lib in KB

Readme

Autofloor Library

Autofloorで使うライブラリです。

Install

npm install -D @kenzotakahashi/autofloor-lib

findRooms

壁から部屋を見つけます。outlineに依存しています。

import {findRooms} from 'autofloor-lib'
import {constructWallOutline} from '@kenzotakahashi/autofloor-calc-outline'

const walls = [
  [[1,3],[3.5,3]],
  [[1,3],[1.2,0.8]],
  [[1.2,0.8],[3.5,0.8]],
  [[3.5,0.8],[5.5,0.8]],
  [[3.5,0.8],[3.5,3]],
  [[5.5,0.8],[5.5,3]],
  [[3.5,3],[5.5,3]]
]
const [rooms, outlines] = findRooms(constructWallOutline(walls))
console.log(rooms)

Output

[ [ [ 1.0832224943005666, 2.9240000000000004 ],
    [ 1.2694043124823846, 0.8760000000000003 ],
    [ 3.424, 0.876 ],
    [ 3.424, 2.924 ] ],
  [ [ 3.576, 2.924 ],
    [ 5.424, 2.924 ],
    [ 5.424, 0.876 ],
    [ 3.576, 0.876 ] ] ]

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.