Commit Graph

16 Commits

Author SHA1 Message Date
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 7289c2cabc feat: add texture aspect correction for non-square textures in UV mapping 2026-04-02 17:23:24 +02:00
CNCKitchen a5cb0e5671 feat: update normal handling to use area-weighted buffer normals for improved surface rendering 2026-03-20 23:30:56 +01:00
CNCKitchen 30b3e3a257 feat: enhance canvas handling with dynamic dimensions and cover-scaling for image presets 2026-03-20 17:21:16 +01:00
CNCKitchen 981a72af4d Added a 3D Preview 2026-03-19 21:00:33 +01:00
CNCKitchen 43a09e8b14 feat: add seam band width control and integrate with displacement logic for improved blending 2026-03-19 20:12:54 +01:00
CNCKitchen 14987b8587 feat: add symmetric displacement feature with UI integration and update displacement logic 2026-03-19 14:52:21 +01:00
CNCKitchen e555a479fb feat: improve cubic mapping handling for better texture consistency on seams 2026-03-19 14:04:12 +01:00
CNCKitchen 32cc538bfb feat: enhance cubic mapping with smooth normals and blending weights for improved texture transitions 2026-03-19 13:36:21 +01:00
CNCKitchen 32eddcad37 feat: add seam blend feature and amplitude overlap warning with UI updates 2026-03-19 12:08:14 +01:00
CNCKitchen adab788c74 Refactor code structure for improved readability and maintainability 2026-03-18 10:52:39 +01:00
CNCKitchen 1d3e756245 feat: add surface exclusions panel and functionality
- Introduced a new section in the UI for surface exclusions, allowing users to exclude triangles from displacement using brush and bucket fill tools.
- Implemented brush type switching (single and radius) and radius control for the brush tool.
- Added functionality for bucket fill with a threshold angle to control the fill area.
- Integrated exclusion weights into the displacement algorithm to ensure excluded faces are handled correctly during subdivision.
- Created adjacency and centroid calculations for triangles to support the bucket fill operation.
- Developed overlay geometries for visual feedback on excluded faces and hover previews.
- Enhanced the CSS for the new exclusion tools and their layout in the UI.
2026-03-17 14:35:45 +01:00
CNCKitchen 57a42f0815 Enhance UI for scale and offset controls; add surface masking options and improve displacement logic 2026-03-17 12:59:03 +01:00
CNCKitchen 66ee4a2d7d Refactor mapping modes and improve UV mapping logic; update viewer axes and camera settings 2026-03-17 09:05:56 +01:00
CNCKitchen 59b689c9ef Enhance displacement calculation and UV mapping; add gizmo visualization in viewer 2026-03-16 21:09:12 +01:00
CNCKitchen 92e7f487ce initial commit 2026-03-16 20:37:32 +01:00