add explicit boolean enable/disable for support

This commit is contained in:
Stewart Allen 2020-04-25 21:20:11 -04:00
commit e0b0b7c1e5
3 changed files with 9 additions and 10 deletions

View file

@ -319,11 +319,12 @@ let gs_kiri_conf = exports;
slaFillDensity: 0, slaFillDensity: 0,
slaFillLine: 0.5, slaFillLine: 0.5,
slaFirstOffset: 0, slaFirstOffset: 0,
slaSupportLayers: 0, slaSupportLayers: 10,
slaSupportDensity: 0, slaSupportDensity: 0.5,
slaSupportSize: 0.6, slaSupportSize: 0.6,
slaSupportPoints: 4, slaSupportPoints: 4,
slaSupportGap: 10 slaSupportGap: 10,
slaSupportEnable: false
} }
}, },
cam:{ cam:{

View file

@ -85,7 +85,7 @@ let gs_kiri_sla = exports;
slices.push(last); slices.push(last);
} }
// prepend raft layers to slices array // prepend raft layers to slices array
if (process.slaSupportLayers) { if (process.slaSupportEnable && process.slaSupportLayers) {
let layers = process.slaSupportLayers, let layers = process.slaSupportLayers,
zoff = height / 2, zoff = height / 2,
snew = [], snew = [],
@ -179,12 +179,9 @@ let gs_kiri_sla = exports;
fillPolys(slice, settings); fillPolys(slice, settings);
}, "infill"); }, "infill");
} }
if (process.slaSupportLayers && process.slaSupportDensity) { if (process.slaSupportEnable && process.slaSupportLayers && process.slaSupportDensity) {
computeSupports(widget, process); 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(); ondone();
}, function(update) { }, function(update) {
return onupdate(0.0 + update * 0.25); return onupdate(0.0 + update * 0.25);

View file

@ -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}), 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"}), 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}), 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}), 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}), 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}), 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}), 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}), 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"}), 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}), 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}),