mirror of
https://github.com/CNCKitchen/stlTexturizer.git
synced 2026-04-07 22:11:32 +00:00
Refactor mapping modes and improve UV mapping logic; update viewer axes and camera settings
This commit is contained in:
+11
-1
@@ -15,7 +15,7 @@ let previewMaterial = null;
|
||||
let isExporting = false;
|
||||
|
||||
const settings = {
|
||||
mappingMode: 5, // Triplanar default — covers all faces of any shape
|
||||
mappingMode: 6, // Cubic default
|
||||
scaleU: 1.0,
|
||||
scaleV: 1.0,
|
||||
amplitude: 0.5,
|
||||
@@ -228,6 +228,16 @@ async function handleSTL(file) {
|
||||
previewMaterial = null;
|
||||
}
|
||||
|
||||
// Auto-select Brick preset (index 5) on first load
|
||||
const brickIdx = PRESETS.findIndex(p => p.name === 'Brick');
|
||||
if (brickIdx >= 0 && !activeMapEntry) {
|
||||
activeMapEntry = PRESETS[brickIdx];
|
||||
activeMapName.textContent = PRESETS[brickIdx].name;
|
||||
const swatches = document.querySelectorAll('.preset-swatch');
|
||||
swatches.forEach((s, i) => s.classList.toggle('active', i === brickIdx));
|
||||
}
|
||||
mappingSelect.value = String(settings.mappingMode);
|
||||
|
||||
// Show mesh with a default material until a map is selected
|
||||
loadGeometry(geometry);
|
||||
dropHint.classList.add('hidden');
|
||||
|
||||
Reference in New Issue
Block a user