(svgString, size = 16)
| 14607 | const simpleLight = new THREE.DirectionalLight(0xffffff, 1.0); |
| 14608 | simpleLight.position.set(1, 1, 1).normalize(); |
| 14609 | scene.add(simpleLight); |
| 14610 | } |
| 14611 | |
| 14612 | // Use loadModel function which has proper path encoding handling and embedded image check |
| 14613 | // loadModel is available globally via window.loadModel |
| 14614 | const loadModelFunc = window.loadModel || loadModel; |
| 14615 | if (!loadModelFunc) { |
| 14616 | throw new Error('loadModel function is not available.'); |
| 14617 | } |
| 14618 | |
| 14619 | // Add a timeout to prevent hanging indefinitely (e.g. on network shares or parsing errors) |
| 14620 | const timeoutMs = 30000; // 30 seconds should be enough even for large models |
| 14621 | let timeoutId; |
| 14622 | const timeoutPromise = new Promise((_, reject) => { |
| 14623 | timeoutId = setTimeout(() => reject(new Error(`Loading model timed out after ${timeoutMs}ms`)), timeoutMs); |
no outgoing calls
no test coverage detected