replace fill density with fill spacing for consistency with shells

This commit is contained in:
Stewart Allen 2017-10-30 11:06:12 -04:00
commit fbe99720a0
4 changed files with 20 additions and 27 deletions

View file

@ -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 = [] });