add base flatten option for belt
This commit is contained in:
parent
79fd318bea
commit
cf2b282b57
5 changed files with 15 additions and 23 deletions
|
|
@ -350,6 +350,7 @@
|
||||||
firstLayerBeltLead: 3,
|
firstLayerBeltLead: 3,
|
||||||
firstLayerBeltBump: 0,
|
firstLayerBeltBump: 0,
|
||||||
firstLayerFanSpeed: 0,
|
firstLayerFanSpeed: 0,
|
||||||
|
firstLayerFlatten: 0,
|
||||||
outputRaft: false,
|
outputRaft: false,
|
||||||
outputRaftSpacing: 0.2,
|
outputRaftSpacing: 0.2,
|
||||||
outputTemp: 200,
|
outputTemp: 200,
|
||||||
|
|
|
||||||
|
|
@ -1696,6 +1696,7 @@
|
||||||
firstLayerFanSpeed: UC.newInput(LANG.ou_fans_s, {title:LANG.ou_fans_l, convert:UC.toInt, bound:UC.bound(0,255), modes:FDM}),
|
firstLayerFanSpeed: UC.newInput(LANG.ou_fans_s, {title:LANG.ou_fans_l, convert:UC.toInt, bound:UC.bound(0,255), modes:FDM}),
|
||||||
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM, show:isNotBelt}),
|
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM, show:isNotBelt}),
|
||||||
firstLayerYOffset: UC.newInput(LANG.fl_zoff_s, {title:LANG.fl_zoff_l, convert:UC.toFloat, modes:FDM, show:isBelt}),
|
firstLayerYOffset: UC.newInput(LANG.fl_zoff_s, {title:LANG.fl_zoff_l, convert:UC.toFloat, modes:FDM, show:isBelt}),
|
||||||
|
firstLayerFlatten: UC.newInput(LANG.fl_flat_s, {title:LANG.fl_flat_l, convert:UC.toFloat, modes:FDM, show:isBelt}),
|
||||||
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM, show:isBelt}),
|
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM, show:isBelt}),
|
||||||
firstLayerRate: UC.newInput(LANG.fl_rate_s, {title:LANG.fl_rate_l, convert:UC.toFloat, modes:FDM}),
|
firstLayerRate: UC.newInput(LANG.fl_rate_s, {title:LANG.fl_rate_l, convert:UC.toFloat, modes:FDM}),
|
||||||
firstLayerFillRate: UC.newInput(LANG.fl_frat_s, {title:LANG.fl_frat_l, convert:UC.toFloat, modes:FDM, show:isNotBelt}),
|
firstLayerFillRate: UC.newInput(LANG.fl_frat_s, {title:LANG.fl_frat_l, convert:UC.toFloat, modes:FDM, show:isNotBelt}),
|
||||||
|
|
|
||||||
|
|
@ -56,47 +56,35 @@
|
||||||
function slice(points, bounds, options, ondone, onupdate) {
|
function slice(points, bounds, options, ondone, onupdate) {
|
||||||
let useFlats = options.flats,
|
let useFlats = options.flats,
|
||||||
isBelt = options.isBelt || false,
|
isBelt = options.isBelt || false,
|
||||||
zPress = options.zPress || 0, // compress z values less than zPress (flaten bottom)
|
zPress = options.zPress || 0, // lower z values less than zPress (flaten bottoms)
|
||||||
zCut = options.zCut || 0, // cut bottom off model below bed/belt
|
zCut = options.zCut || 0, // cut bottom off model below bed/belt
|
||||||
xray = options.xray,
|
xray = options.xray,
|
||||||
zList = {}, // map count of z index points for adaptive slicing
|
|
||||||
ox = 0,
|
ox = 0,
|
||||||
oy = 0;
|
oy = 0;
|
||||||
|
|
||||||
// support moving parts below bed to "cut" them
|
// support moving parts below bed to "cut" them in Z
|
||||||
// and/or flatten part bottoms
|
// and/or flatten part bottoms belowa a given thresold
|
||||||
let zpress = 0;
|
|
||||||
let zneg = 0;
|
|
||||||
if (zCut || zPress) {
|
if (zCut || zPress) {
|
||||||
for (let p of points) {
|
for (let p of points) {
|
||||||
if (!p._z) {
|
if (!p._z) {
|
||||||
p._z = p.z;
|
p._z = p.z;
|
||||||
if (zPress) {
|
if (zPress) {
|
||||||
if (isBelt) {
|
if (isBelt) {
|
||||||
let z = (p.z - p.y);
|
let zb = (p.z - p.y) * beltfact;
|
||||||
let zo = z * ibeltfact;
|
if (zb > 0 && zb <= zPress) {
|
||||||
let zb = z * beltfact;
|
p.y += zb * beltfact;
|
||||||
if (z < 0) zneg++;
|
p.z -= zb * beltfact;
|
||||||
if (zo > 0 && zo < zPress) {
|
|
||||||
p.y += z;
|
|
||||||
p.z -= z;
|
|
||||||
zpress++;
|
|
||||||
}
|
}
|
||||||
countZ(zo);
|
|
||||||
} else {
|
} else {
|
||||||
if (p.z < zPress) p.z = 0;
|
if (p.z <= zPress) p.z = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (zCut) {
|
if (zCut && !isBelt) {
|
||||||
p.z -= zCut;
|
p.z -= zCut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log({zpress, zneg});
|
|
||||||
console.log({
|
|
||||||
zList: Object.entries(zList).sort((a,b) => { return parseFloat(a[0]) - parseFloat(b[0]) })
|
|
||||||
});
|
|
||||||
|
|
||||||
let zMin = options.zmin || options.firstHeight || Math.floor(bounds.min.z),
|
let zMin = options.zmin || options.firstHeight || Math.floor(bounds.min.z),
|
||||||
zMax = options.zmax || Math.ceil(bounds.max.z),
|
zMax = options.zmax || Math.ceil(bounds.max.z),
|
||||||
|
|
@ -108,7 +96,7 @@
|
||||||
zIndexes = [], // auto-detected z slicing offsets (laser/cam)
|
zIndexes = [], // auto-detected z slicing offsets (laser/cam)
|
||||||
zOrdered = [], // ordered list of Z indexes
|
zOrdered = [], // ordered list of Z indexes
|
||||||
zThick = [], // ordered list of Z slice thickness (laser)
|
zThick = [], // ordered list of Z slice thickness (laser)
|
||||||
// zList = {}, // map count of z index points for adaptive slicing
|
zList = {}, // map count of z index points for adaptive slicing
|
||||||
zFlat = {}, // map area of z index flat areas (cam)
|
zFlat = {}, // map area of z index flat areas (cam)
|
||||||
zLines = {}, // map count of z index lines
|
zLines = {}, // map count of z index lines
|
||||||
zScale, // bucket span in z units
|
zScale, // bucket span in z units
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
SLICER.sliceWidget(widget, {
|
SLICER.sliceWidget(widget, {
|
||||||
mode: 'FDM',
|
mode: 'FDM',
|
||||||
zCut: widget.track.zcut || 0,
|
zCut: widget.track.zcut || 0,
|
||||||
zPress: 1,//0.05,
|
zPress: isBelt ? process.firstLayerFlatten || 0 : 0,
|
||||||
isBelt,
|
isBelt,
|
||||||
height: sliceHeight,
|
height: sliceHeight,
|
||||||
minHeight: sliceMinHeight,
|
minHeight: sliceMinHeight,
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,8 @@ kiri.lang['en-us'] = {
|
||||||
// FDM BELT ONLY
|
// FDM BELT ONLY
|
||||||
fl_zoff_s: "belt offset",
|
fl_zoff_s: "belt offset",
|
||||||
fl_zoff_l: ["height offset from belt","of lowest extrusion","in millimeters"],
|
fl_zoff_l: ["height offset from belt","of lowest extrusion","in millimeters"],
|
||||||
|
fl_flat_s: "flatten",
|
||||||
|
fl_flat_l: ["flatten to the belt any point","height less than this value","in millimeters"],
|
||||||
fl_brim_s: "brim sides",
|
fl_brim_s: "brim sides",
|
||||||
fl_brim_l: ["add brim to part perimeter","size is width in millimeters","0 to disable"],
|
fl_brim_l: ["add brim to part perimeter","size is width in millimeters","0 to disable"],
|
||||||
fl_brin_s: "brim interior",
|
fl_brin_s: "brim interior",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue