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,
|
||||
output = print.output,
|
||||
printPoint = newPoint(0,0,0),
|
||||
firstLayerHeight = process.firstSliceHeight,
|
||||
firstLayerHeight = process.firstSliceHeight || process.sliceHeight,
|
||||
maxLayers = 0,
|
||||
layer = 0,
|
||||
zoff = 0,
|
||||
|
|
@ -561,7 +561,8 @@ var gs_kiri_fdm = exports;
|
|||
emitPerMM = print.extrudePerMM(
|
||||
device.nozzleSize,
|
||||
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 = consts.z;
|
||||
|
|
|
|||
|
|
@ -138,55 +138,59 @@ var gs_kiri_slicer = exports;
|
|||
countZ(p2.z);
|
||||
countZ(p3.z);
|
||||
}
|
||||
// detect zLines (curved region tops/bottoms)
|
||||
if (options.cam) {
|
||||
if (p1.z === p2.z && p1.z > bounds.min.z) {
|
||||
let zkey = p1.z.toFixed(5);
|
||||
let zval = zLines[zkey];
|
||||
zLines[zkey] = (zval || 0) + 1;
|
||||
}
|
||||
if (p2.z === p3.z && p2.z > bounds.min.z) {
|
||||
let zkey = p2.z.toFixed(5);
|
||||
let zval = zLines[zkey];
|
||||
zLines[zkey] = (zval || 0) + 1;
|
||||
}
|
||||
if (p3.z === p1.z && p3.z > bounds.min.z) {
|
||||
let zkey = p3.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) {
|
||||
var zkey = p1.z.toFixed(5),
|
||||
area = Math.abs(UTIL.area2(p1,p2,p3)) / 2;
|
||||
if (!zFlat[zkey]) {
|
||||
zFlat[zkey] = area;
|
||||
} else {
|
||||
zFlat[zkey] += area;
|
||||
if (p1.z === p2.z && p2.z === p3.z && p1.z > bounds.min.z) {
|
||||
// auto-detect flats for cam faces and to avoid slicing directly on flats
|
||||
var zkey = p1.z.toFixed(5),
|
||||
area = Math.abs(UTIL.area2(p1,p2,p3)) / 2;
|
||||
if (!zFlat[zkey]) {
|
||||
zFlat[zkey] = area;
|
||||
} else {
|
||||
zFlat[zkey] += area;
|
||||
}
|
||||
} else if (false) {
|
||||
// detect zLines (curved region tops/bottoms)
|
||||
// mark these layers for ball mills only
|
||||
if (p1.z === p2.z && p1.z > bounds.min.z) {
|
||||
let zkey = p1.z.toFixed(5);
|
||||
let zval = zLines[zkey];
|
||||
zLines[zkey] = (zval || 0) + 1;
|
||||
}
|
||||
if (p2.z === p3.z && p2.z > bounds.min.z) {
|
||||
let zkey = p2.z.toFixed(5);
|
||||
let zval = zLines[zkey];
|
||||
zLines[zkey] = (zval || 0) + 1;
|
||||
}
|
||||
if (p3.z === p1.z && p3.z > bounds.min.z) {
|
||||
let zkey = p3.z.toFixed(5);
|
||||
let zval = zLines[zkey];
|
||||
zLines[zkey] = (zval || 0) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let zlk, zlv;
|
||||
// detect zLines bottoms and translate to zFlats
|
||||
Object.entries(zLines)
|
||||
.map(v => [v[0], v[1], parseFloat(v[0])])
|
||||
.sort((a,b) => {
|
||||
return a[2] - b[2]
|
||||
})
|
||||
.forEach(zl => {
|
||||
if (zlk) {
|
||||
if (zlv != zl[1]) {
|
||||
zFlat[zlk] = zlv;
|
||||
// translate zLines to zFlats
|
||||
if (options.cam) {
|
||||
let zlk, zlv;
|
||||
Object.entries(zLines)
|
||||
.map(v => [v[0], v[1], parseFloat(v[0])])
|
||||
.sort((a,b) => {
|
||||
return a[2] - b[2]
|
||||
})
|
||||
.forEach(zl => {
|
||||
if (zlk) {
|
||||
if (zlv != zl[1]) {
|
||||
zFlat[zlk] = zlv;
|
||||
zlv = zl[1];
|
||||
}
|
||||
zlk = zl[0];
|
||||
} else {
|
||||
zlk = zl[0];
|
||||
zlv = zl[1];
|
||||
}
|
||||
zlk = zl[0];
|
||||
} else {
|
||||
zlk = zl[0];
|
||||
zlv = zl[1];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** bucket polygons into z-bounded groups */
|
||||
var bucketCount = Math.max(1, Math.ceil(zMax / (zSum / points.length)) - 1);
|
||||
|
|
|
|||
2
notes.md
2
notes.md
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
# 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
|
||||
* first layer segment large flat areas for better fill reliability
|
||||
* 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",
|
||||
"G28 W ; home all without mesh bed level",
|
||||
"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",
|
||||
"M104 S{temp} ; set extruder actual required temp",
|
||||
"M109 S{temp} ; wait for extruder actual required temp",
|
||||
|
|
@ -28,7 +30,6 @@
|
|||
},
|
||||
"settings":{
|
||||
"origin_center": false,
|
||||
"extrude_abs": true,
|
||||
"bed_width": 250,
|
||||
"bed_depth": 210,
|
||||
"build_height": 210
|
||||
|
|
|
|||
Loading…
Reference in a new issue