1.0.0 • Published 9 years ago

vertices-bounding-box v1.0.0

Weekly downloads
120
License
MIT
Repository
github
Last release
9 years ago

vertices-bounding-box

Computes the bounding box of a set of vertices

Works with vertices of arbitrary dimension.

Install

$ npm install vertices-bounding-box

Usage

var boundingBox = require('vertices-bounding-box');

var positions = [ 
  [-1,  0,  0],
  [ 1,  0, -1],
  [ 0, -1,  0],
  [ 0,  1,  1] 
];

var bb = boundingBox(positions);

console.log(bb);
/*
[
  [ -1, -1, -1 ], 
  [  1,  1,  1 ] 
]
*/