diff --git a/Cabinet v2.5 con eje.glb b/Cabinet v2.5 con eje.glb new file mode 100644 index 0000000..c3da2bf Binary files /dev/null and b/Cabinet v2.5 con eje.glb differ diff --git a/compare.html b/compare.html new file mode 100644 index 0000000..af7fa7a --- /dev/null +++ b/compare.html @@ -0,0 +1,166 @@ + + + + + Model Comparison Tool + + + +

πŸ” GLB Model Comparison Tool

+
Loading models...
+
+ + + + + + diff --git a/compare_models.js b/compare_models.js new file mode 100644 index 0000000..d4bd78f --- /dev/null +++ b/compare_models.js @@ -0,0 +1,22 @@ +import * as THREE from 'three'; +import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; +import fs from 'fs'; +import { Blob } from 'buffer'; + +// Simulating a browser environment for Three.js in Node +global.Blob = Blob; + +async function inspectModels() { + const loader = new GLTFLoader(); + + const file1 = 'd:/Bitua-3D-Explorer/Bita-3D-Explorer/V2.5.1 AAA ENSAMBLE CABINET MAIN REVIT puerta cerrada.glb'; + const file2 = 'd:/Bitua-3D-Explorer/Bita-3D-Explorer/V2.5.1 AAA ENSAMBLE CABINET MAIN REVIT puerta abierta.glb'; + + console.log('--- Model Comparison ---'); + + // Note: In Node we can't easily load GLB directly with GLTFLoader without more setup + // I will use a simple script in the browser console instructions instead if this is too complex for Node. + // However, I can just use Three.js in the browser directly. +} + +console.log('Inspector script ready. Actually, I can just update index.html to log these comparisons.'); diff --git a/extract_hinges.js b/extract_hinges.js new file mode 100644 index 0000000..61ae0e8 --- /dev/null +++ b/extract_hinges.js @@ -0,0 +1,50 @@ +const fs = require('fs'); + +try { + const data = fs.readFileSync('Cabinet v2.5 con eje.glb').toString('binary'); + const names = new Set(); + + // Find json part + const jsonStart = data.indexOf('{"'); + if (jsonStart > -1) { + let jsonEnd = data.indexOf('BIN\x00'); + if (jsonEnd === -1) { + jsonEnd = data.indexOf('BIN'); + } + let jsonStr; + if (jsonEnd > -1) { + // 8 bytes chunk header before BIN + jsonStr = data.slice(jsonStart, jsonEnd - 8); + } else { + jsonStr = data.slice(jsonStart, Math.min(jsonStart + 1000000, data.length)); + } + + try { + const parsed = JSON.parse(jsonStr); + const nodes = parsed.nodes || []; + nodes.forEach(n => { + if (n.name && n.name.toUpperCase().includes('BISAGRA')) { + names.add(n.name); + } else if (n.name && (n.name.toUpperCase().includes('FIJA') || n.name.toUpperCase().includes('MOVIL') || n.name.toUpperCase().includes('PANEL'))) { + names.add(n.name); + } + }); + console.log("JSON Parse successful."); + console.log([...names].sort()); + } catch (e) { + console.log("Failed parsing JSON:", e.message); + // fallback + const parts = data.split('"name":"'); + for (let i = 1; i < parts.length; i++) { + const name = parts[i].split('"')[0]; + if (name.toUpperCase().includes('BISAGRA') || name.toUpperCase().includes('FIJA') || name.toUpperCase().includes('MOVIL') || name.toUpperCase().includes('PANEL')) { + names.add(name); + } + } + console.log("Fallback extraction:"); + console.log([...names].sort()); + } + } +} catch(e) { + console.error(e); +} diff --git a/find_led.js b/find_led.js new file mode 100644 index 0000000..c9702e1 --- /dev/null +++ b/find_led.js @@ -0,0 +1,23 @@ +const fs = require('fs'); + +function findBarra(filePath) { + const buffer = fs.readFileSync(filePath); + const content = buffer.toString('utf8'); + + // Find all occurrences of names starting with "Bar" or "led" + const regex = /"name"\s*:\s*"([^"]*bar[^"]*)"/gi; + let match; + const results = new Set(); + while ((match = regex.exec(content)) !== null) { + results.add(match[1]); + } + + const regex2 = /"name"\s*:\s*"([^"]*led[^"]*)"/gi; + while ((match = regex2.exec(content)) !== null) { + results.add(match[1]); + } + + console.log('Found names:', Array.from(results)); +} + +findBarra('Cabinet v2.5 con eje.glb'); diff --git a/index.html b/index.html index 2ad0b60..a4b8ab3 100644 --- a/index.html +++ b/index.html @@ -1,75 +1,992 @@ + - Bitua 3D Explorer - + Bitua 3D Explorer - Interactive + +
+
Initializing Experience...
+
+
+
+
+
-

Bitua 3D Explorer

-

Smart Cabinet

+

Bitua 3D Explorer - GREEN V2.1

+

Smart Cabinet Series (Updated)

-
- - + + -
- πŸ–±οΈ Left Click: Rotate | πŸ–±οΈ Right Click: Pan | βš™οΈ Scroll: Zoom +
+ +
Click to interact
-
-

Created with Autodesk Inventor & GitHub Pages by MartΓ­n Serey

-
+
+ πŸ–±οΈ Click to interact | Right-click to pan | Simulator on the right +
+ + + + + \ No newline at end of file diff --git a/list_names.js b/list_names.js new file mode 100644 index 0000000..a0e8140 --- /dev/null +++ b/list_names.js @@ -0,0 +1,21 @@ +const fs = require('fs'); + +function listAllNames(filePath) { + const buffer = fs.readFileSync(filePath); + + // Simple way to find names in a GLB: look for the JSON chunk + const jsonBuf = buffer.slice(20, 20 + buffer.readUInt32LE(12)); + const gltf = JSON.parse(jsonBuf.toString()); + + console.log('--- MESHES ---'); + if (gltf.meshes) { + gltf.meshes.forEach(m => console.log(m.name)); + } + + console.log('\n--- NODES ---'); + if (gltf.nodes) { + gltf.nodes.forEach(n => console.log(n.name)); + } +} + +listAllNames('Cabinet v2.5 con eje.glb'); diff --git a/print_hierarchy.js b/print_hierarchy.js new file mode 100644 index 0000000..99464f4 --- /dev/null +++ b/print_hierarchy.js @@ -0,0 +1,7 @@ +import * as THREE from 'three'; +import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'; +import fs from 'fs'; + +// To run this in node, I need to do something simpler since I don't have a DOM. +// Actually, let's just use `parse` from gltf-pipeline or just regular expression on the JSON string. +// I will just read the GLB JSON header.