Commit Graph

14 Commits

Author SHA1 Message Date
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 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 ccf77c988a feat: increase triangle safety cap to 20M and enhance progress reporting during subdivision 2026-04-02 15:14:53 +02:00
CNCKitchen 6723dcb7b0 Refactor surface masking and exclusion features
- Renamed "Surface Mask" section to "Mask Angles" for clarity in index.html.
- Updated translation keys and tooltips to reflect the new terminology in i18n.js.
- Removed the erase toggle button from the exclusion panel and implemented Shift key functionality to toggle erase mode in main.js.
- Adjusted brush radius handling to improve user experience and updated related UI elements in index.html.
- Enhanced the subdivision process to track original face IDs for better masking accuracy in subdivision.js.
- Added CSS styles for new UI elements and improved layout in style.css.
2026-03-21 09:42:08 +01: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 32cc538bfb feat: enhance cubic mapping with smooth normals and blending weights for improved texture transitions 2026-03-19 13:36:21 +01:00
CNCKitchen 0600877849 feat: add store CTA and dimension annotations, update safety cap and translations 2026-03-18 15:17:46 +01:00
CNCKitchen adab788c74 Refactor code structure for improved readability and maintainability 2026-03-18 10:52:39 +01:00
CNCKitchen f88504696d Refactor code structure for improved readability and maintainability 2026-03-18 09:31:21 +01:00
CNCKitchen 598902021a feat: implement surface exclusion mode toggle and enhance exclusion overlay logic 2026-03-17 19:43:46 +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 0e20de00dc Enhance subdivision algorithm to eliminate T-junctions with a two-step edge splitting approach 2026-03-17 11:08:00 +01:00
CNCKitchen 1a23d7d7fa added new triangle decimation 2026-03-17 10:16:50 +01:00
CNCKitchen 92e7f487ce initial commit 2026-03-16 20:37:32 +01:00