replace fill density with fill spacing for consistency with shells
This commit is contained in:
parent
6032b8a794
commit
fbe99720a0
4 changed files with 20 additions and 27 deletions
|
|
@ -44,6 +44,7 @@ var gs_kiri_fdm = exports;
|
|||
firstOffset = spri.nozzleSize / 2,
|
||||
shellOffset = spri.nozzleSize * spro.sliceShellSpacing,
|
||||
fillOffset = shellOffset * settings.synth.fillOffsetMult,
|
||||
fillSpacing = spri.nozzleSize * spro.sliceFillSpacing,
|
||||
sliceFillAngle = spro.sliceFillAngle,
|
||||
view = widget.mesh && widget.mesh.newGroup ? widget.mesh.newGroup() : null;
|
||||
|
||||
|
|
@ -101,7 +102,7 @@ var gs_kiri_fdm = exports;
|
|||
spro.sliceFillSparse > 0.95
|
||||
) && !spro.sliceVase;
|
||||
slice.doShells(spro.sliceShells, firstOffset, shellOffset, fillOffset, spro.sliceVase);
|
||||
if (solid) slice.doSolidLayerFill(spri.nozzleSize, sliceFillAngle, spro.sliceFillDensity);
|
||||
if (solid) slice.doSolidLayerFill(fillSpacing, sliceFillAngle);
|
||||
sliceFillAngle += 90.0;
|
||||
}, "offsets");
|
||||
|
||||
|
|
@ -115,7 +116,7 @@ var gs_kiri_fdm = exports;
|
|||
slice.projectBridges(solidLayers);
|
||||
}, "solids");
|
||||
forSlices(0.35, 0.5, function(slice) {
|
||||
slice.doSolidsFill(spri.nozzleSize, sliceFillAngle, spro.sliceFillDensity, minSolid);
|
||||
slice.doSolidsFill(fillSpacing, sliceFillAngle, minSolid);
|
||||
sliceFillAngle += 90.0;
|
||||
}, "solids");
|
||||
}
|
||||
|
|
@ -133,7 +134,7 @@ var gs_kiri_fdm = exports;
|
|||
// sparse layers only present when non-vase mose and sparse % > 0
|
||||
if (!spro.sliceVase && spro.sliceFillSparse > 0.0) {
|
||||
forSlices(0.8, 1.0, function(slice) {
|
||||
slice.doSparseLayerFill(spri.nozzleSize, spro.sliceFillDensity, spro.sliceFillSparse, widget.getBoundingBox());
|
||||
slice.doSparseLayerFill(fillSpacing, spro.sliceFillSparse, widget.getBoundingBox());
|
||||
}, "infill");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ var gs_kiri_slice = exports;
|
|||
* @param {number} angle
|
||||
* @param {number} density
|
||||
*/
|
||||
PRO.doSolidLayerFill = function(linewidth, angle, density) {
|
||||
PRO.doSolidLayerFill = function(spacing, angle) {
|
||||
this.isSolidFill = false;
|
||||
|
||||
if (this.tops.length === 0) return;
|
||||
|
|
@ -476,9 +476,6 @@ var gs_kiri_slice = exports;
|
|||
|
||||
var debug = (this.index === DBUG.get('z-index')) && DBUG.get('layer-solid');
|
||||
|
||||
// effective nozzle_width: adjusted for desired density
|
||||
var spacing = linewidth * (1 / density);
|
||||
|
||||
this.tops.forEach(function(top) {
|
||||
if (top.inner && top.inner.length > 0) {
|
||||
top.fill_lines = fillArea(top.inner, angle, spacing);
|
||||
|
|
@ -510,18 +507,16 @@ var gs_kiri_slice = exports;
|
|||
* Take output from pluggable sparse infill algorithm and clip to
|
||||
* the bounds of the top polygons and their inner solid areas.
|
||||
*
|
||||
* @param {number} linewidth (nozzle width)
|
||||
* @param {number} density spacing overlap (0.0 - 1.0)
|
||||
* @param {number} spacing space between fill lines
|
||||
* @param {number} percent infill 0.0 - 1.0
|
||||
* @param {Object} bounds -- TODO calc w/out mesh so it can run in a worker
|
||||
*/
|
||||
PRO.doSparseLayerFill = function(linewidth, density, percent, bounds) {
|
||||
PRO.doSparseLayerFill = function(spacing, percent, bounds) {
|
||||
this.isSparseFill = false;
|
||||
if (this.tops.length === 0 || percent === 0.0 || this.isSolidFill) return;
|
||||
|
||||
var scope = this,
|
||||
tops = scope.tops,
|
||||
spacing = linewidth * (1 / density),
|
||||
clib = self.ClipperLib,
|
||||
ctyp = clib.ClipType,
|
||||
ptyp = clib.PolyType,
|
||||
|
|
@ -681,7 +676,7 @@ var gs_kiri_slice = exports;
|
|||
* fill projected areas and store line data
|
||||
* @return {boolean} true if filled, false if not
|
||||
*/
|
||||
PRO.doSolidsFill = function(linewidth, angle, density, minArea) {
|
||||
PRO.doSolidsFill = function(spacing, angle, minArea) {
|
||||
|
||||
var minarea = minArea || 1,
|
||||
scope = this,
|
||||
|
|
@ -716,9 +711,6 @@ var gs_kiri_slice = exports;
|
|||
|
||||
if (debug) DBUG.log(['project', this.index, polys.length, unioned.length, inner.length]);
|
||||
|
||||
// effective nozzle_width: adjusted for desired density
|
||||
var spacing = linewidth * (1 / density);
|
||||
|
||||
// clear old solids and make array for new
|
||||
tops.forEach(function(top) { top.solids = [] });
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ self.kiri.license = exports.LICENSE;
|
|||
sliceShellSpacing: 1,
|
||||
sliceFillAngle: 1,
|
||||
sliceFillOverlap: 1,
|
||||
sliceFillDensity: 1,
|
||||
sliceFillSpacing: 1,
|
||||
sliceFillSparse: 1,
|
||||
sliceSupportEnable: 1,
|
||||
sliceSupportDensity: 1,
|
||||
|
|
@ -226,7 +226,7 @@ self.kiri.license = exports.LICENSE;
|
|||
sliceShellSpacing: 0.9,
|
||||
sliceFillAngle: 45,
|
||||
sliceFillOverlap: 0.5,
|
||||
sliceFillDensity: 1.0,
|
||||
sliceFillSpacing: 1.0,
|
||||
sliceFillSparse: 0.5,
|
||||
|
||||
sliceSupportEnable: false,
|
||||
|
|
@ -2222,7 +2222,7 @@ self.kiri.license = exports.LICENSE;
|
|||
sliceShells: UC.newInput("shell count", {convert:UC.toInt, modes:FDM}),
|
||||
sliceShellSpacing: UC.newInput("shell spacing", {title:"as a percentage of nozzle width\n< 1.0 causes shell overlap\nrecommended 0.85 - 1.0", convert:UC.toFloat, bound:UC.bound(0.5,1.0), modes:FDM}),
|
||||
sliceFillOverlap: UC.newInput("fill overlap", {title:"overlap with shell\nas % of nozzle width\nhigher bonds better\n0.0 - 1.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}),
|
||||
sliceFillDensity: UC.newInput("fill density", {title:"fill line density\n0.0 - 2.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}),
|
||||
sliceFillSpacing: UC.newInput("fill spacing", {title:"as a percentage of nozzle width\n< 1.0 causes fill overlap\nrecommended 0.85 - 1.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}),
|
||||
sliceFillAngle: UC.newInput("fill angle", {title:"base angle in degrees", convert:UC.toFloat, modes:FDM}),
|
||||
sliceFillSparse: UC.newInput("infill %", {title:"for solid layers\n0.0 - 1.0", convert:UC.toFloat, bound:UC.bound(0.0,1.0), modes:FDM}),
|
||||
sliceSolidMinArea: UC.newInput("solid area", {title:"minimum area (cm^2)\nrequired to keep solid\nmust be > 0.1", convert:UC.toFloat, modes:FDM}),
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
{
|
||||
"pre":[
|
||||
"M118 X15.00 Y15.00 Z10.00 T0",
|
||||
"M104 S{temp} T0 ; set nozzle0 temp",
|
||||
"M107 ; fan off",
|
||||
"G90 ; set absolute positioning",
|
||||
"M132 X Y Z A B ; set axis limits",
|
||||
"M907 X100 Y100 Z40 A80 B20 ; set digital trimpots",
|
||||
"M104 S{temp} T0",
|
||||
"M107",
|
||||
"G90",
|
||||
"M132 X Y Z A B",
|
||||
"M907 X100 Y100 Z40 A80 B20",
|
||||
"; pre-extrude",
|
||||
"G1 X-75 Y-75 Z0.35 F400",
|
||||
"G1 X75 E25 F1800",
|
||||
"G1 Y00 E20 F2400"
|
||||
],
|
||||
"post":[
|
||||
"M107 ; fan off",
|
||||
"M104 S0 T0 ; set nozzle0 temp",
|
||||
"G162 Z ; lower bed",
|
||||
"M18 ; disable all steppers"
|
||||
"M107",
|
||||
"M104 S0 T0",
|
||||
"G162 Z",
|
||||
"M18"
|
||||
],
|
||||
"cmd":{
|
||||
"fan_power": "M106 S{fan_speed}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue