checkpoint manual support work

This commit is contained in:
Stewart Allen 2020-11-22 17:01:36 -05:00
commit ace9858018
6 changed files with 74 additions and 18 deletions

View file

@ -663,7 +663,7 @@
d.setAttribute('class', 'col j-center');
d.onclick = function() {
API.selection.for_widgets(w => {
current.widget[w.id] = {extruder: i};
API.widgets.annotate(w.id).extruder = i;
});
API.platform.update_selected();
};
@ -1472,11 +1472,11 @@
sliceSupportOffset: UC.newInput(LANG.sp_offs_s, {title:LANG.sp_offs_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
sliceSupportGap: UC.newInput(LANG.sp_gaps_s, {title:LANG.sp_gaps_l, bound:UC.bound(0,5), convert:UC.toInt, modes:FDM, expert:true}),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
sliceSupportSpan: UC.newInput(LANG.sp_span_s, {title:LANG.sp_span_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM, show: () => UI.sliceSupportEnable.checked}),
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, expert:true}),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
sliceSupportNozzle: UC.newSelect(LANG.sp_nozl_s, {title:LANG.sp_nozl_l, modes:FDM, expert:true}, "extruders"),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
sliceSupportSpan: UC.newInput(LANG.sp_span_s, {title:LANG.sp_span_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM, show: () => UI.sliceSupportEnable.checked}),
sliceSupportEnable: UC.newBoolean(LANG.sp_auto_s, onBooleanClick, {title: LANG.sp_auto_l, modes:FDM, trigger:true}),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
@ -1926,7 +1926,7 @@
if (int && (event.ctrlKey || event.metaKey || API.feature.on_face_select)) {
let q = new THREE.Quaternion();
// find intersecting point, look "up" on Z and rotate to face that
q.setFromUnitVectors(int.face.normal, new THREE.Vector3(0,-1,0));
q.setFromUnitVectors(int.face.normal, new THREE.Vector3(0,0,-1));
API.selection.rotate(q);
}
if (API.view.get() !== VIEWS.ARRANGE) {

View file

@ -311,7 +311,12 @@
for: forAllWidgets,
load: Widget.loadFromCatalog,
meshes: meshArray,
opacity: setOpacity
opacity: setOpacity,
annotate: (id) => {
// add per widget annotation
// for things like extruder and supports
return settings.widget[id] = ( settings.widget[id] || {} );
}
},
work: KIRI.work
};
@ -1158,7 +1163,7 @@
}
forSelectedWidgets(w => {
w.setColor(color.selected, settings);
let ext = (settings.widget[w.id] || {}).extruder || 0;
let ext = API.widgets.annotate(w.id).extruder || 0;
let b = $(`sel-ext-${ext}`);
if (b) b.classList.add('pop-sel');
}, true);

View file

@ -111,6 +111,7 @@
if (groups.indexOf(this.group) < 0) {
groups.push(this.group);
}
// rotation stack (for undo)
this.roto = [];
this.mesh = null;
this.points = null;