fix cam step over unit conversion bug. fix slicing floating point precision bug. bump rev 2.3.D5

This commit is contained in:
Stewart Allen 2020-11-10 10:24:26 -05:00
commit e43cc7c97a
9 changed files with 79 additions and 27 deletions

View file

@ -1426,7 +1426,7 @@
camRough: UC.newGroup(LANG.cr_menu, null, {modes:CAM, marker:true}),
camRoughTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
camRoughSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}),
camRoughOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.1,1.0), modes:CAM, units:true}),
camRoughOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.1,1.0), modes:CAM}),
camRoughDown: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, modes:CAM, units:true}),
camRoughSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}),
camRoughPlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}),
@ -1447,7 +1447,7 @@
camContour: UC.newGroup(LANG.cn_menu, null, {modes:CAM, marker:true}),
camContourTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
camContourSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}),
camContourOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.05,1.0), modes:CAM, units:true}),
camContourOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.05,1.0), modes:CAM}),
camContourSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}),
camContourAngle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90), modes:CAM}),
camContourCurves: UC.newBoolean(LANG.cf_curv_s, onBooleanClick, {title:LANG.cf_curv_l, modes:CAM}),

View file

@ -1529,10 +1529,14 @@
}
}
function settingsExport() {
function settingsExport(options) {
const opts = options || {};
const shot = opts.screen ? SPACE.screenshot() : undefined;
return btoa(JSON.stringify({
settings: settings,
version: KIRI.version,
screen: shot,
space: SPACE.info,
moto: MOTO.id,
init: SDB.getItem('kiri-init'),
time: Date.now()

View file

@ -50,6 +50,8 @@
simpleMode = options.simple,
swap = options.swapX || options.swapY,
isCam = options.cam,
debug = options.debug,
xray = options.xray,
ox = 0,
oy = 0;
@ -513,8 +515,23 @@
// for topo slices, we just need the raw lines
if (!topoMode && !simpleMode) {
slice.groups = connectLines(slice.lines, slices.length);
POLY.nest(slice.groups).forEach(function(top) { slice.addTop(top) });
slice.groups = connectLines(slice.lines, slice.z);
if ((debug && slice.lines.excessive) || xray) {
const dash = xray || 3;
slice.lines.forEach((line, i) => {
const group = i % dash;
const color = [ 0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff ][group];
slice.output().setLayer(`xl-${group}`, color).addLine(line.p1, line.p2);
});
}
POLY.nest(slice.groups).forEach((poly, i) => {
slice.addTop(poly);
if (xray) {
const group = i % (xray || 3);
const color = [ 0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff ][group];
slice.output().setLayer(`xg-${group}`, color).addPoly(poly);
}
});
}
// fixup un-rotates polygons for CAM
@ -543,7 +560,7 @@
}
} else if (simpleMode) {
// fdm polishing mode
slice.groups = connectLines(slice.lines, slices.length);
slice.groups = connectLines(slice.lines, slice.z);
slice.groups.forEach(poly => {
poly.swap(options.swapX, options.swapY);
poly.move(move);
@ -566,7 +583,7 @@
* @param {number} [index]
* @returns {Array}
*/
function connectLines(input) {
function connectLines(input, z) {
// map points to all other points they're connected to
let DBUG = BASE.debug,
CONF = BASE.config,
@ -611,7 +628,8 @@
function findPathsMinRecurse(point, path, paths, from) {
let stack = [ ];
if (paths.length > 10000) {
DBUG.log("excessive path options @ "+paths.length+" #"+input.length);
DBUG.log(`indeterminate path @ ${z} from paths=${paths.length} input=${input.length}`);
input.excessive = paths.length;
return;
}
for (;;) {
@ -721,8 +739,8 @@
// create point map, unique point list and point group arrays
input.forEach(function(line) {
p1 = cachedPoint(line.p1.round(7));
p2 = cachedPoint(line.p2.round(7));
p1 = cachedPoint(line.p1.round(4));
p2 = cachedPoint(line.p2.round(4));
addConnected(p1,p2);
addConnected(p2,p1);
});

View file

@ -4,8 +4,6 @@
(function() {
if (self.kiri.slicer2) return;
let KIRI = self.kiri,
BASE = self.base,
CONF = BASE.config,
@ -623,8 +621,8 @@
// create point map, unique point list and point group arrays
input.forEach(function(line) {
p1 = cachedPoint(line.p1.round(7));
p2 = cachedPoint(line.p2.round(7));
p1 = cachedPoint(line.p1.round(4));
p2 = cachedPoint(line.p2.round(4));
addConnected(p1,p2);
addConnected(p2,p1);
});