Skip to content

Commit

Permalink
docs(): fix example code on README.md (jscad#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromew authored and kaosat-dev committed Jun 20, 2017
1 parent 917bb6b commit 5f5ccf9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ var script = `function main() {

// generate compiled version
var params = {}
var compiled = jscad.compile(script, params)
// generate final output data, choosing your prefered format
var outputData = jscad.generateOutput('stlb', compiled)
jscad.compile(script, params).then(function(compiled) {
// generate final output data, choosing your prefered format
var outputData = jscad.generateOutput('stlb', compiled)
// hurray ,we can now write an stl file from our OpenJsCad script!
fs.writeFileSync('torus.stl', outputData.asBuffer())
})

// hurray ,we can now write an stl file from our OpenJsCad script!
fs.writeFileSync('torus.stl', outputData.asBuffer())
```

you can also use the 'generateOutput' function directly with CSG/CAG objects ie :
Expand Down

0 comments on commit 5f5ccf9

Please sign in to comment.