enable support detection for belt mode

This commit is contained in:
Stewart Allen 2021-02-14 14:35:50 -05:00
commit ab00bef67a
6 changed files with 20 additions and 9 deletions

View file

@ -26,6 +26,7 @@
* `B` multi-extruder rendering of raft fails to offset the rest of the print * `B` multi-extruder rendering of raft fails to offset the rest of the print
* `B` multi-extruder purge blocks fail to generate properly for rafts * `B` multi-extruder purge blocks fail to generate properly for rafts
* `F` support pillar should conform to part
* `F` more explicit line width control with ranges and min/max adaptive * `F` more explicit line width control with ranges and min/max adaptive
* `F` test outlining solid projected areas (internally) * `F` test outlining solid projected areas (internally)
* `F` control for size of purge block (with 0=disabled) * `F` control for size of purge block (with 0=disabled)

View file

@ -73,9 +73,9 @@
"sliceSupportOffset": 0.4, "sliceSupportOffset": 0.4,
"sliceSupportGap": 1, "sliceSupportGap": 1,
"sliceSupportSize": 6, "sliceSupportSize": 6,
"sliceSupportArea": 1, "sliceSupportArea": 0.5,
"sliceSupportExtra": 0, "sliceSupportExtra": 0,
"sliceSupportAngle": 50, "sliceSupportAngle": 2,
"sliceSupportNozzle": 0, "sliceSupportNozzle": 0,
"sliceSolidMinArea": 10, "sliceSolidMinArea": 10,
"sliceSolidLayers": 3, "sliceSolidLayers": 3,

View file

@ -1715,12 +1715,12 @@
sliceSupportArea: UC.newInput(LANG.sp_area_s, {title:LANG.sp_area_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}), sliceSupportArea: UC.newInput(LANG.sp_area_s, {title:LANG.sp_area_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
sliceSupportExtra: UC.newInput(LANG.sp_xpnd_s, {title:LANG.sp_xpnd_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}), sliceSupportExtra: UC.newInput(LANG.sp_xpnd_s, {title:LANG.sp_xpnd_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}), fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
sliceSupportAngle: UC.newInput(LANG.sp_angl_s, {title:LANG.sp_angl_l, bound:UC.bound(0.0,90.0), convert:UC.toFloat, modes:FDM, show:isNotBelt}), sliceSupportAngle: UC.newInput(LANG.sp_angl_s, {title:LANG.sp_angl_l, bound:UC.bound(0.0,90.0), convert:UC.toFloat, modes:FDM, xshow:isNotBelt}),
sliceSupportEnable: UC.newBoolean(LANG.sp_auto_s, onBooleanClick, {title:LANG.sp_auto_l, modes:FDM, show:isNotBelt}), sliceSupportEnable: UC.newBoolean(LANG.sp_auto_s, onBooleanClick, {title:LANG.sp_auto_l, modes:FDM, show:isNotBelt}),
sliceSupportGen: UC.newRow([ sliceSupportGen: UC.newRow([
UI.ssaGen = UC.newButton(LANG.sp_detect, onButtonClick, {class: "f-col grow a-center"}) UI.ssaGen = UC.newButton(LANG.sp_detect, onButtonClick, {class: "f-col grow a-center"})
], { modes: FDM, class: "ext-buttons f-row grow", show:isNotBelt }), ], { modes: FDM, class: "ext-buttons f-row grow", xshow:isNotBelt }),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM, show:isNotBelt}), fdmSep: UC.newBlank({class:"pop-sep", modes:FDM, show:isNotBelt}),
sliceSupportManual: UC.newRow([ sliceSupportManual: UC.newRow([
(UI.ssmAdd = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-plus"></i>'})), (UI.ssmAdd = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-plus"></i>'})),

View file

@ -2162,6 +2162,7 @@
API.conf.save(); API.conf.save();
let compare = sproc[mode][cproc[mode]]; let compare = sproc[mode][cproc[mode]];
let same = true; let same = true;
if (compare)
for (let [key, val] of Object.entries(compare).filter(v => v[0] !== 'processName')) { for (let [key, val] of Object.entries(compare).filter(v => v[0] !== 'processName')) {
let tval = process[key]; let tval = process[key];
// outputLoopLayers misbehaving and setting null on empty // outputLoopLayers misbehaving and setting null on empty

View file

@ -142,9 +142,10 @@
case api.ui.ssmAdd: return func.sadd(); case api.ui.ssmAdd: return func.sadd();
case api.ui.ssmDun: return func.sdone(); case api.ui.ssmDun: return func.sdone();
case api.ui.ssmClr: case api.ui.ssmClr:
return api.uc.confirm("clear supports?").then(ok => { // return api.uc.confirm("clear supports?").then(ok => {
if (ok) func.sclear(); // if (ok) func.sclear();
}); // });
func.sclear();
} }
}); });
api.event.on("fdm.supports.detect", func.sgen = () => { api.event.on("fdm.supports.detect", func.sgen = () => {

View file

@ -1243,6 +1243,7 @@
} }
FDM.supports = function(settings, widget) { FDM.supports = function(settings, widget) {
let isBelt = settings.device.bedBelt;
let process = settings.process; let process = settings.process;
let size = process.sliceSupportSize; let size = process.sliceSupportSize;
let min = process.sliceSupportArea || 1; let min = process.sliceSupportArea || 1;
@ -1250,7 +1251,9 @@
buf.setAttribute('position', new THREE.BufferAttribute(widget.vertices, 3)); buf.setAttribute('position', new THREE.BufferAttribute(widget.vertices, 3));
let mat = new THREE.MeshBasicMaterial(); let mat = new THREE.MeshBasicMaterial();
let geo = new THREE.Geometry().fromBufferGeometry(buf); let geo = new THREE.Geometry().fromBufferGeometry(buf);
let angle = (Math.PI / 180) * settings.process.sliceSupportAngle; let rad = (Math.PI / 180);
let deg = (180 / Math.PI);
let angle = rad * settings.process.sliceSupportAngle;
let thresh = -Math.sin(angle); let thresh = -Math.sin(angle);
let dir = new THREE.Vector3(0,0,-1) let dir = new THREE.Vector3(0,0,-1)
let add = []; let add = [];
@ -1299,7 +1302,12 @@
point.added = true; point.added = true;
} }
} }
geo.faces.filter(f => f.normal.z < thresh).forEach(face => { let filter = isBelt ? (f) => {
return f.normal.z < thresh && f.normal.y < -0.001;
} : (f) => {
return f.normal.z < thresh;
};
geo.faces.filter(filter).forEach(face => {
let a = geo.vertices[face.a]; let a = geo.vertices[face.a];
let b = geo.vertices[face.b]; let b = geo.vertices[face.b];
let c = geo.vertices[face.c]; let c = geo.vertices[face.c];