background healing in the worker
This commit is contained in:
parent
a899b517e5
commit
3d9564c1d0
4 changed files with 36 additions and 19 deletions
|
|
@ -307,9 +307,8 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
|||
};
|
||||
|
||||
PRO.heal = function(debug) {
|
||||
let mesh = this.debugMesh();
|
||||
mesh.heal();
|
||||
if (debug) {
|
||||
let mesh = this.debugMesh().heal();
|
||||
let verts = mesh.vertices;
|
||||
let edges = mesh.edges;
|
||||
let split = mesh.edges.filter(l => l.split);
|
||||
|
|
@ -342,11 +341,15 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
|||
stack.addLayers(layrz);
|
||||
return { mesh, layrz, stack };
|
||||
}
|
||||
if (mesh.newFaces) {
|
||||
this.loadVertices(mesh.unrolled().toFloat32());
|
||||
return this.modified = true;
|
||||
}
|
||||
return false;
|
||||
return new Promise((resolve, reject) => {
|
||||
KIRI.client.heal(this.getVertices().array, data => {
|
||||
if (data.vertices) {
|
||||
this.loadVertices(data.vertices);
|
||||
this.modified = true;
|
||||
}
|
||||
resolve(this.modified);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
PRO.debugMesh = function(precision) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue