I've provided the conversions to and from JSON for both CAG and CSG. These functions allow CAG / CAG objects to be instantiated via JSON objects as provided by AJAX or other frameworks.
The TO functions just traverse the CSG / CAG objects and convert the critical pieces to JSON.
The FROM functions force prototypes on anonymous objects, which is non-standard but very very fast.
I'll provided some performance numbers later this week, comparing Compact Binary, JSON, and STL conversions.
I also synchronized revisions in OpenJsCad and OpenJSCAD versions. It's critical that all TO functions return BLOBs.
As mentioned in email, ES6 will not support the direct manipulation of object prototypes. Therefore, these changes will become unusable in the near future.
I've provided the conversions to and from JSON for both CAG and CSG. These functions allow CAG / CAG objects to be instantiated via JSON objects as provided by AJAX or other frameworks.
The TO functions just traverse the CSG / CAG objects and convert the critical pieces to JSON. The FROM functions force prototypes on anonymous objects, which is non-standard but very very fast.
I'll provided some performance numbers later this week, comparing Compact Binary, JSON, and STL conversions.
I also synchronized revisions in OpenJsCad and OpenJSCAD versions. It's critical that all TO functions return BLOBs.