Commit Graph

99 Commits

Author SHA1 Message Date
CNCKitchen 0998e9ee00 feat: add perspective view toggle and update camera handling 2026-04-07 12:00:05 +02:00
CNCKitchen 03d55d2b5c feat: enhance geometry selection logic for precision mode 2026-04-07 11:14:45 +02:00
CNCKitchen ce5b040972 Merge PR #29: refactor(i18n): split translations into per-language files with lazy loading; add French
- Split monolithic i18n.js into per-language files under js/i18n/
- Lazy-load translations via dynamic import() with caching
- Add French (fr) language support
- Add error handling in _loadLang with English fallback
- Remove duplicated lang.name from per-language files (registry is single source of truth)
- Add dev-time key validation (warns on localhost when keys are missing vs en.js)
- Add missing alerts.fileTooLarge key from main to all language files
- Await async initLang() in main.js (supported by type=module)
2026-04-07 10:46:35 +02:00
CNCKitchen 112bde12f2 Updated License to GPLv3 2026-04-07 10:09:59 +02:00
CNCKitchen e5a4b53b81 Merge PR #17: Performance 2-3x faster pipeline, spatial brush index, fix VRAM leaks, bug fixes, default resolution to 1/250 diagonal 2026-04-07 09:51:28 +02:00
CNCKitchen 498581d8cf feat: enhance language selection and boundary falloff features
- Added a language dropdown selector to replace the previous button-based language toggle.
- Integrated boundary falloff settings into the preview material, allowing for smoother transitions between masked and unmasked areas.
- Updated shaders to utilize boundary falloff attributes for improved visual fidelity in bump-only previews.
- Refactored related CSS styles for the new dropdown and adjusted layout for better usability.
- Introduced new functions for computing boundary attributes and managing edge data textures.
2026-04-07 09:48:45 +02:00
SirMcPotato 35d02e74f6 refactor(i18n): lazy-load per-language files on demand 2026-04-07 02:43:37 +02:00
SirMcPotato 6f63a10609 feat(i18n): add French translations 2026-04-07 02:20:03 +02:00
CNCKitchen 16f5e96751 Update boundaryFalloff setting and add panel subsection heading styles
- Changed boundaryFalloff from 1 to 0 in main.js settings for improved behavior.
- Added new languages ES, PT, JP
2026-04-06 20:16:19 +02:00
CNCKitchen 6fa12b6b7f Merge develop: Add Boundary Falloff / Live Preview (closes #1)
Integrates PR #1 (Add Boundary Falloff / Live Preview) with additional
fixes and improvements:

- Boundary falloff with configurable distance slider
- Live preview with per-vertex and per-fragment falloff computation
- Smooth view-dependent shading for all mask types (exclude, include-only, angle)
- Mask-type-dependent falloff tinting (orange for user masks, grey for angle masks)
- Italian translations for Boundary Falloff
- Performance: skip falloff computation during active masking
- Fix: boundary vertices start at falloff factor 0
- Fix: trailing comma syntax errors in i18n.js
2026-04-06 16:17:16 +02:00
CNCKitchen 027c57a6a9 fix(preview): smooth shading for all masked surfaces
- Remove flat-shaded MeshLambertMaterial overlay that was covering the
  custom shader output on user-masked faces (root cause of static shading)
- Pass smooth interpolated normal (vSmoothNormal) to fragment shader and
  blend toward it on masked faces so they get smooth view-dependent
  lighting instead of flat per-face shading
- Brighten user-mask color to warm orange (0.85, 0.40, 0.15) for better
  visibility of lighting variation on masked surfaces
- Shader now handles all mask visualization consistently: exclude mode
  (orange), include-only mode (orange for unselected), and angle mask
  (grey) all receive identical smooth shading
2026-04-06 16:10:50 +02:00
CNCKitchen 5eb8264f78 feat(preview): mask-type-dependent falloff tinting and uniform shading
- Track whether each boundary is from user masking or angle masking
  via a new boundaryMaskTypeAttr vertex attribute (0=user, 1=angle)
- Pass vUserMask and vMaskType varyings to the fragment shader
- Use consistent teal base color for all surfaces so lighting is
  uniform across masked and textured areas (fixes dark halo artifact)
- Tint the falloff gradient warm red-orange near user-painted masks
  and neutral grey near angle-masked boundaries
2026-04-06 14:34:36 +02:00
CNCKitchen 2e674f67b2 fix(preview): set boundary falloff to 0 at boundary vertices
Boundary vertices (shared between masked and unmasked faces) were
skipped during falloff computation, keeping their falloffAttr at 1.0.
This created a ring of full-intensity texture at the mask border before
the falloff gradient started. Now these vertices correctly get factor 0
(distance to boundary = 0), matching the export behavior.
2026-04-06 14:23:44 +02:00
CNCKitchen 47cc55e5ce fix(i18n): add missing trailing commas in boundary falloff translations (EN, DE) 2026-04-06 14:16:44 +02:00
CNCKitchen e2c90ba7a6 feat(i18n): add Italian translations for Boundary Falloff 2026-04-06 14:07:10 +02:00
CNCKitchen 658fa1b1a1 Merge branch 'main' into develop 2026-04-06 14:03:48 +02:00
CNCKitchen da4cf54e41 Merge branch 'pr/LightDestory/6' into develop 2026-04-06 13:51:21 +02:00
CNCKitchen 9ed626aebb perf: skip boundary falloff computation during active masking 2026-04-06 13:42:28 +02:00
CNCKitchen f39b4b088b Merge branch 'pr/AndrewSink/1' into develop
# Conflicts:
#	js/i18n.js
#	js/main.js
#	js/previewMaterial.js
2026-04-06 13:39:58 +02:00
CNCKitchen fcb4faa460 Merge pull request #6 from LightDestory:it_IT
feat: Improve multi-lang and add italian lang
2026-04-06 13:24:12 +02:00
CNCKitchen 65106482c1 resolved merge issue 2026-04-06 13:23:11 +02:00
Avatarsia 72f6e67127 perf: time-based yield reduces background tab overhead by ~95%
Replace fixed-interval yields (every 4096 iterations) with time-based
yields (every ~100ms of wall time). In foreground tabs this means ~10
yields per second instead of ~50-200, with identical UI responsiveness.

In background tabs where setTimeout(0) is throttled to ~1s, this
reduces overhead from ~200 wasted seconds to ~10 — the export runs
nearly as fast in the background as in the foreground.

Addresses #2 (background tab resource allocation).
2026-04-06 05:23:09 +02:00
Avatarsia 689c192a89 fix: spatial index, decimation overflow, input validation, accessibility
Round 2 of performance and correctness improvements:

- Spatial grid index for brush painting: forEachTriInSphere now queries
  only nearby grid cells instead of scanning all triangles. ~5.7x faster
  for brush operations on 68k+ tri meshes.

- Decimation overflow fix: hasLinkViolation used a fixed 0x200000
  multiplier for vertex-pair keys, overflowing at >2M vertices.
  Now uses dynamic multiplier based on actual vertex count.

- Decimation determinant threshold: solveQ used absolute 1e-10 which
  fails for large coordinates. Now relative to matrix element magnitude.

- 3MF triangle index validation: bounds-check all parsed indices against
  vertex count, throw clear error on corrupt files instead of silent NaN.

- File size limit: reject files >500 MB before loading into memory,
  prevents browser tab crash on oversized files.

- Accessibility: preset swatches now keyboard-navigable (role=button,
  tabindex=0, Enter/Space to select). Modal dialogs trap focus and
  close on Escape.

- Ctrl+click straight line tool: click to set start point, Ctrl+click
  to paint a straight line between points. Ctrl+hover shows preview.

- Precision masking available for radius brush mode.

- Spatial grid rebuilt when entering/leaving precision mode.
2026-04-06 05:14:23 +02:00
Avatarsia 4811b55d5c perf: add CDN preconnect, improve canvas accessibility
- Preconnect hint for jsdelivr CDN (parallelize DNS+TLS handshake).
- Add role="img" and aria-label to viewport canvas for screen readers.
2026-04-06 02:39:12 +02:00
Avatarsia 3c9bcfd75c perf: replace Three.js STLExporter with direct binary writer
Write binary STL directly from BufferGeometry typed arrays using
Uint8Array.set() bulk copies. Eliminates the Three.js STLExporter
overhead: no Mesh/Material creation, no identity matrix multiplication,
no redundant normal recomputation, no per-float DataView calls.
2026-04-06 02:38:58 +02:00
Avatarsia 9b2fb68c47 perf: optimise QEM decimation heap and init phase
- SoAHeap: hole method for bubbleUp/sinkDown (half the typed-array
  writes per heap level vs the old swap approach).
- Seed dedup: Number keys instead of BigInt when vertex count < 94M
  (10-50x faster per key). BigInt fallback for extreme meshes.
- addCreaseQuadrics: encode face pairs as negative numbers instead
  of allocating small arrays per edge.
- Guard 3 (checkFlipped): single branch for corner index instead of
  9 ternary operations per face.
- Yield interval kept at 4096 with setTimeout(0) for reliable UI updates.
2026-04-06 02:38:46 +02:00
Avatarsia d92296754f perf: on-demand rendering, dispose leaks, reduce GC pressure
- Render loop now only calls renderer.render() when the scene actually
  changed (needsRender flag + requestRender export). Idle GPU usage
  drops to near zero.
- Disabled shadow map (no receiver in scene, wasted a full render pass).
- Reuse overlay materials instead of creating new ones every paint frame.
- Dispose CanvasTexture in getEffectiveMapEntry (VRAM leak on every
  slider change).
- Dispose axes/dimension geometry on model reload.
- Reuse Vector3/Quaternion temp objects in pointer/touch/wheel handlers
  instead of allocating ~10 objects per mouse event.
- RAF-batch mousemove for hover/cursor, keep paint events immediate.
- Reuse faceMask buffer attribute when size matches.
- Cache getEffectiveMapEntry result (skip canvas tiling+blur when
  texture and smoothing haven't changed).
- addSmoothNormals: same dedup+flat-array approach as displacement.
2026-04-06 02:38:30 +02:00
Avatarsia 51873fd5fc perf: replace string-key maps with numeric flat arrays in hot paths
Displacement, subdivision and exclusion all used template-string keys
for vertex dedup and edge lookup maps. Replaced with a single numeric
dedup pass + flat typed arrays (Float64Array / Uint8Array), cutting
displacement time by ~2.5x and subdivision by ~2.4x on a 68k tri STL.

- displacement.js: vertex dedup → flat arrays for smooth normals,
  zone areas, masked fractions, displacement cache, excluded set
- subdivision.js: numeric edge keys (a*maxV+b) instead of template strings
- exclusion.js: numeric edge keys, BFS queue.shift() → index pointer,
  adjacency Map → Array, TypedArray.set() for overlay copy
- mapping.js: Math.pow(x,4) → x²·x², cos/sin cached per computeUV call,
  applyTransform signature changed to accept precomputed cos/sin
2026-04-06 02:38:13 +02:00
CNCKitchen d99c97fb24 feat: update README and add GitHub links in header and license section 2026-04-05 13:45:16 +02:00
Alessio Tudisco bb18296dae refactor: improve italian translation 2026-04-05 01:35:27 +02:00
Alessio Tudisco c3c8f56181 feat: dynamic language loading and dropdown list 2026-04-05 00:56:59 +02:00
Alessio Tudisco cfa9c34962 feat: add italian language 2026-04-05 00:36:12 +02:00
CNCKitchen dcbdf344ac feat: add imprint and privacy policy modal with translations 2026-04-04 13:38:15 +02:00
CNCKitchen 1c58ebcc80 feat: added a precision mode for masking 2026-04-03 14:11:40 +02:00
CNCKitchen 3c94df4504 feat: update max triangle limit to 750K and enhance triangle bounding radius calculations 2026-04-03 09:18:44 +02:00
CNCKitchen 7289c2cabc feat: add texture aspect correction for non-square textures in UV mapping 2026-04-02 17:23:24 +02:00
CNCKitchen ccf77c988a feat: increase triangle safety cap to 20M and enhance progress reporting during subdivision 2026-04-02 15:14:53 +02:00
CNCKitchen 6ad91f9707 feat: add dismiss button for store call-to-action and style updates 2026-04-02 10:28:37 +02:00
CNCKitchen 80f597141c feat: enhance pinch-to-zoom with two-finger pan support for touch devices 2026-04-01 15:04:47 +02:00
CNCKitchen fd6eae9fb5 feat: implement custom pivot marker and pinch-to-zoom support for touch devices 2026-04-01 13:46:43 +02:00
CNCKitchen 5b6049bb1e refactor: simplify canvas filter support check 2026-04-01 11:15:35 +02:00
CNCKitchen bc5c4625fc texture smoothing on mac 2026-04-01 10:59:23 +02:00
CNCKitchen f7187bc1df Add new texture images: stripes.png, stripes_02.png, woodgrain_02.jpg, and woodgrain_03.jpg
- Added stripes.png and stripes_02.png with metadata from Adobe Photoshop.
- Included two new woodgrain textures (woodgrain_02.jpg and woodgrain_03.jpg) for enhanced visual variety.
2026-03-31 20:26:25 +02:00
CNCKitchen 88ab1747e7 feat: add texture smoothing feature and update translations for UI consistency 2026-03-31 17:25:24 +02:00
CNCKitchen 668024f5c4 Merge branch 'main' of https://github.com/CNCKitchen/stlTexturizer 2026-03-29 12:08:22 +02:00
CNCKitchen 07f3a79601 feat: update README for improved clarity and add .gitignore for assets 2026-03-29 12:08:14 +02:00
CNCKitchen 64372b6c04 Create CNAME 2026-03-29 11:49:55 +02:00
CNCKitchen 76eb1c7998 feat: support loading multiple model formats (.stl, .obj, .3mf) and update UI accordingly 2026-03-28 16:30:41 +01:00
CNCKitchen a41b500bf2 feat: add cap angle control for cylindrical mapping and update UV calculations 2026-03-28 16:00:17 +01:00
CNCKitchen b0d25f4006 rebranding to BumpMesh 2026-03-27 09:38:59 +01:00