This commit is contained in:
@@ -8,7 +8,8 @@
|
|||||||
"Bash(timeout 8 npx tsx src/server/app.ts)",
|
"Bash(timeout 8 npx tsx src/server/app.ts)",
|
||||||
"Bash(node -e \"import\\('occt-import-js'\\).then\\(m => { console.log\\('occt-import-js loaded OK, keys:', Object.keys\\(m\\)\\) }\\).catch\\(e => console.error\\('FAIL:', e.message\\)\\)\")",
|
"Bash(node -e \"import\\('occt-import-js'\\).then\\(m => { console.log\\('occt-import-js loaded OK, keys:', Object.keys\\(m\\)\\) }\\).catch\\(e => console.error\\('FAIL:', e.message\\)\\)\")",
|
||||||
"Bash(timeout 8 npx tsx --env-file=.env src/server/app.ts)",
|
"Bash(timeout 8 npx tsx --env-file=.env src/server/app.ts)",
|
||||||
"Bash(del \"D:\\\\REMOTE CODING\\\\stepview\\\\.gitea\\\\workflows\\\\build.yml\")"
|
"Bash(del \"D:\\\\REMOTE CODING\\\\stepview\\\\.gitea\\\\workflows\\\\build.yml\")",
|
||||||
|
"Bash(npm run *)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,12 +286,32 @@ async function loadStepGeometry(): Promise<void> {
|
|||||||
fitCamera(group)
|
fitCamera(group)
|
||||||
addGrid(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')
|
const treeContent = document.getElementById('tree-content')
|
||||||
if (data.tree) {
|
if (!treeContent) return // not a STEP model or panel removed
|
||||||
wireTreePanel(data.tree)
|
|
||||||
} else if (treeContent) {
|
if (!data.tree) {
|
||||||
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>'
|
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) -------------------------
|
// ---- STL loader (client-side, Three.js built-in) -------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user