mirror of
https://github.com/CNCKitchen/stlTexturizer.git
synced 2026-04-07 22:11:32 +00:00
feat: update theme toggle button text and adjust UV mapping threshold for improved rendering
This commit is contained in:
+2
-2
@@ -32,8 +32,8 @@
|
|||||||
<span>CNC Kitchen STL Texturizer</span>
|
<span>CNC Kitchen STL Texturizer</span>
|
||||||
</div>
|
</div>
|
||||||
<button id="theme-toggle" class="theme-toggle" title="Toggle light / dark mode" aria-label="Toggle light/dark mode" style="margin-left:auto">
|
<button id="theme-toggle" class="theme-toggle" title="Toggle light / dark mode" aria-label="Toggle light/dark mode" style="margin-left:auto">
|
||||||
<span class="icon-moon">Dark</span>
|
<span class="icon-moon">Dark Theme</span>
|
||||||
<span class="icon-sun">Light</span>
|
<span class="icon-sun">Light Theme</span>
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ export function computeUV(pos, normal, mode, settings, bounds) {
|
|||||||
const C = TWO_PI * Math.max(r, 1e-6);
|
const C = TWO_PI * Math.max(r, 1e-6);
|
||||||
const rx = pos.x - center.x;
|
const rx = pos.x - center.x;
|
||||||
const ry = pos.y - center.y;
|
const ry = pos.y - center.y;
|
||||||
if (Math.abs(normal.z) > 0.5) {
|
if (Math.abs(normal.z) > 0.7) {
|
||||||
// Cap face — normalise by C so one tile = same world size as on the side
|
// Cap face — normalise by C so one tile = same world size as on the side
|
||||||
u = rx / C + 0.5;
|
u = rx / C + 0.5;
|
||||||
v = ry / C + 0.5;
|
v = ry / C + 0.5;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ const fragmentShader = /* glsl */`
|
|||||||
// fills the diameter × diameter square so the disc looks fully textured.
|
// fills the diameter × diameter square so the disc looks fully textured.
|
||||||
float r = max(boundsSize.x, boundsSize.y) * 0.5;
|
float r = max(boundsSize.x, boundsSize.y) * 0.5;
|
||||||
float C = TWO_PI * max(r, 1e-4);
|
float C = TWO_PI * max(r, 1e-4);
|
||||||
if (abs(vModelNormal.z) > 0.5) {
|
if (abs(vModelNormal.z) > 0.7) {
|
||||||
// Cap face — normalise by C so one tile = same world size as on the side
|
// Cap face — normalise by C so one tile = same world size as on the side
|
||||||
return sampleMap(vec2(
|
return sampleMap(vec2(
|
||||||
rel.x / C + 0.5,
|
rel.x / C + 0.5,
|
||||||
|
|||||||
Reference in New Issue
Block a user