Overview of @jscad/vtree experiments
masterThe @jscad/vtree repository contains experimental implementations aimed at speeding up JSCAD design computation times. The core goal is to move away from recomputing the entire geometry every time a variable changes by implementing a tree-based approach similar to a virtual DOM.
Key concepts explored include:
- Tree Generation: Generating a tree structure of object nodes (containing metadata like dimensions and operands) instead of direct geometry.
- Decoupling: Separating the API from the geometric implementation.
- Caching: Using hashes of JSON-based nodes to cache generated geometry. This allows for 3X to 10X speedups during re-evaluation of scripts.
- Cache Invalidation: Implementing a counter-based system to remove unused geometry/hashes from the in-memory cache after each pass.