jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.58k stars 507 forks source link

OpenSCAD Code Does not Render #370

Open onebeartoe opened 6 years ago

onebeartoe commented 6 years ago

Expected Behavior

Valid OpenScad code is rendered.

Actual Behavior

The message 'SyntaxError: Unexpected identifier' appears instead of the model.

Steps to Reproduce the Problem

  1. Using the Web browser, load OpenSCAD that is attached. inlined-water-filter.scad.txt

Specifications

onebeartoe commented 6 years ago

Is there anything I can do to help with this issue?

kaosat-dev commented 6 years ago

@onebeartoe Sorry for the lack of reply !

If you feel up to it, please see if you can upgrade the translator at least a bit (openscad modules etc) it would be a huge help :)

onebeartoe commented 6 years ago

Hi Mark. Thanks for the invite to contribute, but in this case I have to hang tight and be patient. Keep up the great work man!

z3dev commented 3 years ago

@onebeartoe Have you tried V2 JSCAD? The attached script is very basic (using module as a function, etc), and should convert to V2 JSCAD fairly easily.

www.openjscad.xyz

api documentation at www.openjscad.xyz/docs/ user guide at www.openjscad.xyz/guide.html

onebeartoe commented 3 years ago

@onebeartoe Have you tried V2 JSCAD? The attached script is very basic (using module as a function, etc), and should convert to V2 JSCAD fairly easily. Hey, thanks for update! I am glad to see this project is still going.

onebeartoe commented 3 years ago

@z3dev, I tried the OpenSCAD script I attached here. But it didn't see an option for .scad files; only 'Load a JSCAD Project'.

See the attached screenshot. Did I miss something? inlined-water-filter-screenshot

I also tried uploading a directory with the .scad file, but it only put '// imported from project' and nothing else.

z3dev commented 3 years ago

@z3dev, I tried the OpenSCAD script I attached here. But it didn't see an option for .scad files; only 'Load a JSCAD Project'.

See the attached screenshot. Did I miss something?

I also tried uploading a directory with the .scad file, but it only put '// imported from project' and nothing else.

Sorry. OpenSCAD files are not converted automatically. You will have to make changes.

First, make a copy and rename it with “***.js”. Then drag and drop the file to the website. You will have to follow JavaScript now, and change the script.

There are examples under the ? icon, which you can view in the editor (click once in the pop).