Hello and thank you for creating and maintaining this very impressive library!
I'm trying to use V2 for a simple project and am currently stuck on what I'm sure is a very elementary issue.
I'd like to save an array of rectangles to an SVG file. Originally was hoping to save as PNG, but not sure if this is currently supported?
Referring to the example on the @jscad/openjscad npm page, is it possible to do something like this:
const jscad = require("@jscad/openJscad");
const { rectangle } = require("@jscad/modeling").primitives;
const fs = require("fs");
const input = rectangle({ center: [0, 0], size: [10, 20] });
const outputData = jscad.generateOutput("svg", input);
fs.writeFileSync("panels.svg", outputData.asBuffer());
Running this code, I get these errors:
TypeError: cag._toCSGWall is not a function
at Array.map (<anonymous>)
at CAG.union
at convertToSolid2
at prepareOutput
at Object.generateOutput
Any tips or guidance on how to accomplish this would be greatly appreciated.
Thank you in advance!