Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
serialize: data => stlSerializer.serialize(data, {binary: false})
}, // CSG to STL ASCII
serialize: (options, data) => stlSerializer.serialize(Object.assign({}, { binary: false }, options), data)
}, // Geom3 to STL ASCII
serialize: data => stlSerializer.serialize(data, {binary: false})
}, // CSG to STL ASCII
const compiled = requireString(code.toString(), modelFile);
const element = compiled();
const firstChild = element.props.children;
const root = CSGRenderer.createContainer(createElement("ROOT"));
CSGRenderer.updateContainer(firstChild, root, null);
const model = CSGRenderer.getPublicRootInstance(root);
const MM = 10;
const finalModel = model.csg
.transform(CSG.Matrix4x4.rotationX(90))
.transform(CSG.Matrix4x4.scaling([MM, MM, MM]))
.fixTJunctions();
const rawData = stlSerializer.serialize(finalModel, { binary: false });
fs.writeFileSync(outFile, rawData.join());
});