diff --git a/src/kiri/mode/cam/op-area.js b/src/kiri/mode/cam/op-area.js index 554cca5a..5d5a14d1 100644 --- a/src/kiri/mode/cam/op-area.js +++ b/src/kiri/mode/cam/op-area.js @@ -50,9 +50,10 @@ class OpArea extends CamOp { // gather surface selections let vert = widget.getGeoVertices({ unroll: true, translate: true }).map(v => v.round(4)); let faces = CAM.surface_find(widget, (op.surfaces[widget.id] ?? []), (follow ?? edgeangle ?? 5) * DEG2RAG); + let fpoly = []; for (let face of faces) { let i = face * 9; - polys.push(newPolygon() + fpoly.push(newPolygon() .add(vert[i++], vert[i++], vert[i++]) .add(vert[i++], vert[i++], vert[i++]) .add(vert[i++], vert[i++], vert[i++]) @@ -63,6 +64,9 @@ class OpArea extends CamOp { // surface and edge selections produce open polygons by default polys = POLY.nest(healPolys(polys)); + // add in surface areas + polys.push(...POLY.union(fpoly, 0.0001, true)); + // expand selections (flattens z variable polys) if (Math.abs(expand) > 0) { let nupolys = polys.filter(p => p.open); // set aside open