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
* 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
let polys = [];
let nups = [];
@ -724,13 +727,14 @@ let gs_kiri_cam = exports;
let np = newPolygon().setOpen();
let mp = 0;
// 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
poly.forEachSegment((p1,p2) => {
let nz = getTopoZPathMax(widget, profile, p1.x, p1.y, p2.x, p2.y);
if (nz > mz) {
mz = nz;
}
// this # should be computed from topo resolution
if (nz - pz < 0.01) {
mp++
if (np.length) {
@ -743,7 +747,9 @@ let gs_kiri_cam = exports;
np.append(p1).append(p2);
}
} else if (np.length) {
if (!only_whole) {
nups.append(np);
}
np = newPolygon().setOpen();
}
});
@ -758,9 +764,14 @@ let gs_kiri_cam = exports;
if (np.isClosed() && parent) {
// console.log(slice.z,'cull',poly);
parent.inner = parent.inner.filter(p => p !== poly);
}
if (only_whole) {
nups.append(np);
}
}
if (!only_whole) {
nups.append(np);
}
}
});
if (nups.length) {
// console.log(slice.z,'nups',nups.length);
@ -1022,7 +1033,9 @@ let gs_kiri_cam = exports;
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) {
sliceAll.appendAll(slices);
// todo union rough / finish shells
@ -1055,9 +1068,7 @@ let gs_kiri_cam = exports;
if (addTabsRough) addCutoutTabs(slice, roughToolDiam);
break;
case CPRO.FINISH:
if (profile) {
findTracingPaths(widget, slice, tool, profile);
}
if (profile) findTracingPaths(widget, slice, tool, profile);
createFinishingSlices(slice, shellFinish, finishToolDiam, pocketOnlyFinish);
if (addTabsFinish) addCutoutTabs(slice, finishToolDiam);
break;
@ -1153,8 +1164,10 @@ let gs_kiri_cam = exports;
if (toolID !== lastTool) {
tool = getToolById(settings, toolID);
toolDiam = getToolDiameter(settings, toolID);
toolDiamMove = toolDiam, // TODO validate w/ multiple models
toolDiamMove = toolDiam; // TODO validate w/ multiple models
if (widget.topo) {
toolProfile = createToolProfile(settings, toolID, widget.topo);
}
lastTool = toolID;
}
feedRate = feed;
@ -1267,7 +1280,7 @@ let gs_kiri_cam = exports;
} //else (TODO verify no else here b/c above could change isMove)
// move over things
if ((deltaXY > toolDiam || (deltaZ > toolDiam && deltaXY > tolerance)) && (isMove || absDeltaZ >= tolerance)) {
let maxz = MAX(
let maxz = toolProfile ? MAX(
getTopoZPathMax(
widget,
toolProfile,
@ -1276,7 +1289,7 @@ let gs_kiri_cam = exports;
point.x,
point.y) + zadd,
point.z,
lastPoint.z),
lastPoint.z) : zmax + zadd,
mustGoUp = MAX(maxz - point.z, maxz - lastPoint.z) >= tolerance,
clearz = maxz;
// up if any point between higher than start/finish

View file

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

View file

@ -9,7 +9,6 @@
* bail on decimation if it's proving ineffective
* improve decimation speed by avoiding in/out of Point
* server-side processing (determine protocol and storage)
* move printing/output into module
* refactor / simplify POLY.expand (put onus on collector)
* cloned objects should share same slice data unless rotated
* 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
* 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)
* ease-in and ease-out especially on tab cut-out start/stop
* import options: unify bodies.
* milling order option: by operation or by part
* store tab and camshell polys in widget.topo to minimize z on edge moves
* trimming linear finishing to tabs
* improve 'clockwise' setting to take into account spindle direction, etc
* linear finishing cutting out tabs
* add endmill spiral direction to influence next point
* improve 'clockwise' setting to take into account spindle direction, etc (climb/conventional)
* lead-in milling
* linear finishing going back to z top too often
* fix ease down and re-enable (need failure case)
* 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
* compensate for leave-stock in outside roughing (w/ tabs)
* 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
* check normals for downward facing facets. mark top for slice skirt/pancake
# Laser todo
* add proper devices
* color coding according to # of identical polys that show up in stacked layers
* overcuts, radii for drag knives
* 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
* [Facebook Group](https://www.facebook.com/groups/660020084206828/)
* [Facebook Group](https://www.facebook.com/groups/kirimoto/)
* [YouTube Tutorials](https://www.youtube.com/c/gridspace)
* [Twitter](https://twitter.com/grid_space_3d)
* [Wiki](https://github.com/GridSpace/grid-apps/wiki)