openbim-components
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -27,2 +27,8 @@ import * as THREE from "three"; | ||
fragmentModelMap: Map<string, string>; | ||
fragmentMeshMap: { | ||
[fragmentID: string]: { | ||
mesh: THREE.Mesh; | ||
index: number; | ||
}; | ||
}; | ||
exclusions: Map<string, Fragment>; | ||
@@ -29,0 +35,0 @@ needsUpdate: boolean; |
@@ -20,2 +20,3 @@ import * as THREE from "three"; | ||
this.fragmentModelMap = new Map(); | ||
this.fragmentMeshMap = {}; | ||
this.exclusions = new Map(); | ||
@@ -130,3 +131,3 @@ this.needsUpdate = false; | ||
} | ||
// TODO: This needs cleanup | ||
// TODO: This needs cleanup and get rid of repeated code | ||
loadBoxes(modelID, boundingBoxes, transparentBoundingBoxes, expressIDTofragmentIDMap) { | ||
@@ -148,2 +149,3 @@ const boxes = Object.values(boundingBoxes); | ||
mesh.setColorAt(i, new THREE.Color(`rgb(${newCol.r},${newCol.g}, ${newCol.b})`)); | ||
this.fragmentMeshMap[fragmentID] = { mesh, index: i }; | ||
this.fragmentColorMap.set(newCol.code, fragmentID); | ||
@@ -158,2 +160,4 @@ } | ||
for (let i = 0; i < boxes2.length; i++) { | ||
const expressID2 = parseInt(expressIDs2[i], 10); | ||
const fragmentID2 = expressIDTofragmentIDMap[expressID2]; | ||
const newCol = this.getNextColor(); | ||
@@ -163,4 +167,3 @@ tempMatrix2.fromArray(boxes2[i]); | ||
mesh2.setColorAt(i, new THREE.Color(`rgb(${newCol.r},${newCol.g}, ${newCol.b})`)); | ||
const expressID2 = parseInt(expressIDs2[i], 10); | ||
const fragmentID2 = expressIDTofragmentIDMap[expressID2]; | ||
this.fragmentMeshMap[fragmentID2] = { mesh: mesh2, index: i }; | ||
this.fragmentModelMap.set(fragmentID2, modelID); | ||
@@ -167,0 +170,0 @@ this.fragmentColorMap.set(newCol.code, fragmentID2); |
{ | ||
"name": "openbim-components", | ||
"main": "dist/index.js", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"packageManager": "yarn@3.2.1", | ||
@@ -6,0 +6,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
549457
8613