()
| 940 | } |
| 941 | // Expose inverted filters globally so search.js can read the state (keep the same object reference) |
| 942 | window.invertedFilters = invertedFilters; |
| 943 | |
| 944 | // Define loadModel function at top level so it's available immediately (before DOMContentLoaded) |
| 945 | // Helper function to parse zip path format |
| 946 | function parseZipPath(filePath) { |
| 947 | if (filePath.includes('::')) { |
| 948 | const [zipPath, entryPath] = filePath.split('::'); |
| 949 | return { zipPath, entryPath, isZipEntry: true }; |
| 950 | } |
| 951 | return { zipPath: filePath, entryPath: null, isZipEntry: false }; |
| 952 | } |
| 953 | |
| 954 | // Helper function to get model color based on settings |
| 955 | function getModelColor() { |
| 956 | const colorSetting = window.currentRenderColor || '#cccccc'; |
| 957 | |
| 958 | if (colorSetting === 'rainbow') { |
| 959 | return new THREE.Color().setHSL(Math.random(), 1.0, 0.5); |
| 960 | } else if (colorSetting === 'pastel-rainbow') { |
| 961 | return new THREE.Color().setHSL(Math.random(), 1.0, 0.8); |
| 962 | } else { |
| 963 | return new THREE.Color(colorSetting); |
| 964 | } |
| 965 | } |
| 966 | |
| 967 | // Extensions that are valid for library (scan/add). Used for isValidFile. |
| 968 | const EXTENSIONS_VALID_FOR_LIBRARY = new Set(['.stl', '.3mf', '.3ds', '.amf', '.blender', '.dae', '.dxf', '.dwg', '.fbx', '.f3d', '.f3z', '.gcode', '.igs', '.iges', '.lys', '.lyt', '.obj', '.ply', '.step', '.stp', '.svg', '.x3d']); |
| 969 | |
| 970 | // Map file extension (with or without dot) to label for typed placeholder |
| 971 | const EXTENSION_TO_PLACEHOLDER_LABEL = { |
no outgoing calls
no test coverage detected