cookiecad / Openscad-to-JSCAD-converter

2 stars 1 forks source link

output/output-cadit.js does work neither in jscad.app nor on openjscad.xyz #6

Closed Hermann-SW closed 1 month ago

Hermann-SW commented 1 month ago

Thanks for the great repo, it is no much that is missing.

I copied output/output-cadit.js for the usage example command into the web app editors and got errors on SHIFT+ENTER.

Then I added this new first line ...

const jscad = require('@jscad/modeling')

... and this new last line:

module.exports = { main }

Pressing SHIFT+ENTER then in both web apps just renders and displays honeweb, here for jscad.app:

image

Hermann-SW commented 1 month ago

As workaround copy output of this command into jscad.app:

echo "const jscad = require('@jscad/modeling')" && cat output/output-cadit.js && echo "module.exports = { main }"

Working jscad.app Script URL exported to clipboard.

hrgdavor commented 1 month ago

looks like a rather complex script was converted successfully . woot.

napter commented 1 month ago

@Hermann-SW The output-cadit.js is meant to be used in catit.app. One of the other output files can be used directly in jscad.xyz without modifications afterwards.

Hermann-SW commented 1 month ago

@napter Thanks for the hint. You are right, output.js does work in jscad.app. But the other file output.jscad does not work, with this error:

SyntaxError: SyntaxError: /jscad.model.js: 'return' outside of function. (415:0)

  413 | }
  414 |
> 415 | return jscadObjects;
      | ^