Closed z3dev closed 5 months ago
Looks good, and I confirmed the behavior with a test file.
Here's a suggested test to add to polygon.test.js which fails on master but passes on this branch:
test('polygon: clockwise points', (t) => { const poly = polygon({ points: [[-10, -0], [-10, -10], [-15, -5]], orientation: "clockwise", }) t.is(poly.sides.length, 3) t.is(measureArea(poly), 25) })
@platypii thanks. i added the test case. should be ready to merge now.
These changes add a new option to the polygon primitive; orientation. If set to 'clockwise' then the geometry is reversed.
These changes address #1012
All Submissions: