Skip to content

[TASK-163][TASK-177] Optimize binary STL parsing & fix KiCanvas lifecycle - #186

Closed
ceoloide wants to merge 13 commits into
mainfrom
feat/task-163-177-stl-opt
Closed

ceoloide wants to merge 13 commits into
mainfrom
feat/task-163-177-stl-opt

Conversation

@ceoloide

Copy link
Copy Markdown
Owner

This PR implements end-to-end binary STL (stlb) parsing and resolves the KiCanvas rendering lifecycle crash:

  1. Updated jscad.worker.ts to output 'stlb' binary format and return the raw ArrayBuffer directly.
  2. Refactored StlPreview.tsx to accept and parse raw ArrayBuffer inputs.
  3. Updated zip.ts download pipeline to write binary buffers.
  4. Resolved KiCanvas element crash by introducing the previewKey prop on PcbPreview to properly reset its custom element lifecycle when loading new configs.

ceoloide added 13 commits July 15, 2026 14:50
- Configured JSCAD compiler to request binary format ('stlb') in jscad.worker.ts, removing the UTF-8 string decoding steps and the regex-based ASCII header replacements.
- Updated CaseOutput['stl'], DownloadObj['content'], and Preview['content'] types in ConfigContext.tsx, Downloads.tsx, and DownloadRow.tsx to support string, ArrayBuffer, and Uint8Array.
- Refactored StlPreview.tsx to accept binary data in the stl prop, bypassing TextEncoder.encode(stlString).buffer and directly feeding the ArrayBuffer to the binary STL parser.
- Added tests in StlPreview.test.tsx for direct ArrayBuffer and Uint8Array inputs.
- Updated the download pipeline in zip.ts to output the binary file data directly when generating download files.
@ceoloide ceoloide closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant