@kenzotakahashi/autofloor-lib

0.7.4 • Public • Published

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 ] ] ]

Readme

Keywords

none

Package Sidebar

Install

npm i @kenzotakahashi/autofloor-lib

Weekly Downloads

0

Version

0.7.4

License

MIT

Unpacked Size

184 kB

Total Files

6

Last publish

Collaborators

  • kenzotakahashi