diff --git a/templates/index.html b/templates/index.html index 8cf3314..12cda52 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1288,6 +1288,7 @@ }); // Request 3D model + console.log('Requesting 3D model for:', footprintName, 'at', selectedFootprintLibraryPath); socket.emit('get_footprint_model', { library_path: selectedFootprintLibraryPath, footprint_name: footprintName @@ -1302,10 +1303,12 @@ }); socket.on('model_result', (data) => { + console.log('Received model_result:', data); const container = document.getElementById('modelViewerContainer'); const messageEl = document.getElementById('modelViewerMessage'); if (data.has_model) { + console.log('Model found, displaying viewer'); container.style.display = 'block'; messageEl.innerHTML = `3D Model Found: ${data.name}

` + `Note: STEP file viewing in browser requires conversion to STL/OBJ format.
` + @@ -1313,6 +1316,7 @@ `Download ${data.name}`; } else { + console.log('No model found'); container.style.display = 'none'; } }); @@ -1498,6 +1502,9 @@ setTimeout(() => { footprintSelect.value = footprintName; socket.emit('render_footprint', { library_path: lib.path, footprint_name: footprintName }); + // Also request 3D model + console.log('Requesting 3D model for loaded part:', footprintName, 'at', lib.path); + socket.emit('get_footprint_model', { library_path: lib.path, footprint_name: footprintName }); }, 500); } }