fix cam step over unit conversion bug. fix slicing floating point precision bug. bump rev 2.3.D5
This commit is contained in:
parent
eb53f5334d
commit
e43cc7c97a
9 changed files with 79 additions and 27 deletions
3
notes.md
3
notes.md
|
|
@ -16,11 +16,14 @@
|
|||
|
||||
# FDM
|
||||
|
||||
* `B` miter acute angles (benchy + square render)
|
||||
* `B` fix adaptive slicing with multi-extruder
|
||||
* `B` fix supports with grouped parts
|
||||
* `B` fix preview/gcode layer size (first layer)
|
||||
* `F` speculative background preview generation
|
||||
* `F` control for size of purge block (with 0=disabled)
|
||||
* `F` add separate fill speed control
|
||||
* `F` show retract/engage in preview
|
||||
* `F` manual support addition / control
|
||||
* `F` polishing and other non-planar work
|
||||
* `F` gradient infill https://www.youtube.com/watch?v=hq53gsYREHU&feature=emb_logo
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "grid-apps",
|
||||
"version": "2.3.D4",
|
||||
"version": "2.3.D5",
|
||||
"description": "grid.space 3d slice & modeling tools",
|
||||
"author": "Stewart Allen <sa@grid.space>",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -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}),
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
let terms = {
|
||||
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||
LICENSE: "See the license.md file included with the source distribution",
|
||||
VERSION: "2.3.D4"
|
||||
VERSION: "2.3.D5"
|
||||
};
|
||||
|
||||
if (typeof(module) === 'object') {
|
||||
|
|
|
|||
|
|
@ -91,11 +91,35 @@
|
|||
spro.firstSliceHeight = sliceHeight;
|
||||
}
|
||||
|
||||
// const slicer = new KIRI.slicer2(widget.getPoints(), { });
|
||||
// const levels = slicer.interval(sliceHeight, {
|
||||
// zlist: true,
|
||||
// zline: true,
|
||||
// boff: spro.firstSliceHeight || spro.sliceHeight
|
||||
// });
|
||||
// const slices = [];
|
||||
// let last;
|
||||
// slicer.slice(levels, { genso: true, each: (data, idx, tot, time) => {
|
||||
// const slice = data.slice;
|
||||
// if (last) {
|
||||
// slice.down = last;
|
||||
// last.up = slice;
|
||||
// }
|
||||
// last = slice;
|
||||
// slice.index = idx;
|
||||
// slice.height = spro.firstSliceHeight || spro.sliceHeight;
|
||||
// slices.push(slice);
|
||||
// onupdate((idx / tot) * 0.5);
|
||||
// } });
|
||||
// onSliceDone(slices);
|
||||
|
||||
SLICER.sliceWidget(widget, {
|
||||
height: sliceHeight,
|
||||
minHeight: sliceHeight > spro.sliceMinHeight ? spro.sliceMinHeight : 0,
|
||||
firstHeight: spro.firstSliceHeight,
|
||||
view: view
|
||||
// debug: true,
|
||||
// xray: 3,
|
||||
// view: view
|
||||
}, onSliceDone, onSliceUpdate);
|
||||
|
||||
function onSliceUpdate(update) {
|
||||
|
|
@ -121,14 +145,6 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// if (!isThin && slices.length > 100) {
|
||||
// isFlat = true;
|
||||
// }
|
||||
|
||||
// if (slices.length > 150) {
|
||||
// isThin = true;
|
||||
// }
|
||||
|
||||
// calculate % complete and call onupdate()
|
||||
function doupdate(index, from, to, msg) {
|
||||
onupdate(0.5 + (from + ((index/slices.length) * (to-from))) * 0.5, msg);
|
||||
|
|
@ -318,7 +334,6 @@
|
|||
*/
|
||||
function doShells(slice, count, offset1, offsetN, fillOffset, options) {
|
||||
const opt = options || {};
|
||||
|
||||
slice.tops.forEach(function(top) {
|
||||
let top_poly = [ top.poly ];
|
||||
|
||||
|
|
@ -617,7 +632,6 @@
|
|||
if (slice.index === 0 && !fakedown) {
|
||||
return;
|
||||
}
|
||||
|
||||
const top = slice,
|
||||
down = slice.down || (fakedown ? newSlice(-1) : null),
|
||||
topInner = sla ? top.topPolys() : top.topInners(),
|
||||
|
|
|
|||
|
|
@ -785,6 +785,10 @@
|
|||
return renderer.domElement.toDataURL(format || "image/png");
|
||||
},
|
||||
|
||||
internals: function() {
|
||||
return { renderer, camera };
|
||||
},
|
||||
|
||||
init: function(domelement, slider) {
|
||||
container = domelement;
|
||||
|
||||
|
|
@ -894,6 +898,17 @@
|
|||
|
||||
animate();
|
||||
|
||||
const ctx = renderer.getContext();
|
||||
const ext = ctx.getExtension('WEBGL_debug_renderer_info');
|
||||
const nav = navigator;
|
||||
Space.info = {
|
||||
ver: ctx.getParameter(ctx.VERSION),
|
||||
ven: ctx.getParameter(ctx.VENDOR),
|
||||
glr: ctx.getParameter(ext.UNMASKED_RENDERER_WEBGL),
|
||||
// glv: ctx.getParameter(ext.UNMASKED_VENDOR_WEBGL),
|
||||
pla: nav.platform
|
||||
},
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue