OpenSCAD to OpenJSCAD Translator
Translates OpenSCAD syntax into OpenJsCAD syntax
IMPORTANT NOTE: This project is written against an older version of OpenSCAD (v 2011.06) which has now been superseded.
The following functions are not implemented (neither in csg.js nor in OpenJSCAD), and contributions are welcome !
Table of Contents
npm install @jscad/openscad-openjscad-translator
var parser = require('@jscad/openscad-openjscad-translator') var fs = require('fs') var openSCADText = fs.readFileSync("test.scad", "UTF8") var openJSCADResult = parser.parse(openSCADText) console.log(openJSCADResult)
dist/web-built.js and the openscadOpenJscadParser object will be available. This has two attributes:
- parse - a function which accepts OpenSCAD text and returns OpenJsCAD text.
- parser - a Jison parser object which can be used for more advanced parsing (e.g. the parse method returns the text and the context object, allowing for processing of use statements.)
not minified :
npm run build
npm run build-min
Creates scripts in the
npm run build-parser
Compiles the Jison lexer/parser to an AMD module in the
src folder called
This library is part of the JSCAD Organization, and is maintained by a group of volunteers. We welcome and encourage anyone to pitch in but please take a moment to read the following guidelines.
We only accept bug reports and pull requests on GitHub.
If you have a change or new feature in mind, please start a conversation with the Core Developers and start contributing changes.
Small Note: If editing this README, please conform to the standard-readme specification.
The MIT License (MIT) (unless specified otherwise)
NOTE: OpenSCAD and OpenSCAD API are released under the General Public License version 2.