limit tracing to wholly consume paths for now. omit topo when drilling only

This commit is contained in:
Stewart Allen 2020-03-12 09:57:01 -04:00
commit 670c0c7822
4 changed files with 35 additions and 26 deletions

View file

@ -710,9 +710,12 @@ let gs_kiri_cam = exports;
/** /**
* Find top paths to trace when using ball and taper mills * Find top paths to trace when using ball and taper mills
* in waterline finishing mode. * in waterline finishing and tracing modes.
*/ */
function findTracingPaths(widget, slice, tool, profile) { function findTracingPaths(widget, slice, tool, profile, partial) {
// for now, only emit completed polys and not segments
// TODO consider limiting to nup path lengths that are >= tool radius
let only_whole = !partial;
// check for ball and taper mills paths and add to top[0].inner // check for ball and taper mills paths and add to top[0].inner
let polys = []; let polys = [];
let nups = []; let nups = [];
@ -724,13 +727,14 @@ let gs_kiri_cam = exports;
let np = newPolygon().setOpen(); let np = newPolygon().setOpen();
let mp = 0; let mp = 0;
// find top poly segments that are not significantly offset // find top poly segments that are not significantly offset
// my tool profile and add to new polygons which accumulate // from tool profile and add to new polygons which accumulate
// to the top inner array // to the top inner array
poly.forEachSegment((p1,p2) => { poly.forEachSegment((p1,p2) => {
let nz = getTopoZPathMax(widget, profile, p1.x, p1.y, p2.x, p2.y); let nz = getTopoZPathMax(widget, profile, p1.x, p1.y, p2.x, p2.y);
if (nz > mz) { if (nz > mz) {
mz = nz; mz = nz;
} }
// this # should be computed from topo resolution
if (nz - pz < 0.01) { if (nz - pz < 0.01) {
mp++ mp++
if (np.length) { if (np.length) {
@ -743,7 +747,9 @@ let gs_kiri_cam = exports;
np.append(p1).append(p2); np.append(p1).append(p2);
} }
} else if (np.length) { } else if (np.length) {
nups.append(np); if (!only_whole) {
nups.append(np);
}
np = newPolygon().setOpen(); np = newPolygon().setOpen();
} }
}); });
@ -758,8 +764,13 @@ let gs_kiri_cam = exports;
if (np.isClosed() && parent) { if (np.isClosed() && parent) {
// console.log(slice.z,'cull',poly); // console.log(slice.z,'cull',poly);
parent.inner = parent.inner.filter(p => p !== poly); parent.inner = parent.inner.filter(p => p !== poly);
if (only_whole) {
nups.append(np);
}
}
if (!only_whole) {
nups.append(np);
} }
nups.append(np);
} }
}); });
if (nups.length) { if (nups.length) {
@ -1022,7 +1033,9 @@ let gs_kiri_cam = exports;
onupdate(0.0 + update * 0.25, "slicing"); onupdate(0.0 + update * 0.25, "slicing");
}); });
// we need topo for safe travel moves // we need topo for safe travel moves when roughing and finishing
// not generated when drilling-only. then all z moves use bounds max
if (procRough || anyFinish)
generateTopoMap(widget, settings, function(slices) { generateTopoMap(widget, settings, function(slices) {
sliceAll.appendAll(slices); sliceAll.appendAll(slices);
// todo union rough / finish shells // todo union rough / finish shells
@ -1055,9 +1068,7 @@ let gs_kiri_cam = exports;
if (addTabsRough) addCutoutTabs(slice, roughToolDiam); if (addTabsRough) addCutoutTabs(slice, roughToolDiam);
break; break;
case CPRO.FINISH: case CPRO.FINISH:
if (profile) { if (profile) findTracingPaths(widget, slice, tool, profile);
findTracingPaths(widget, slice, tool, profile);
}
createFinishingSlices(slice, shellFinish, finishToolDiam, pocketOnlyFinish); createFinishingSlices(slice, shellFinish, finishToolDiam, pocketOnlyFinish);
if (addTabsFinish) addCutoutTabs(slice, finishToolDiam); if (addTabsFinish) addCutoutTabs(slice, finishToolDiam);
break; break;
@ -1153,8 +1164,10 @@ let gs_kiri_cam = exports;
if (toolID !== lastTool) { if (toolID !== lastTool) {
tool = getToolById(settings, toolID); tool = getToolById(settings, toolID);
toolDiam = getToolDiameter(settings, toolID); toolDiam = getToolDiameter(settings, toolID);
toolDiamMove = toolDiam, // TODO validate w/ multiple models toolDiamMove = toolDiam; // TODO validate w/ multiple models
toolProfile = createToolProfile(settings, toolID, widget.topo); if (widget.topo) {
toolProfile = createToolProfile(settings, toolID, widget.topo);
}
lastTool = toolID; lastTool = toolID;
} }
feedRate = feed; feedRate = feed;
@ -1267,7 +1280,7 @@ let gs_kiri_cam = exports;
} //else (TODO verify no else here b/c above could change isMove) } //else (TODO verify no else here b/c above could change isMove)
// move over things // move over things
if ((deltaXY > toolDiam || (deltaZ > toolDiam && deltaXY > tolerance)) && (isMove || absDeltaZ >= tolerance)) { if ((deltaXY > toolDiam || (deltaZ > toolDiam && deltaXY > tolerance)) && (isMove || absDeltaZ >= tolerance)) {
let maxz = MAX( let maxz = toolProfile ? MAX(
getTopoZPathMax( getTopoZPathMax(
widget, widget,
toolProfile, toolProfile,
@ -1276,7 +1289,7 @@ let gs_kiri_cam = exports;
point.x, point.x,
point.y) + zadd, point.y) + zadd,
point.z, point.z,
lastPoint.z), lastPoint.z) : zmax + zadd,
mustGoUp = MAX(maxz - point.z, maxz - lastPoint.z) >= tolerance, mustGoUp = MAX(maxz - point.z, maxz - lastPoint.z) >= tolerance,
clearz = maxz; clearz = maxz;
// up if any point between higher than start/finish // up if any point between higher than start/finish

View file

@ -1302,7 +1302,9 @@ var gs_kiri_init = exports;
}; };
UI.toolsSave.onclick = function() { UI.toolsSave.onclick = function() {
if (selectedTool) updateTool(); if (selectedTool) updateTool();
settings().tools = editTools; settings().tools = editTools.sort((a,b) => {
return a.name < b.name ? -1 : 1;
});
setToolChanged(false); setToolChanged(false);
API.conf.save(); API.conf.save();
API.view.update_fields(); API.view.update_fields();

View file

@ -9,7 +9,6 @@
* bail on decimation if it's proving ineffective * bail on decimation if it's proving ineffective
* improve decimation speed by avoiding in/out of Point * improve decimation speed by avoiding in/out of Point
* server-side processing (determine protocol and storage) * server-side processing (determine protocol and storage)
* move printing/output into module
* refactor / simplify POLY.expand (put onus on collector) * refactor / simplify POLY.expand (put onus on collector)
* cloned objects should share same slice data unless rotated * cloned objects should share same slice data unless rotated
* remember object's original position/orientation for reset/multi-object import alignment * remember object's original position/orientation for reset/multi-object import alignment
@ -39,15 +38,13 @@
* refactor slicing around flats w/ interpolation instead of culling * refactor slicing around flats w/ interpolation instead of culling
* optimize away topo generation (for z hop/move) when part is flat * optimize away topo generation (for z hop/move) when part is flat
* add imperial / metric units switch in (future) global config options
* add option to spiral in vs out (optimal tool life) vs mixed (optimal path) * add option to spiral in vs out (optimal tool life) vs mixed (optimal path)
* ease-in and ease-out especially on tab cut-out start/stop * ease-in and ease-out especially on tab cut-out start/stop
* import options: unify bodies.
* milling order option: by operation or by part * milling order option: by operation or by part
* store tab and camshell polys in widget.topo to minimize z on edge moves * store tab and camshell polys in widget.topo to minimize z on edge moves
* trimming linear finishing to tabs * add endmill spiral direction to influence next point
* improve 'clockwise' setting to take into account spindle direction, etc * improve 'clockwise' setting to take into account spindle direction, etc (climb/conventional)
* linear finishing cutting out tabs * lead-in milling
* linear finishing going back to z top too often * linear finishing going back to z top too often
* fix ease down and re-enable (need failure case) * fix ease down and re-enable (need failure case)
* warn when part > stock or cuts go outside bed * warn when part > stock or cuts go outside bed
@ -57,16 +54,13 @@
* crossing open space check point is outside camshell before returning max z * crossing open space check point is outside camshell before returning max z
* compensate for leave-stock in outside roughing (w/ tabs) * compensate for leave-stock in outside roughing (w/ tabs)
* fix zooming, workspace thickness for larger workspaces * fix zooming, workspace thickness for larger workspaces
* raise z by leave-stock in roughing? if so, see next
* if (raise z) above, add clear-flats to finishing
* revisit tabs - just cut polys instead
* try chunking topo until smaller blocks for processing (fit in cacheline)
* linear x/y scan overflow (y) w/ topo model
* linear x/y not obeying inset from pocket only * linear x/y not obeying inset from pocket only
* check normals for downward facing facets. mark top for slice skirt/pancake * check normals for downward facing facets. mark top for slice skirt/pancake
# Laser todo # Laser todo
* add proper devices
* color coding according to # of identical polys that show up in stacked layers
* overcuts, radii for drag knives * overcuts, radii for drag knives
* sla :: svg modified from http://garyhodgson.github.io/slic3rsvgviewer/?file=examples/belt_pulley3.svg * sla :: svg modified from http://garyhodgson.github.io/slic3rsvgviewer/?file=examples/belt_pulley3.svg

View file

@ -27,7 +27,7 @@ then access the apps from http://debug:8080/
## More Information ## More Information
* [Facebook Group](https://www.facebook.com/groups/660020084206828/) * [Facebook Group](https://www.facebook.com/groups/kirimoto/)
* [YouTube Tutorials](https://www.youtube.com/c/gridspace) * [YouTube Tutorials](https://www.youtube.com/c/gridspace)
* [Twitter](https://twitter.com/grid_space_3d) * [Twitter](https://twitter.com/grid_space_3d)
* [Wiki](https://github.com/GridSpace/grid-apps/wiki) * [Wiki](https://github.com/GridSpace/grid-apps/wiki)