vscode-openscad icon indicating copy to clipboard operation
vscode-openscad copied to clipboard

Proposal: Controlling OpenSCAD via DBus commands

Open tanius opened this issue 3 years ago • 1 comments

I came across this interesting functionality and thought to propose it here in case you'd like to add it to your to-do list. Not expecting this to happen soon, of course.

There is a DBus input driver in OpenSCAD, which allows to control the OpenSCAD process at runtime from the outside via the Linux-based inter-process messaging system DBus. It allows to access more or less all functions available from the OpenSCAD menu items, and some more.

I found a reference implementation (a small Qt GUI program) and an OpenSCAD integration for Emacs using this functionality.

Useful ways to use this for your OpenSCAD integration in VS Code include:

  • Pressing key combination inside the VS Code window to trigger preview and rendering in the OpenSCAD window. It is then also possible to disable the "Automatic Reload and Preview" checkbox in OpenSCAD, for users who want to be able to save their work without triggering OpenSCAD to create a new preview.

  • Opening new .scad files in a new tab inside the same OpenSCAD process. This would save memory compared to the current practice of starting a new OpenSCAD process for each file.

(P.S.: Thank you for your work on this extension! It provides me with the currently best OpenSCAD development environment under Linux :slightly_smiling_face:)

tanius avatar Nov 19 '20 22:11 tanius

Thanks for the suggestion! I really like the idea of this!

I'd recently been thinking about making an option to have the OpenSCAD window take focus when saving a .scad file in VS Code, but I wasn't sure how to do that. This looks like it could potentially have some nice pay-offs. I'll look into it a bit further when I have some free time (meaning after my exams in a few weeks).

I'm glad you like the extension! Although I'm on Windows, there wasn't a good editing experience for OpenSCAD that I knew of. Even the other OpenSCAD extensions for VS Code left a lot to be wanted. There are still some features I want to add (that I haven't had the time for), but it means a lot to know that people appreciate all the hard work I put in to this extension! (which is the first and only thing I've ever written in TypeScript)

Antyos avatar Nov 19 '20 23:11 Antyos