fix thin output start/end point tracking (which broke retraction) and add slice indices in xray mode
This commit is contained in:
parent
4ce9f3fc76
commit
59950369e0
3 changed files with 8 additions and 3 deletions
|
|
@ -1120,6 +1120,9 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
|
||||||
}
|
}
|
||||||
let first = points[0];
|
let first = points[0];
|
||||||
let last = first;
|
let last = first;
|
||||||
|
if (startPoint && startPoint.distTo2D(first) > thinWall && intersectsTop(startPoint, first)) {
|
||||||
|
retract();
|
||||||
|
}
|
||||||
print.addOutput(preout, first, 0, moveSpeed, extruder);
|
print.addOutput(preout, first, 0, moveSpeed, extruder);
|
||||||
for (let p of order) {
|
for (let p of order) {
|
||||||
let dist = last ? last.distTo2D(p) : 0;
|
let dist = last ? last.distTo2D(p) : 0;
|
||||||
|
|
@ -1128,11 +1131,12 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
|
||||||
print.addOutput(preout, p, 0, moveSpeed, extruder);
|
print.addOutput(preout, p, 0, moveSpeed, extruder);
|
||||||
}
|
}
|
||||||
print.addOutput(preout, p, 1, fillSpeed, extruder);
|
print.addOutput(preout, p, 1, fillSpeed, extruder);
|
||||||
last = p;
|
startPoint = last = p;
|
||||||
}
|
}
|
||||||
// close a circle
|
// close a circle
|
||||||
if (last && last.distTo2D(first) <= thinWall) {
|
if (last && last.distTo2D(first) <= thinWall) {
|
||||||
print.addOutput(preout, first, 1, fillSpeed, extruder);
|
print.addOutput(preout, first, 1, fillSpeed, extruder);
|
||||||
|
startPoint = first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,6 @@ FDM.slice = function(settings, widget, onupdate, ondone) {
|
||||||
for (let i=0; i<zi.length; i++) {
|
for (let i=0; i<zi.length; i++) {
|
||||||
zi[i] = (zi[i] - zh[i] / 2).round(3);
|
zi[i] = (zi[i] - zh[i] / 2).round(3);
|
||||||
}
|
}
|
||||||
console.log({zi});
|
|
||||||
return zi;
|
return zi;
|
||||||
},
|
},
|
||||||
// slicer function (worker local or minion distributed)
|
// slicer function (worker local or minion distributed)
|
||||||
|
|
@ -304,6 +303,7 @@ FDM.slice = function(settings, widget, onupdate, ondone) {
|
||||||
slice.height = heights[slice.index];
|
slice.height = heights[slice.index];
|
||||||
slice.clips = clip;
|
slice.clips = clip;
|
||||||
if (process.xray) {
|
if (process.xray) {
|
||||||
|
slice.index = process.xrayi.shift();
|
||||||
slice.lines = lines;
|
slice.lines = lines;
|
||||||
slice.groups = groups;
|
slice.groups = groups;
|
||||||
slice.xray = process.xray;
|
slice.xray = process.xray;
|
||||||
|
|
@ -441,7 +441,7 @@ FDM.slice = function(settings, widget, onupdate, ondone) {
|
||||||
let range = slice.params;
|
let range = slice.params;
|
||||||
let spaceMult = slice.index === 0 ? process.firstLayerLineMult || 1 : 1;
|
let spaceMult = slice.index === 0 ? process.firstLayerLineMult || 1 : 1;
|
||||||
let isBottom = slice.index < process.sliceBottomLayers;
|
let isBottom = slice.index < process.sliceBottomLayers;
|
||||||
let isTop = slice.index > slices.length - process.sliceTopLayers - 1;
|
let isTop = process.sliceTopLayers && slice.index > slices.length - process.sliceTopLayers - 1;
|
||||||
let isDense = range.sliceFillSparse > 0.995;
|
let isDense = range.sliceFillSparse > 0.995;
|
||||||
let isSolid = (isBottom || ((isTop || isDense) && !vaseMode)) && !isSynth;
|
let isSolid = (isBottom || ((isTop || isDense) && !vaseMode)) && !isSynth;
|
||||||
let solidWidth = isSolid ? range.sliceFillWidth || 1 : 0;
|
let solidWidth = isSolid ? range.sliceFillWidth || 1 : 0;
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ const devel = {
|
||||||
let base = (proc.firstSliceHeight || size);
|
let base = (proc.firstSliceHeight || size);
|
||||||
layers = Array.isArray(layers) ? layers : [ layers ];
|
layers = Array.isArray(layers) ? layers : [ layers ];
|
||||||
proc.xray = layers.map(l => raw ? l : base + l * size - size / 2);
|
proc.xray = layers.map(l => raw ? l : base + l * size - size / 2);
|
||||||
|
proc.xrayi = layers.slice();
|
||||||
api.function.slice();
|
api.function.slice();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue