[OpenSCAD] Feature Requests

Britton Kerin bkerin at fastmail.fm
Thu Feb 25 18:56:56 CET 2010

On Sun, 14 Feb 2010 15:42 +0100, "Marius Kintel" <marius at kintel.net>
> There are a few separate components to this.
> 1) The commands/queries we want to send to OpenSCAD are not
>    (primarily) OpenSCAD commands, but application/GUI controls;
>    opening/ saving files, reloading, render, export, edit text. Since
>    OpenSCAD either can have multiple open documents or multiple
>    instances (depending on whether the user prefers MDI mode or not),
>    we also need to be able to query/select the correct
>    document/window/instance. -> We need to expose some kind of DOM for
>    the application.
> 2) We need a transport mechanism for sending these commands/queries to
>    OpenSCAD. Domain sockets, TCP sockets, file monitoring has been
>    mentioned as alternatives. On Mac, this is standardized using
>    AppleEvents, which is a good solution for Mac since we can plug
>    this directly into any other scripting framework already existing.
>    For Windows and Linux I don't know about standardized ways of doing
>    this. The MDI/pid case also complicates this. -> It could make
>    sense to decouple 1) from 2)
> 3) We might want a scripting language for sending the commands/queries
>    in 1) over the transport in 2). bash was mentioned as an option.
>    The questions is also whether we can keep the interpreter external
>    or if we need to embed it into OpenSCAD. For the file monitoring
>    solution, we probably need to embed. For the others, we could
>    define some kind of text-based API and resolve the logic
>    externally.

I'd vote for a text-based API of some sort.  Ideally with a really
simple consistent mapping from the interactive commands (which the user
learns first) to the corresponding script commands.  There should
definitely be an easy obvious way to send commands to openscad from bash
whether by invoking 'openscad --client' or writing to a pipe or socket.
This is how a person looking to do quick integration with their favorite
editor is going to want to do it.

It wouldn't be a tragedy to have script command "F4" mean "do what
happens when you press F4 in openscad".  This is how vim scripting
mostly works and it turns out to be sooo much easier than emacs (which I
used to program *a lot*) where you have to root around constantly to
find the underlying lisp API that you're actually supposed to use to do
something programmatically.

Let users learn first interactively then ditch the clunky mouse without
the trouble of learning a new API.


More information about the Openscad mailing list