This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/papercraft/openjscad/node_modules/@jscad/csg/src/math/Polygon2.js

20 lines
481 B
JavaScript

const CAG = require('../CAG')
/*
2D polygons are now supported through the CAG class.
With many improvements (see documentation):
- shapes do no longer have to be convex
- union/intersect/subtract is supported
- expand / contract are supported
But we'll keep CSG.Polygon2D as a stub for backwards compatibility
*/
function Polygon2D (points) {
const cag = CAG.fromPoints(points)
this.sides = cag.sides
}
Polygon2D.prototype = CAG.prototype
module.exports = Polygon2D