Replies: 7 comments 4 replies
-
Very cool! I would love to have this functionality in JSCAD working to convert from openscad. I've wanted to try to fix the existing I think it would make JSCAD much more accessible to a whole world of people who have used openscad, have existing designs in scad, and are maybe interested in JSCAD, but re-writing everything in one go might be too much to ask. Are you thinking this might replace the broken |
Beta Was this translation helpful? Give feedback.
-
this could be useful https://github.com/alufers/openscad-parser |
Beta Was this translation helpful? Give feedback.
-
Converter and interpreter are different. For converters, you may need some sort of type inference for you to find out the type of the expression, which can be non-trivial. For interpreter, you just execute the script, which is a lot easier. The main problem for interpreter is that the output may not be very readable, e.g. turns everything into a sequence of function calls without much structure. |
Beta Was this translation helpful? Give feedback.
-
I've gotten a working POC and have published it to https://github.com/cookiecad/Openscad-to-JSCAD-converter/ The general idea is to use an openscad grammar to parse the openscad code into a syntax tree, then use the tree to jenerate jscad code. In order to make the resulting code more readable or when jscad is missing an equivalent operation the code adds helper functions. I used the openscad version of the honeycomb storage wall (on printables) as my test case and it successfully converts it to jscad. Each language feature is added separately so there are still many more to add. If anyone wants to try it out or contribute let me know. I haven't had time to work on it recently but would love to make more progress. Index.js is the starting point. As a side note - you can run jscad code with auto-completion and typechecking in our site, cadit.app - let me know what you think! |
Beta Was this translation helpful? Give feedback.
-
@napter I just published a bridge API from OpenSCAD to JSCAD. It's still in progress but functional. There are some very string things in OpenSCAD, so maybe this will help with the 'helper' functions, etc. I'd be glad to help contribute to your project as well. https://github.com/jscad-community/jscad-scad-api My goal is to take all OpenSCAD projects on Thingiverse and convert to JSCAD. 😃 HA HA HA! |
Beta Was this translation helpful? Give feedback.
-
@napter I just finished a round of testing for jscad-scad-api. I spent time to verify that the functionality for the various functions follows OpenSCAD 😷 But anyway, there were a significant amount of fixes, and improvements. How do you want to proceed? I think that the jscad-scad-api can be a good reference for the conversions. I can jump on to the converter now, and make changes. I think we can probably make some nice progress by combining effort. |
Beta Was this translation helpful? Give feedback.
-
FYI, Thingiverse provides an API to access the list of designs, modify designs, and create designs. |
Beta Was this translation helpful? Give feedback.
-
Hi all!
I've been working on an openscad to jscad converter since the official one has been abandoned. It works on a subset of the openscad grammar but can be expanded further. Would you be interested in using or contributing this project?
I also want to show off our CAD app where this will be used: CADit.app. You can run jscad code in there and then manipulate it visually. We are considering a reverse option, from visual to jscad. We will also be adding a library where people can share JSCad designs.
Let me know what you think!
-Nathan
Beta Was this translation helpful? Give feedback.
All reactions