nest cam slicing into code block. fix 0 height on first layer affecting extrusion
This commit is contained in:
parent
56fc8afe52
commit
a390e4ca71
4 changed files with 52 additions and 46 deletions
|
|
@ -182,7 +182,7 @@ var gs_kiri_fdm = exports;
|
||||||
mode = settings.mode,
|
mode = settings.mode,
|
||||||
output = print.output,
|
output = print.output,
|
||||||
printPoint = newPoint(0,0,0),
|
printPoint = newPoint(0,0,0),
|
||||||
firstLayerHeight = process.firstSliceHeight,
|
firstLayerHeight = process.firstSliceHeight || process.sliceHeight,
|
||||||
maxLayers = 0,
|
maxLayers = 0,
|
||||||
layer = 0,
|
layer = 0,
|
||||||
zoff = 0,
|
zoff = 0,
|
||||||
|
|
@ -561,7 +561,8 @@ var gs_kiri_fdm = exports;
|
||||||
emitPerMM = print.extrudePerMM(
|
emitPerMM = print.extrudePerMM(
|
||||||
device.nozzleSize,
|
device.nozzleSize,
|
||||||
device.filamentSize,
|
device.filamentSize,
|
||||||
path.layer === 0 ? process.firstSliceHeight : path.height);
|
path.layer === 0 ?
|
||||||
|
(process.firstSliceHeight || process.sliceHeight) : path.height);
|
||||||
|
|
||||||
consts.z = zpos.toFixed(2);
|
consts.z = zpos.toFixed(2);
|
||||||
consts.Z = consts.z;
|
consts.Z = consts.z;
|
||||||
|
|
|
||||||
|
|
@ -138,55 +138,59 @@ var gs_kiri_slicer = exports;
|
||||||
countZ(p2.z);
|
countZ(p2.z);
|
||||||
countZ(p3.z);
|
countZ(p3.z);
|
||||||
}
|
}
|
||||||
// detect zLines (curved region tops/bottoms)
|
|
||||||
if (options.cam) {
|
if (options.cam) {
|
||||||
if (p1.z === p2.z && p1.z > bounds.min.z) {
|
if (p1.z === p2.z && p2.z === p3.z && p1.z > bounds.min.z) {
|
||||||
let zkey = p1.z.toFixed(5);
|
// auto-detect flats for cam faces and to avoid slicing directly on flats
|
||||||
let zval = zLines[zkey];
|
var zkey = p1.z.toFixed(5),
|
||||||
zLines[zkey] = (zval || 0) + 1;
|
area = Math.abs(UTIL.area2(p1,p2,p3)) / 2;
|
||||||
}
|
if (!zFlat[zkey]) {
|
||||||
if (p2.z === p3.z && p2.z > bounds.min.z) {
|
zFlat[zkey] = area;
|
||||||
let zkey = p2.z.toFixed(5);
|
} else {
|
||||||
let zval = zLines[zkey];
|
zFlat[zkey] += area;
|
||||||
zLines[zkey] = (zval || 0) + 1;
|
}
|
||||||
}
|
} else if (false) {
|
||||||
if (p3.z === p1.z && p3.z > bounds.min.z) {
|
// detect zLines (curved region tops/bottoms)
|
||||||
let zkey = p3.z.toFixed(5);
|
// mark these layers for ball mills only
|
||||||
let zval = zLines[zkey];
|
if (p1.z === p2.z && p1.z > bounds.min.z) {
|
||||||
zLines[zkey] = (zval || 0) + 1;
|
let zkey = p1.z.toFixed(5);
|
||||||
}
|
let zval = zLines[zkey];
|
||||||
}
|
zLines[zkey] = (zval || 0) + 1;
|
||||||
// auto-detect flats for cam faces and to avoid slicing directly on flats
|
}
|
||||||
if (p1.z === p2.z && p2.z === p3.z && p1.z > bounds.min.z) {
|
if (p2.z === p3.z && p2.z > bounds.min.z) {
|
||||||
var zkey = p1.z.toFixed(5),
|
let zkey = p2.z.toFixed(5);
|
||||||
area = Math.abs(UTIL.area2(p1,p2,p3)) / 2;
|
let zval = zLines[zkey];
|
||||||
if (!zFlat[zkey]) {
|
zLines[zkey] = (zval || 0) + 1;
|
||||||
zFlat[zkey] = area;
|
}
|
||||||
} else {
|
if (p3.z === p1.z && p3.z > bounds.min.z) {
|
||||||
zFlat[zkey] += area;
|
let zkey = p3.z.toFixed(5);
|
||||||
|
let zval = zLines[zkey];
|
||||||
|
zLines[zkey] = (zval || 0) + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let zlk, zlv;
|
// translate zLines to zFlats
|
||||||
// detect zLines bottoms and translate to zFlats
|
if (options.cam) {
|
||||||
Object.entries(zLines)
|
let zlk, zlv;
|
||||||
.map(v => [v[0], v[1], parseFloat(v[0])])
|
Object.entries(zLines)
|
||||||
.sort((a,b) => {
|
.map(v => [v[0], v[1], parseFloat(v[0])])
|
||||||
return a[2] - b[2]
|
.sort((a,b) => {
|
||||||
})
|
return a[2] - b[2]
|
||||||
.forEach(zl => {
|
})
|
||||||
if (zlk) {
|
.forEach(zl => {
|
||||||
if (zlv != zl[1]) {
|
if (zlk) {
|
||||||
zFlat[zlk] = zlv;
|
if (zlv != zl[1]) {
|
||||||
|
zFlat[zlk] = zlv;
|
||||||
|
zlv = zl[1];
|
||||||
|
}
|
||||||
|
zlk = zl[0];
|
||||||
|
} else {
|
||||||
|
zlk = zl[0];
|
||||||
zlv = zl[1];
|
zlv = zl[1];
|
||||||
}
|
}
|
||||||
zlk = zl[0];
|
});
|
||||||
} else {
|
}
|
||||||
zlk = zl[0];
|
|
||||||
zlv = zl[1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/** bucket polygons into z-bounded groups */
|
/** bucket polygons into z-bounded groups */
|
||||||
var bucketCount = Math.max(1, Math.ceil(zMax / (zSum / points.length)) - 1);
|
var bucketCount = Math.max(1, Math.ceil(zMax / (zSum / points.length)) - 1);
|
||||||
|
|
|
||||||
2
notes.md
2
notes.md
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
# FDM todo
|
# FDM todo
|
||||||
|
|
||||||
* fingerprint layer once and re-use for infill and layer diffs
|
* gradient infill https://www.youtube.com/watch?v=hq53gsYREHU&feature=emb_logo
|
||||||
* disable infill fingerprinting for gyroids
|
* disable infill fingerprinting for gyroids
|
||||||
* first layer segment large flat areas for better fill reliability
|
* first layer segment large flat areas for better fill reliability
|
||||||
* adaptive column to compensate for fine or layers that finish too quickly and melt
|
* adaptive column to compensate for fine or layers that finish too quickly and melt
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
"M109 S160 ; wait for extruder temporary high enough temp",
|
"M109 S160 ; wait for extruder temporary high enough temp",
|
||||||
"G28 W ; home all without mesh bed level",
|
"G28 W ; home all without mesh bed level",
|
||||||
"G80 ; mesh bed leveling",
|
"G80 ; mesh bed leveling",
|
||||||
|
"G90 ; set absolute positioning mode",
|
||||||
|
"M83 ; set relative positioning for extruder",
|
||||||
"G1 Y-3.0 F1000.0 ; go outside print area",
|
"G1 Y-3.0 F1000.0 ; go outside print area",
|
||||||
"M104 S{temp} ; set extruder actual required temp",
|
"M104 S{temp} ; set extruder actual required temp",
|
||||||
"M109 S{temp} ; wait for extruder actual required temp",
|
"M109 S{temp} ; wait for extruder actual required temp",
|
||||||
|
|
@ -28,7 +30,6 @@
|
||||||
},
|
},
|
||||||
"settings":{
|
"settings":{
|
||||||
"origin_center": false,
|
"origin_center": false,
|
||||||
"extrude_abs": true,
|
|
||||||
"bed_width": 250,
|
"bed_width": 250,
|
||||||
"bed_depth": 210,
|
"bed_depth": 210,
|
||||||
"build_height": 210
|
"build_height": 210
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue