Skip to content

Fix 10 - Avoid storing all scenes in memory before export#11

Open
apausa wants to merge 26 commits into
HEP-FCC:mainfrom
apausa:fix-10
Open

Fix 10 - Avoid storing all scenes in memory before export#11
apausa wants to merge 26 commits into
HEP-FCC:mainfrom
apausa:fix-10

Conversation

@apausa
Copy link
Copy Markdown
Contributor

@apausa apausa commented May 22, 2026

  • Export one scene at a time so each graph is freed instead of accumulating in memory.
  • Remove countRootObjects function as they are already counted later on.
  • Create a nodeWorkarounds.ts file with installPolyfills and normalizePivot functions.
  • Update tests based on these changes.
  • During deduplication, keep a reference to the first occurrence of each object instead of parsing
  • Deload Node.js call stack by turning recursive functions into iterative (which uses the heap).
  • Implement dynamic transparency so inner layers are more opaque than outer ones.

@apausa apausa self-assigned this May 22, 2026
@apausa apausa added the enhancement New feature or request label May 22, 2026
@apausa apausa linked an issue May 22, 2026 that may be closed by this pull request
@apausa apausa changed the title Fix 10 [WIP] Fix 10 May 22, 2026
@apausa apausa changed the title [WIP] Fix 10 [WIP] Fix 10 - Avoid storing all scenes in memory before export May 22, 2026
@apausa apausa linked an issue May 22, 2026 that may be closed by this pull request
@apausa apausa changed the title [WIP] Fix 10 - Avoid storing all scenes in memory before export Fix 10 - Avoid storing all scenes in memory before export May 22, 2026
Comment thread bin/cli.js Outdated
} catch (error) {
console.error(`ERROR: ${error.message}`);
console.error(`
ERROR: ${error.message}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR and CAUSE will show the same message?

Copy link
Copy Markdown
Contributor Author

@apausa apausa Jun 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, it should say error.cause so that it captures the errors in index.ts, whereas error.message captures the errors in cli.js.

`INFO: Exporting the full geometry at the default traversal depth 2. Use a config when you need to:\n
- Hide parts: exclude specific volumes from the output\n
- Group volumes: combine multiple volumes into a single named view\n
`INFO: Exporting the full geometry at the default traversal depth 2. Use a config when you need to:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the new lines be preserved in the INFO message?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because the string uses the ``` quote.

Comment thread src/lib/utils/polyfill.ts Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polyfilling is no longer needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but I turned it into a function which is called in index.ts so that its usage is more evident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement dynamic transparency so inner layers are more opaque than outer ones. Optimize code to avoid getting out of memory errors

2 participants