model tree fix 2
Build and Push Docker Image / build (push) Successful in 13s

This commit is contained in:
jason
2026-04-23 14:15:10 -05:00
parent 3414736b42
commit e31023505f
2 changed files with 26 additions and 5 deletions
+24 -4
View File
@@ -286,12 +286,32 @@ async function loadStepGeometry(): Promise<void> {
fitCamera(group)
addGrid(group)
// Diagnostics — always log tree state so browser console can confirm what arrived
console.log('[StepView] geometry version:', data.version)
console.log('[StepView] mesh count:', data.meshes.length)
console.log('[StepView] data.tree:', data.tree)
const treeContent = document.getElementById('tree-content')
if (data.tree) {
wireTreePanel(data.tree)
} else if (treeContent) {
treeContent.innerHTML = '<p class="text-xs text-gray-500 px-4 py-3">Tree unavailable — reconvert this model in the admin panel to enable.</p>'
if (!treeContent) return // not a STEP model or panel removed
if (!data.tree) {
treeContent.innerHTML = '<p class="text-xs text-gray-500 px-4 py-3">No tree data — open the admin panel, edit this model, and click <strong class="text-gray-400">Retry Processing</strong> to rebuild geometry with tree support.</p>'
return
}
const nodeCount = countNodes(data.tree)
console.log('[StepView] tree node count:', nodeCount)
if (nodeCount === 0) {
treeContent.innerHTML = '<p class="text-xs text-gray-500 px-4 py-3">This file has no named components in its hierarchy.</p>'
return
}
wireTreePanel(data.tree)
}
function countNodes(node: HierarchyNode): number {
return 1 + node.children.reduce((acc, c) => acc + countNodes(c), 0)
}
// ---- STL loader (client-side, Three.js built-in) -------------------------