add chamfer top option for gears

This commit is contained in:
Stewart Allen 2024-07-19 18:05:41 -04:00
commit ee68930f73
6 changed files with 135 additions and 19 deletions

View file

@ -52,6 +52,7 @@ const POLYS = base.polygons = {
expand,
points,
length,
renest,
route,
union,
inset,
@ -193,6 +194,13 @@ function points(polys) {
return polys.length ? polys.map(p => p.deepLength).reduce((a,v) => a+v) : 0;
}
/**
* redo nesting of polygons that might already have inners
*/
function renest(polygons, deep) {
return nest(flatten(polygons, [], true), deep);
}
/**
* todo use clipper polytree?
*