diff --git a/src/mesh/api.js b/src/mesh/api.js index b38aa588..7f7d948c 100644 --- a/src/mesh/api.js +++ b/src/mesh/api.js @@ -405,6 +405,7 @@ const tool = { api.log.emit('isolating bodies').pin(); let promises = []; let mcore = new Matrix4().makeRotationX(Math.PI / 2); + let mark = Date.now(); for (let m of models) { let p = worker.model_isolate({ id: m.id }).then(bodies => { bodies = bodies.map(vert => new mesh.model({ @@ -417,23 +418,24 @@ const tool = { } Promise.all(promises).then(() => { api.log.emit('isolation complete').unpin(); + // api.log.emit(`... isolate time = ${Date.now() - mark}`); }); }, - mapFaces(models, opt = {}) { + indexFaces(models, opt = {}) { models = fallback(models); api.log.emit('mapping faces').pin(); let promises = []; let mark = Date.now(); for (let m of models) { - let p = worker.model_mapFaces({ id: m.id, opt }).then(data => { + let p = worker.model_indexFaces({ id: m.id, opt }).then(data => { // console.log({map_info: data}); }); promises.push(p); } Promise.all(promises).then(() => { api.log.emit('mapping complete').unpin(); - api.log.emit(`... map time = ${Date.now() - mark}`); + // api.log.emit(`... index time = ${Date.now() - mark}`); }); }, @@ -508,7 +510,7 @@ const mode = { check() { if (prefs.map.mode === modes.surface) { - tool.mapFaces(); + tool.indexFaces(); } }, diff --git a/src/mesh/tool.js b/src/mesh/tool.js index ff9fbc77..e1b85507 100644 --- a/src/mesh/tool.js +++ b/src/mesh/tool.js @@ -9,6 +9,7 @@ gapp.register("mesh.tool", [], (root, exports) => { const { mesh } = root; const { geom } = mesh; const { Vector3 } = THREE; +const empty = 0xffffffff; /** * tool for identiying defects and healing them @@ -100,49 +101,6 @@ mesh.tool = class MeshTool { return this; } - generateFaceMap(vertices) { - this.vertices = this.checkVertices(vertices, 3); - const normals = this.normals = []; - const sides = this.sides = []; - const _va = new Vector3(); - const _vb = new Vector3(); - const _vc = new Vector3(); - for (let i=0, ni=0, l=vertices.length; i (v * prec) | 0); - const sidekeyid = {}; - const side2face = this.side2face = []; - for (let i=0, side=0, face=0, l=vround.length; i