jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.58k stars 505 forks source link

fix: x3d defs caching #1338

Closed christopher-krause closed 1 month ago

christopher-krause commented 2 months ago

If we use this parser for multiple files with identical DEF signatures this caching will remove necessary definitions for the x3d.

Now it will be empty for every new parser.

All Submissions:

Note: please do NOT include build files (those generate by the build-xxx commands) with your PR,

Thank you for your help in advance, much appreciated !

z3dev commented 1 month ago

@christopher-krause I like this change, but wonder if ALL the x3d* control variables should be moved inside the createX3DParser() function. Have you tried that?

christopher-krause commented 1 month ago

@z3dev Not yet, for my purpose it was fine to just move this part.

christopher-krause commented 1 month ago

Now you can take a look, all tests passed in this package. Tests for the project are failing because of some kind of Event issue in @jscad/web.

image

z3dev commented 1 month ago

Now you can take a look, all tests passed in this package. Tests for the project are failing because of some kind of Event issue in @jscad/web.

Hmm... i did a clean install from this branch, and ran all the test suites successfully. All CI builds/tests passed as well.

I think these changes are fine.