From 14afaf4d967c6759761044061099da13ad43b47c Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 15 Apr 2022 14:25:36 -0400 Subject: [PATCH] update fog on dark mode change --- src/main/mesh.js | 3 ++- src/mesh/tool.js | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/mesh.js b/src/main/mesh.js index fe0927d3..7e7e3110 100644 --- a/src/main/mesh.js +++ b/src/main/mesh.js @@ -19,7 +19,7 @@ const { broker } = gapp; const { moto } = root; const { space } = moto; -const version = '1.1.0'; +const version = '1.2.0'; const call = broker.send; const dbindex = [ "admin", "space" ]; @@ -528,6 +528,7 @@ function set_darkmode(dark) { colorMinor: 0xeeeeee, }, }); + mesh.api.updateFog(); platform.setSize(); for (let m of model.list()) { m.normals({ refresh: true }); diff --git a/src/mesh/tool.js b/src/mesh/tool.js index ea032364..b478d3dc 100644 --- a/src/mesh/tool.js +++ b/src/mesh/tool.js @@ -108,7 +108,7 @@ mesh.tool = class MeshTool { return this; } - // combines generatedFaces() and generateFaceMap() + // todo: supercede generatedFaces() for patch() // face record: vi1, vi2, vi3, nx, ny, nz // vi = vertex index // n = normal @@ -223,7 +223,7 @@ mesh.tool = class MeshTool { return farr; } - // depends on generateFaceMap() being run first + // depends on index() being run first findConnectedSurface(faces, radians, filterZ, found = {}) { const norms = this.getIndex().faces; if (filterZ) { @@ -260,10 +260,11 @@ mesh.tool = class MeshTool { } } } - this.generateOutlines(faces); return faces; } + // given a list of faces (indices), return an array of closed + // polylines that represent the outlines of each discrete island generateOutlines(list) { const { faces, sides } = this.getIndex(); const prec = this.precision; @@ -338,7 +339,7 @@ mesh.tool = class MeshTool { return outs; } - // depends on generateFaceMap() being run first + // depends on index() being run first isolateBodies() { const verts = this.checkVertices(this.vertices); const bodies = [];