@jscad/modeling
Version:
Constructive Solid Geometry (CSG) Library for JSCAD
13 lines (10 loc) • 340 B
JavaScript
/**
* Measure the area under the given polygon.
*
* @param {poly2} polygon - the polygon to measure
* @return {Number} the area of the polygon
* @alias module:modeling/geometries/poly2.measureArea
*/
const area = require('../../maths/utils/area')
const measureArea = (polygon) => area(polygon.vertices)
module.exports = measureArea