Socket
Book a DemoInstallSign in
Socket

bound-points

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bound-points

Find a bounding box for a set of points

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

bound-points

Computes a bounding box from a set of points in any dimension.

Example

var getBounds = require('bound-points')

var points = [[-1, 1], [5, 10], [-8, 13]]
console.log('2d:', getBounds(points))

var mesh = require('bunny')
console.log('3d:', getBounds(mesh.positions))

Output:

2d: [ [ -8, 1 ], [ 5, 13 ] ]
3d: [ [ -4.958475, -0.003149, -3.729833 ],
  [ 4.94885, 9.654748, 3.810639 ] ]

Install

npm i bound-points

API

var bounds = require('bound-points')(points)

Computes an axis aligned bounding box for a set of points.

  • points is an array of points

Returns A pair of upper and lower bounds for the point set.

License

(c) 2015 Mikola Lysenko. MIT License

Keywords

bounding

FAQs

Package last updated on 19 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts