merge touching pocket selections

This commit is contained in:
Stewart Allen 2022-10-05 23:38:48 -04:00
commit cfc1837627
4 changed files with 28 additions and 34 deletions

View file

@ -11,6 +11,7 @@
* `B` can't drag slider bar on ipad / ios -- touch pad scrolling dodgy * `B` can't drag slider bar on ipad / ios -- touch pad scrolling dodgy
* `B` prevent or ask for really large models when scaling (crash ui) * `B` prevent or ask for really large models when scaling (crash ui)
* `P` refactor vertex replacement and widget update matrix tracking
* `P` duplicate objects should share same slice data unless rotated or scaled * `P` duplicate objects should share same slice data unless rotated or scaled
* `P` allow selection to be decimated on demand (context menu?) * `P` allow selection to be decimated on demand (context menu?)
* `P` move all persisted / workspace settings/data to IndexedDB (LS limitations) * `P` move all persisted / workspace settings/data to IndexedDB (LS limitations)
@ -106,6 +107,7 @@
* `F` gcode output option as zip for multiple or flip ops or tool change * `F` gcode output option as zip for multiple or flip ops or tool change
* `F` maintain several part orientations + op chains in a single profile * `F` maintain several part orientations + op chains in a single profile
* `P` refactor slicing engine to use common core in geo
* `P` port slicing to common core & refactor accordingly * `P` port slicing to common core & refactor accordingly
* `P` decrease cutting speed when entire tool is engaged (start of roughing) * `P` decrease cutting speed when entire tool is engaged (start of roughing)
* `P` clear void should cut inside-to-out when a part would be freed from stock * `P` clear void should cut inside-to-out when a part would be freed from stock
@ -129,6 +131,7 @@
# Mesh:Tool # Mesh:Tool
* add undo/redo
* send to Kiri:Moto workspace (or update model vertices in place) * send to Kiri:Moto workspace (or update model vertices in place)
* better z snap using just vertexes from face intersected * better z snap using just vertexes from face intersected
* add section view. local clip. raycast skip points above plane * add section view. local clip. raycast skip points above plane

View file

@ -3,13 +3,13 @@
Full docs @ https://docs.grid.space/projects/kiri-moto Full docs @ https://docs.grid.space/projects/kiri-moto
# Release 3.5 (future) # Release 3.5 (2022-10-07)
## Kiri:moto ## Kiri:moto
* add optional service workers and manifest to support full PWA + install * add optional service workers and manifest to support full PWA + install
* add support to run as Progressive Web Apps for installation and offline use * add support to run as Progressive Web Apps for installation and offline use
* add assembly import when KM used inside of Onshape * add assembly import when KM used inside of onshape
* add configurable flatness for contour clipping * add configurable flatness for contour clipping
* add faster render mode for FDM slices * add faster render mode for FDM slices
* add axis label remapping in FDM * add axis label remapping in FDM
@ -20,8 +20,8 @@ Full docs @ https://docs.grid.space/projects/kiri-moto
* add CAM pocket option to ignore interior features (outline only) * add CAM pocket option to ignore interior features (outline only)
* add CAM Z bottom visualization, make it relative to stock instead of part * add CAM Z bottom visualization, make it relative to stock instead of part
* add CAM z bottom inversion option to flip operator * add CAM z bottom inversion option to flip operator
* add CAM custom gcode operator * add CAM custom gcode operator (can be used for pausing, too)
* add optional CAM operation notes * add optional CAM operation notes (helps with many similar ops)
* extend url loading of workspaces to all formats * extend url loading of workspaces to all formats
* alert when healing is enabled and non-manifold geometries are detected * alert when healing is enabled and non-manifold geometries are detected
* fix thin output start and end point tracking which broke retraction * fix thin output start and end point tracking which broke retraction
@ -29,13 +29,6 @@ Full docs @ https://docs.grid.space/projects/kiri-moto
* fix profile seeding for newer device record formats * fix profile seeding for newer device record formats
* fix workspace import / restore for some file formats * fix workspace import / restore for some file formats
* fix potential crash into stock during moves when parts are z bottom anchored * fix potential crash into stock during moves when parts are z bottom anchored
* ~ refactor vertex replacement and widget update matrix tracking
* ~ refactor cnc to use core slicer engine
* ~ add cnc pause operator with control of park position
## Mesh:Tool (1.3.0)
* ~ undo / redo for some operations
# Release 3.4 (2022-05-14) # Release 3.4 (2022-05-14)

View file

@ -1487,6 +1487,7 @@ function updateStock(args, event) {
side:THREE.DoubleSide side:THREE.DoubleSide
}); });
camZBottom = new THREE.Mesh(geo, mat); camZBottom = new THREE.Mesh(geo, mat);
camZBottom._max = max;
camZBottom.renderOrder = 1; camZBottom.renderOrder = 1;
camZBottom.position.x = csox; camZBottom.position.x = csox;
camZBottom.position.y = csoy; camZBottom.position.y = csoy;

View file

@ -990,7 +990,7 @@ class OpPocket extends CamOp {
} }
let zs = down ? base.util.lerp(zTop, z, down) : [ z ]; let zs = down ? base.util.lerp(zTop, z, down) : [ z ];
if (expand) polys = POLY.offset(polys, expand); if (expand) polys = POLY.offset(polys, expand);
let zpro = 0, zinc = pinc / (polys.length * zs.length); let zpro = 0, zinc = 1 / (polys.length * zs.length);
for (let poly of polys) { for (let poly of polys) {
for (let z of zs) { for (let z of zs) {
let shadow = shadowAt(z); let shadow = shadowAt(z);
@ -1013,32 +1013,29 @@ class OpPocket extends CamOp {
if (false) slice.output() if (false) slice.output()
.setLayer("pocket shadow", {line: 0xff8811}, false) .setLayer("pocket shadow", {line: 0xff8811}, false)
.addPolys(shadow) .addPolys(shadow)
progress(prog + (zpro += zinc), "pocket"); progress(zpro += zinc, "pocket");
} }
} }
} }
let surfaces = op.surfaces[widget.id] || []; let surfaces = op.surfaces[widget.id] || [];
let vert = widget.getVertices().array.map(v => v.round(4)); let vert = widget.getVertices().array.map(v => v.round(4));
let prog = 0, pinc= 1 / surfaces.length; let outline = [];
for (let surface of surfaces) { let faces = CAM.surface_find(widget, surfaces);
let outline = []; let zmin = Infinity;
let faces = CAM.surface_find(widget, [surface]); let j=0, k=faces.length;
let zmin = Infinity; for (let face of faces) {
let j=0, k=faces.length; let i = face * 9;
for (let face of faces) { outline.push(newPolygon()
let i = face * 9; .add(vert[i++], vert[i++], zmin = Math.min(zmin, vert[i++]))
outline.push(newPolygon() .add(vert[i++], vert[i++], zmin = Math.min(zmin, vert[i++]))
.add(vert[i++], vert[i++], zmin = Math.min(zmin, vert[i++])) .add(vert[i++], vert[i++], zmin = Math.min(zmin, vert[i++]))
.add(vert[i++], vert[i++], zmin = Math.min(zmin, vert[i++])) );
.add(vert[i++], vert[i++], zmin = Math.min(zmin, vert[i++])) }
); outline = POLY.union(outline, 0.0001, true);
} outline = POLY.setWinding(outline, cutdir, false);
outline = POLY.union(outline, 0.0001, true); outline = healPolys(outline);
outline = POLY.setWinding(outline, cutdir, false); let pinc = 1;
outline = healPolys(outline); if (outline.length) {
if (outline.length === 0) {
continue;
}
// option to skip interior features (holes, pillars) // option to skip interior features (holes, pillars)
if (op.outline) { if (op.outline) {
for (let p of outline) { for (let p of outline) {
@ -1049,7 +1046,7 @@ class OpPocket extends CamOp {
.setLayer("pocket area", {line: 0x1188ff}, false) .setLayer("pocket area", {line: 0x1188ff}, false)
.addPolys(outline) .addPolys(outline)
clearZ(outline, zmin + 0.0001, down); clearZ(outline, zmin + 0.0001, down);
progress(prog += pinc, "pocket"); progress(1, "pocket");
} }
} }