smoother animation
This commit is contained in:
parent
4489b37b23
commit
b9f2df0c4b
7 changed files with 44 additions and 39 deletions
|
|
@ -486,7 +486,7 @@ let gs_kiri_conf = exports;
|
||||||
// current device name by mode
|
// current device name by mode
|
||||||
filter:{
|
filter:{
|
||||||
FDM: "Any.Generic.Marlin",
|
FDM: "Any.Generic.Marlin",
|
||||||
SLA: "Any.Generic.SLA",
|
SLA: "Anycubic.Photon",
|
||||||
CAM: "Any.Generic.Grbl",
|
CAM: "Any.Generic.Grbl",
|
||||||
LASER: "Any.Generic.Laser"
|
LASER: "Any.Generic.Laser"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ let gs_kiri_sla = exports;
|
||||||
// slice.tops.forEach(top => { top.solids = [] });
|
// slice.tops.forEach(top => { top.solids = [] });
|
||||||
}, "slice");
|
}, "slice");
|
||||||
forSlices(slices, 0.2, 0.4, (slice) => {
|
forSlices(slices, 0.2, 0.4, (slice) => {
|
||||||
slice.doDiff(0.00001, 0.005);
|
slice.doDiff(0.00001, 0.005, true);
|
||||||
}, "delta");
|
}, "delta");
|
||||||
forSlices(slices, 0.4, 0.5, (slice) => {
|
forSlices(slices, 0.4, 0.5, (slice) => {
|
||||||
slice.projectFlats(process.slaSolids || 5);
|
slice.projectFlats(process.slaSolids || 5);
|
||||||
|
|
|
||||||
|
|
@ -773,11 +773,19 @@ let gs_kiri_slice = exports;
|
||||||
* Used to calculate bridges, flats and then solid projections.
|
* Used to calculate bridges, flats and then solid projections.
|
||||||
* 'expand' is used for top offsets in SLA mode
|
* 'expand' is used for top offsets in SLA mode
|
||||||
*/
|
*/
|
||||||
PRO.doDiff = function(minArea, expand) {
|
PRO.doDiff = function(minArea, expand, fakedown) {
|
||||||
if (!this.down) return;
|
let down = this.down;
|
||||||
|
|
||||||
|
if (!down) {
|
||||||
|
if (fakedown) {
|
||||||
|
down = newSlice(-1);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let top = this,
|
let top = this,
|
||||||
bottom = this.down;
|
bottom = down;
|
||||||
|
|
||||||
top.bridges = null;
|
top.bridges = null;
|
||||||
bottom.flats = null;
|
bottom.flats = null;
|
||||||
|
|
|
||||||
31
js/kiri.js
31
js/kiri.js
|
|
@ -1489,24 +1489,23 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreSettings(save) {
|
function restoreSettings(save) {
|
||||||
let newset = ls2o('ws-settings');
|
let newset = ls2o('ws-settings') || settings;
|
||||||
|
|
||||||
if (newset) {
|
settings = CONF.normalize(newset);
|
||||||
settings = CONF.normalize(newset);
|
// override camera from settings
|
||||||
// override camera from settings
|
if (settings.controller.view) {
|
||||||
if (settings.controller.view) {
|
SDB.removeItem('ws-camera');
|
||||||
SDB.removeItem('ws-camera');
|
|
||||||
}
|
|
||||||
// merge custom filters from localstorage into settings
|
|
||||||
localFilters.forEach(function(fname) {
|
|
||||||
let fkey = "gcode-filter-"+fname, ov = ls2o(fkey);
|
|
||||||
if (ov) settings.devices[fname] = ov;
|
|
||||||
SDB.removeItem(fkey)
|
|
||||||
});
|
|
||||||
SDB.removeItem(localFilterKey);
|
|
||||||
// save updated settings
|
|
||||||
if (save) API.conf.save();
|
|
||||||
}
|
}
|
||||||
|
// merge custom filters from localstorage into settings
|
||||||
|
localFilters.forEach(function(fname) {
|
||||||
|
let fkey = "gcode-filter-"+fname, ov = ls2o(fkey);
|
||||||
|
if (ov) settings.devices[fname] = ov;
|
||||||
|
SDB.removeItem(fkey)
|
||||||
|
});
|
||||||
|
SDB.removeItem(localFilterKey);
|
||||||
|
// save updated settings
|
||||||
|
if (save) API.conf.save();
|
||||||
|
|
||||||
return newset;
|
return newset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -425,12 +425,13 @@ var MOTO = window.moto = window.moto || {};
|
||||||
DOC.activeElement.blur();
|
DOC.activeElement.blur();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
let selection = null,
|
let selection = null,
|
||||||
trackTo = alignedTracking ? trackPlane : platform;
|
trackTo = alignedTracking ? trackPlane : platform,
|
||||||
|
isVis = trackTo.visible;
|
||||||
if (mouseDownSelect) selection = mouseDownSelect();
|
if (mouseDownSelect) selection = mouseDownSelect();
|
||||||
if (selection && selection.length > 0) {
|
if (selection && selection.length > 0) {
|
||||||
trackTo.visible = true;
|
trackTo.visible = true;
|
||||||
let int = intersect(selection.slice().append(trackTo), false);
|
let int = intersect(selection.slice().append(trackTo), false);
|
||||||
trackTo.visible = false;
|
trackTo.visible = isVis;
|
||||||
if (int.length > 0) {
|
if (int.length > 0) {
|
||||||
let trackInt, selectInt;
|
let trackInt, selectInt;
|
||||||
for (let i=0; i<int.length; i++) {
|
for (let i=0; i<int.length; i++) {
|
||||||
|
|
@ -518,9 +519,10 @@ var MOTO = window.moto = window.moto || {};
|
||||||
} else if (mouseDragPoint && mouseDrag && mouseDrag()) {
|
} else if (mouseDragPoint && mouseDrag && mouseDrag()) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
let trackTo = alignedTracking ? trackPlane : platform;
|
let trackTo = alignedTracking ? trackPlane : platform;
|
||||||
|
let vis = trackTo.visible;
|
||||||
trackTo.visible = true;
|
trackTo.visible = true;
|
||||||
int = intersect([trackTo], false);
|
int = intersect([trackTo], false);
|
||||||
trackTo.visible = false;
|
trackTo.visible = vis;
|
||||||
if (int.length > 0 && int[0].object === trackTo) {
|
if (int.length > 0 && int[0].object === trackTo) {
|
||||||
let delta = mouseDragPoint.clone().sub(int[0].point);
|
let delta = mouseDragPoint.clone().sub(int[0].point);
|
||||||
let offset = mouseDragStart.clone().sub(int[0].point);
|
let offset = mouseDragStart.clone().sub(int[0].point);
|
||||||
|
|
@ -673,7 +675,6 @@ var MOTO = window.moto = window.moto || {};
|
||||||
if (trackcam) {
|
if (trackcam) {
|
||||||
trackcam.position.copy(camera.position);
|
trackcam.position.copy(camera.position);
|
||||||
}
|
}
|
||||||
renderer.render(SCENE, camera);
|
|
||||||
if (moved && platformOnMove) {
|
if (moved && platformOnMove) {
|
||||||
clearTimeout(platformMoveTimer);
|
clearTimeout(platformMoveTimer);
|
||||||
platformMoveTimer = setTimeout(platformOnMove, 500);
|
platformMoveTimer = setTimeout(platformOnMove, 500);
|
||||||
|
|
@ -701,10 +702,10 @@ var MOTO = window.moto = window.moto || {};
|
||||||
platform.visible = showPlatform;
|
platform.visible = showPlatform;
|
||||||
|
|
||||||
trackPlane = new THREE.Mesh(
|
trackPlane = new THREE.Mesh(
|
||||||
new THREE.PlaneBufferGeometry(2000, 2000, 1, 1),
|
new THREE.PlaneBufferGeometry(100000, 100000, 1, 1),
|
||||||
new THREE.MeshBasicMaterial( { color: 0x777777, opacity: 0.3, transparent: false, side:THREE.DoubleSide } )
|
new THREE.MeshBasicMaterial( { color: 0x777777, opacity: 0, transparent: true, side:THREE.DoubleSide } )
|
||||||
);
|
);
|
||||||
trackPlane.visible = false;
|
trackPlane.visible = true;
|
||||||
trackPlane.rotation.x = PI2;
|
trackPlane.rotation.x = PI2;
|
||||||
|
|
||||||
let sky = new THREE.Mesh(
|
let sky = new THREE.Mesh(
|
||||||
|
|
@ -734,6 +735,13 @@ var MOTO = window.moto = window.moto || {};
|
||||||
'keypress', keyHandler
|
'keypress', keyHandler
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
function animate() {
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
renderer.render(SCENE, camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
animate();
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
1
notes.md
1
notes.md
|
|
@ -5,6 +5,7 @@
|
||||||
* `F` implement an in-app bug reporting system
|
* `F` implement an in-app bug reporting system
|
||||||
* `F` extend mesh object to store raw + annotations (rot,scale,pos)
|
* `F` extend mesh object to store raw + annotations (rot,scale,pos)
|
||||||
* share raw data w/ dups, encode/decode
|
* share raw data w/ dups, encode/decode
|
||||||
|
* `F` gcode color to speed visualization bar
|
||||||
* `P` bail on decimation if it's proving ineffective
|
* `P` bail on decimation if it's proving ineffective
|
||||||
* `P` improve decimation speed by avoiding in/out of Point?
|
* `P` improve decimation speed by avoiding in/out of Point?
|
||||||
* `P` server-side processing (determine protocol and storage)
|
* `P` server-side processing (determine protocol and storage)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"pre":[],
|
|
||||||
"post":[],
|
|
||||||
"cmd":{},
|
|
||||||
"settings":{
|
|
||||||
"bed_width": 115,
|
|
||||||
"bed_depth": 65,
|
|
||||||
"max_height": 155,
|
|
||||||
"origin_center": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue