From e0b0b7c1e5dab2e2a6889ebcfb462a6e2c754ed7 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 25 Apr 2020 21:20:11 -0400 Subject: [PATCH] add explicit boolean enable/disable for support --- js/kiri-conf.js | 7 ++++--- js/kiri-driver-sla.js | 7 ++----- js/kiri-init.js | 5 +++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/js/kiri-conf.js b/js/kiri-conf.js index f4564c0e..eb96eb50 100644 --- a/js/kiri-conf.js +++ b/js/kiri-conf.js @@ -319,11 +319,12 @@ let gs_kiri_conf = exports; slaFillDensity: 0, slaFillLine: 0.5, slaFirstOffset: 0, - slaSupportLayers: 0, - slaSupportDensity: 0, + slaSupportLayers: 10, + slaSupportDensity: 0.5, slaSupportSize: 0.6, slaSupportPoints: 4, - slaSupportGap: 10 + slaSupportGap: 10, + slaSupportEnable: false } }, cam:{ diff --git a/js/kiri-driver-sla.js b/js/kiri-driver-sla.js index fc96126a..aa0ca19c 100644 --- a/js/kiri-driver-sla.js +++ b/js/kiri-driver-sla.js @@ -85,7 +85,7 @@ let gs_kiri_sla = exports; slices.push(last); } // prepend raft layers to slices array - if (process.slaSupportLayers) { + if (process.slaSupportEnable && process.slaSupportLayers) { let layers = process.slaSupportLayers, zoff = height / 2, snew = [], @@ -179,12 +179,9 @@ let gs_kiri_sla = exports; fillPolys(slice, settings); }, "infill"); } - if (process.slaSupportLayers && process.slaSupportDensity) { + if (process.slaSupportEnable && process.slaSupportLayers && process.slaSupportDensity) { computeSupports(widget, process); } - // slices.forEach(slice => { - // console.log(slice.index, slice.z.toFixed(3), (slice.down ? slice.down.z - slice.z : 0).toFixed(3)); - // }); ondone(); }, function(update) { return onupdate(0.0 + update * 0.25); diff --git a/js/kiri-init.js b/js/kiri-init.js index b1062ea0..e512f7a7 100644 --- a/js/kiri-init.js +++ b/js/kiri-init.js @@ -1471,15 +1471,16 @@ var gs_kiri_init = exports; slaBasePeelLiftRate: UC.newInput('peel lift rate', {title:'peel lift speed\nin mm/sec', convert:UC.toFloat, modes:SLA, expert:true}), slaFill: UC.newGroup('infill', null, {modes:SLA, group:"sla-infill"}), - slaFillDensity: UC.newInput('density', {title:'percent infill\n0.0-1.0', convert:UC.toFloat, bound:UC.bound(0,1), modes:SLA}), + slaFillDensity: UC.newInput('density', {title:'percent infill\nrequires shell\n0 = disabled\nvalid 0.0 - 1.0', convert:UC.toFloat, bound:UC.bound(0,1), modes:SLA}), slaFillLine: UC.newInput('line width', {title:'hatch line width\nin millimeters', convert:UC.toFloat, bound:UC.bound(0,5), modes:SLA}), - slaSupport: UC.newGroup('support', null, {modes:SLA, group:"sla-support"}) : null, + slaSupport: UC.newGroup('support', null, {modes:SLA, group:"sla-support"}), slaSupportLayers: UC.newInput('layers', {title:'base support layers\n0-10', convert:UC.toInt, bound:UC.bound(0,10), modes:SLA}), slaSupportDensity: UC.newInput('density', {title:'used to compute the\nnumber of support pillars\n0.0-1.0 (0 = disable)', convert:UC.toFloat, bound:UC.bound(0,1), modes:SLA}), slaSupportSize: UC.newInput('size', {title:'max size of a\nsupport pillar\nin millimeters', convert:UC.toFloat, bound:UC.bound(0,1), modes:SLA}), slaSupportPoints: UC.newInput('points', {title:'number of points in\neach support pillar\nin millimeters', convert:UC.toInt, bound:UC.bound(3,10), modes:SLA, expert:true}), slaSupportGap: UC.newInput('gap layers', {title:'number of layers between\nraft and bottom of obejct', convert:UC.toInt, bound:UC.bound(3,10), modes:SLA, expert:true}), + slaSupportEnable: UC.newBoolean('enable', onBooleanClick, {title:'enable supports', modes:SLA}), slaOutput: UC.newGroup('output', null, {modes:SLA, group:"sla-first"}), slaFirstOffset: UC.newInput('z offset', {title:'z layer offset\nalmost always 0.0\n0.0-1.0 in millimeters', convert:UC.toFloat, bound:UC.bound(0,1), modes:SLA, expert:true}),