[OpenSCAD] Fusion360 and OpenSCAD

Richard Urwin soronlin+openscad at googlemail.com
Thu Oct 6 07:12:00 EDT 2016


tp3 wrote
> On 10/06/2016 01:25 AM, Dan Shriver wrote:
>> Another way to approach it is some kind of "marriage of
>> tools" where one CAD suite provides that and OpenSCAD
>> concentrates on the math side but both can import / export
>> from each other.  If you were importing into OpenSCAD I
>> would fully expect that the autogenerated code or whatever
>> would look horrible.
>> 
> In general, that's not going to work easily (well, you can
> just import files generated by other tools, but I don't
> count that as "easy"). I do have some ideas regarding
> LibreCAD and 2D sketching. If that ever is going to happen,
> I don't know. With the long list of open topics and the
> available amount of time, the reasonable guess is
> unfortunately: not anytime soon.

I was musing today on extending the language of OpenSCAD by writing my own
compiler and outputting pure OpenSCAD code, much like early C++ compilers
(properly translators or transpilers) output pure C code. That introduces
another step where you have to write your file, translate it to OpenSCAD and
then load the result into OpenSCAD.

However OpenSCAD already makes some of that transparent. It watches the
source file and when it changes it automatically reloads it. Of course that
makes the extra translation step even more obvious to someone used to just
writing the file out and seeing the result.

So how would it be if OpenSCAD had an ability to watch the source file and
then run a configurable script on it before loading the result of that
script. There's various levels of doing that, from a script that is blindly
run on all files, to something that can treat files differently based on
their extensions with macros for the filenames involved. A modular first
hack should be simple to produce and then others with more interest could
extend it as required and send pull requests.

Then OpenSCAD could continue doing what it does and anyone with other ideas
could implement them as simple text-to-text filters without needing to
implement complex GUIs or rendering pipelines.

Another advantage is that the built-in OpenSCAD editor would transparently
work on the real source-code and the ugly autogenerated OpenSCAD code would
never be seen. Of course any errors in that OpenSCAD code would refer to
lines that the user never saw, but a competent compiler should never produce
erronious code.



--
View this message in context: http://forum.openscad.org/Fusion360-and-OpenSCAD-tp18493p18556.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list