update three.js. extract inner funcs from init. fix cache on windows. update clipper
This commit is contained in:
parent
f581e2f89f
commit
a13cdc309f
9 changed files with 8752 additions and 1125 deletions
|
|
@ -104,7 +104,7 @@
|
||||||
|
|
||||||
THREE.Geometry.fromVertices = function(vertices) {
|
THREE.Geometry.fromVertices = function(vertices) {
|
||||||
var geometry = new THREE.BufferGeometry();
|
var geometry = new THREE.BufferGeometry();
|
||||||
geometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
||||||
return geometry;
|
return geometry;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
7629
js/ext-clip2.js
Normal file
7629
js/ext-clip2.js
Normal file
File diff suppressed because it is too large
Load diff
2229
js/kiri-init.js
2229
js/kiri-init.js
File diff suppressed because it is too large
Load diff
|
|
@ -252,14 +252,14 @@ var gs_kiri_widget = exports;
|
||||||
*/
|
*/
|
||||||
PRO.loadVertices = function(vertices) {
|
PRO.loadVertices = function(vertices) {
|
||||||
if (this.mesh) {
|
if (this.mesh) {
|
||||||
this.mesh.geometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
this.mesh.geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
||||||
this.mesh.geometry.computeFaceNormals();
|
this.mesh.geometry.computeFaceNormals();
|
||||||
this.mesh.geometry.computeVertexNormals();
|
this.mesh.geometry.computeVertexNormals();
|
||||||
this.points = null;
|
this.points = null;
|
||||||
return this;
|
return this;
|
||||||
} else {
|
} else {
|
||||||
var geometry = new THREE.BufferGeometry();
|
var geometry = new THREE.BufferGeometry();
|
||||||
geometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
||||||
return this.loadGeometry(geometry);
|
return this.loadGeometry(geometry);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -430,7 +430,7 @@ var gs_kiri_widget = exports;
|
||||||
this.bounds = null;
|
this.bounds = null;
|
||||||
this.setWireframe(false);
|
this.setWireframe(false);
|
||||||
this.clearSlices();
|
this.clearSlices();
|
||||||
mesh.geometry.applyMatrix(new THREE.Matrix4().makeScale(x, y, z));
|
mesh.geometry.applyMatrix4(new THREE.Matrix4().makeScale(x, y, z));
|
||||||
this.center();
|
this.center();
|
||||||
scale.x *= (x || 1.0);
|
scale.x *= (x || 1.0);
|
||||||
scale.y *= (y || 1.0);
|
scale.y *= (y || 1.0);
|
||||||
|
|
@ -447,7 +447,7 @@ var gs_kiri_widget = exports;
|
||||||
this.bounds = null;
|
this.bounds = null;
|
||||||
this.setWireframe(false);
|
this.setWireframe(false);
|
||||||
this.clearSlices();
|
this.clearSlices();
|
||||||
this.mesh.geometry.applyMatrix(new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(x || 0, y || 0, z || 0)));
|
this.mesh.geometry.applyMatrix4(new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(x || 0, y || 0, z || 0)));
|
||||||
this.center();
|
this.center();
|
||||||
let rot = this.orient.rot;
|
let rot = this.orient.rot;
|
||||||
rot.x += (x || 0);
|
rot.x += (x || 0);
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ if (debug) {
|
||||||
try {
|
try {
|
||||||
[
|
[
|
||||||
"license",
|
"license",
|
||||||
"ext-n3d",
|
"ext-n3d", // for math/geometry only
|
||||||
"ext-clip",
|
"ext-clip2",
|
||||||
"add-array",
|
"add-array",
|
||||||
"add-three",
|
"add-three",
|
||||||
"geo",
|
"geo",
|
||||||
|
|
|
||||||
16
js/kiri.js
16
js/kiri.js
|
|
@ -65,7 +65,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
viewMode = VIEWS.ARRANGE,
|
viewMode = VIEWS.ARRANGE,
|
||||||
layoutOnAdd = true,
|
layoutOnAdd = true,
|
||||||
local = SETUP.local,
|
local = SETUP.local,
|
||||||
mouseMoved = false,
|
// mouseMoved = false,
|
||||||
camStock = null,
|
camStock = null,
|
||||||
camTopZ = 0,
|
camTopZ = 0,
|
||||||
topZ = 0,
|
topZ = 0,
|
||||||
|
|
@ -199,10 +199,10 @@ self.kiri.license = exports.LICENSE;
|
||||||
set: setMode,
|
set: setMode,
|
||||||
switch: switchMode
|
switch: switchMode
|
||||||
},
|
},
|
||||||
mouse : {
|
// mouse : {
|
||||||
moved : function() { return mouseMoved },
|
// moved : function() { return mouseMoved },
|
||||||
movedSet : function(b) { mouseMoved = b }
|
// movedSet : function(b) { mouseMoved = b }
|
||||||
},
|
// },
|
||||||
opacity,
|
opacity,
|
||||||
print: {
|
print: {
|
||||||
get: function() { return currentPrint },
|
get: function() { return currentPrint },
|
||||||
|
|
@ -1814,14 +1814,12 @@ self.kiri.license = exports.LICENSE;
|
||||||
UI.ctrlRight.style.display = show ? 'block' : 'none';
|
UI.ctrlRight.style.display = show ? 'block' : 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
SPACE.addEventListener(DOC, 'DOMContentLoaded', function () { KIRI.init() }, false);
|
|
||||||
SPACE.addEventListener(WIN, 'mousemove', function() { mouseMoved = true });
|
|
||||||
|
|
||||||
// prevent safari from exiting full screen mode
|
// prevent safari from exiting full screen mode
|
||||||
DOC.onkeydown = function (evt) { if (evt.keyCode == 27) evt.preventDefault() }
|
DOC.onkeydown = function (evt) { if (evt.keyCode == 27) evt.preventDefault() }
|
||||||
|
|
||||||
// run optional module functions
|
// run optional module functions NOW before kiri-init has run
|
||||||
if (Array.isArray(self.kirimod)) {
|
if (Array.isArray(self.kirimod)) {
|
||||||
kirimod.forEach(function(mod) { mod(kiri.api) });
|
kirimod.forEach(function(mod) { mod(kiri.api) });
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,7 @@ function lastmod(path) {
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
function getCachedFile(filePath, cpath, fn) {
|
function getCachedFile(filePath, cpath, fn) {
|
||||||
let cachePath = ".cache/" + cpath
|
let cachePath = ".cache/" + cpath.replace(/\//g,'_'),
|
||||||
.replace(/\//g,'_')
|
|
||||||
.replace(/\\/g,'_')
|
|
||||||
.replace(/:/g,'_'),
|
|
||||||
cached = fileCache[filePath],
|
cached = fileCache[filePath],
|
||||||
now = time();
|
now = time();
|
||||||
|
|
||||||
|
|
@ -185,12 +182,9 @@ function concatCode(array) {
|
||||||
filepath;
|
filepath;
|
||||||
|
|
||||||
array.forEach((file, index) => {
|
array.forEach((file, index) => {
|
||||||
if (file.charAt(0) === "/" || file.indexOf(":\\") > 0) {
|
if (file.charAt(0) === "/") {
|
||||||
filepath = file;
|
filepath = file;
|
||||||
cachepath = "js_mod" + file
|
cachepath = "js_mod" + file.replace(/\//g,'_');
|
||||||
.replace(/\//g,'_')
|
|
||||||
.replace(/\\/g,'_')
|
|
||||||
.replace(/:/g,'_');
|
|
||||||
array[index] = cachepath.substring(3).replace('.js','');
|
array[index] = cachepath.substring(3).replace('.js','');
|
||||||
fileMap[cachepath.replace("js_","js/")] = filepath;
|
fileMap[cachepath.replace("js_","js/")] = filepath;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -797,7 +791,7 @@ let ver = require('../js/license.js'),
|
||||||
script = {
|
script = {
|
||||||
kiri : [
|
kiri : [
|
||||||
"license",
|
"license",
|
||||||
"ext-clip",
|
// "ext-clip2",
|
||||||
"ext-tween",
|
"ext-tween",
|
||||||
"ext-fsave",
|
"ext-fsave",
|
||||||
"add-array",
|
"add-array",
|
||||||
|
|
@ -857,7 +851,7 @@ let ver = require('../js/license.js'),
|
||||||
work : [
|
work : [
|
||||||
"license",
|
"license",
|
||||||
"ext-n3d",
|
"ext-n3d",
|
||||||
"ext-clip",
|
"ext-clip2",
|
||||||
"add-array",
|
"add-array",
|
||||||
"add-three",
|
"add-three",
|
||||||
"geo",
|
"geo",
|
||||||
|
|
|
||||||
7
notes.md
7
notes.md
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
|
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
|
||||||
|
|
||||||
* `C` hide the bed with a checkbox? indication of part outside printable area?
|
* `B` restore settings should restore all mode/device/settings
|
||||||
* `C` set page background color? or dark mode?
|
* `C` set page background color? or dark mode?
|
||||||
* `C` better small screen support (on screen button for hiding side panels, compact selectors)
|
* `C` better small screen support (on screen button for hiding side panels, compact selectors)
|
||||||
|
* `F` implement an in-app bug reporting system
|
||||||
* `F` widget general add-ons (fdm supports, cam tabs)
|
* `F` widget general add-ons (fdm supports, cam tabs)
|
||||||
* `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
|
||||||
|
|
@ -39,12 +40,14 @@
|
||||||
|
|
||||||
# CAM
|
# CAM
|
||||||
|
|
||||||
* `B` import scale off when units are NOT set to "mm"
|
|
||||||
* `B` fix zooming, workspace thickness for larger workspaces
|
* `B` fix zooming, workspace thickness for larger workspaces
|
||||||
* `B` fails in pancaking (clone) when there are no sliced layers (like z bottom too high)
|
* `B` fails in pancaking (clone) when there are no sliced layers (like z bottom too high)
|
||||||
|
* `B` outside cutting direction in roughing mode inverted
|
||||||
|
* `F` send gcode to cncjs
|
||||||
* `F` trapezoidal tabs (in the Z axis)
|
* `F` trapezoidal tabs (in the Z axis)
|
||||||
* `F` lead-in milling
|
* `F` lead-in milling
|
||||||
* `F` ease-in and ease-out especially on tab cut-out start/stop
|
* `F` ease-in and ease-out especially on tab cut-out start/stop
|
||||||
|
* `F` implement z line-only follows for ball/taper
|
||||||
* `F` add option to spiral in vs out (optimal tool life) vs mixed (optimal path)
|
* `F` add option to spiral in vs out (optimal tool life) vs mixed (optimal path)
|
||||||
* `F` add endmill spiral direction to fully respect climb vs conventional
|
* `F` add endmill spiral direction to fully respect climb vs conventional
|
||||||
* `F` add tapered ball mills
|
* `F` add tapered ball mills
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"n3d-threejs": "^72.0.0",
|
"n3d-threejs": "^72.0.0",
|
||||||
"pixi.js": "^4.8.9",
|
"pixi.js": "^4.8.9",
|
||||||
"serve-static": "^1.14.1",
|
"serve-static": "^1.14.1",
|
||||||
"three": "^0.96.0",
|
"three": "^0.114.0",
|
||||||
"tween.js": "^0.14.0",
|
"tween.js": "^0.14.0",
|
||||||
"uglify-es": "^3.3.10",
|
"uglify-es": "^3.3.10",
|
||||||
"validator": "^8.2.0",
|
"validator": "^8.2.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue