chao afdde451d0 create | il y a 1 jour | |
---|---|---|
.. | ||
dist | il y a 1 jour | |
lib | il y a 1 jour | |
src | il y a 1 jour | |
tests | il y a 1 jour | |
tools | il y a 1 jour | |
README.md | il y a 1 jour | |
build-web.js | il y a 1 jour | |
jison-build.sh | il y a 1 jour | |
openscad-parser.jison | il y a 1 jour | |
package.json | il y a 1 jour | |
web.js | il y a 1 jour |
Node module that translates OpenSCAD syntax (http://www.openscad.org/) into OpenJsCAD syntax (http://joostn.github.com/OpenJsCad/).
See: https://npmjs.org/package/openscad-openjscad-translator
npm install openscad-openjscad-translator
var parser = require('openscad-openjscad-translator')
var fs = require("fs");
var openSCADText = fs.readFileSync("test.scad", "UTF8");
var openJSCADResult = parser.parse(openSCADText);
console.log(openJSCADResult);
...
<script type="text/javascript" src="../lib/underscore.js"></script>
<script type="text/javascript" src="../lib/jquery.js"></script>
<script src="../dist/web-built.js"></script>
<script type="text/javascript">
$(function(){
console.log(openscadOpenJscadParser.parse($('#txt').text()));
})
</script>
...
Include lib/underscore.js
and dist/web-built.js
and the openscadOpenJscadParser object will be available. This has two attributes:
node tools/r.js -o build-web.js
Creates a optimised script (with Almond AMD loader) in the dist
folder.
./jison-build.sh
Compiles the Jison lexer/parser to an AMD module in the src
folder called openscad-parser.js
.