A collection of terse polygon utilities. A part of geom.
-
Memory managed each utility has a pool of instances accessable using
_X_.make()
and_X_.free()
. If you don't need pooled instances, simply pass in your own object instead. -
State less no state is kept within the utilities, it's up to you.
var poly = require('geom-poly');
// in steps
var rect = poly.make()
poly.add(rect,10,10)
poly.add(rect,20,10)
poly.add(rect,20,20)
poly.add(rect,10,20)
poly.close(rect)
// directly in make() (will auto-close)
var rect = poly.make(
10,10,
20,10,
20,20,
10,20
)
MIT