discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Command line preview-only app

S
ssuchter
Sun, Feb 9, 2020 11:12 PM

I'm interested in having a command line way to make an interactive preview
window for a given .scad file. My use case is to enhance the Intellij plugin
to allow quick rendering of a file you're editing in Intellij. I expect to
have to build this myself.

I'm imagining a separate command line app that will create a running app
separate than any existing OpenSCAD instances. This app will not have nearly
as much interactivity as the main OpenSCAD app - for example, it wouldn't
have an editor window, nor any ability to load/save/export files. I also
don't think it should have a console window; any console output during the
parsing/rendering process should go to stdout, because Intellij has its own
console pane.

I couldn't find a way to do this cleanly with existing functionality. If
this already exists, I'd love for someone to tell me not to try. I'd also
accept words of encouragement or advice on how to accomplish this. (I'm a
developer, but not in this codebase.)

Thanks, Sean

--
Sent from: http://forum.openscad.org/

I'm interested in having a command line way to make an interactive preview window for a given .scad file. My use case is to enhance the Intellij plugin to allow quick rendering of a file you're editing in Intellij. I expect to have to build this myself. I'm imagining a separate command line app that will create a running app separate than any existing OpenSCAD instances. This app will not have nearly as much interactivity as the main OpenSCAD app - for example, it wouldn't have an editor window, nor any ability to load/save/export files. I also don't think it should have a console window; any console output during the parsing/rendering process should go to stdout, because Intellij has its own console pane. I couldn't find a way to do this cleanly with existing functionality. If this already exists, I'd love for someone to tell me not to try. I'd also accept words of encouragement or advice on how to accomplish this. (I'm a developer, but not in this codebase.) Thanks, Sean -- Sent from: http://forum.openscad.org/
TP
Torsten Paul
Sun, Feb 9, 2020 11:24 PM

On 10.02.20 00:12, ssuchter wrote:

I'm interested in having a command line way to make an interactive preview
window for a given .scad file. My use case is to enhance the Intellij plugin
to allow quick rendering of a file you're editing in Intellij. I expect to
have to build this myself.

I'm not sure what that means. Do you have a couple of specific examples
how those command line calls would look like?

As for "remote control" there's currently 2 way. The first one is pretty
simple and covers the use case "external editor". Files can be monitored
so as soon as a file of a model is modified on disk, a preview is triggered
in the running OpenSCAD application.

In addition there's an (experimental, Linux only) D-Bus interface that
allows to interface with a running OpenSCAD instance. In principle this
would allow both viewport control and executing actions.

ciao,
Torsten.

On 10.02.20 00:12, ssuchter wrote: > I'm interested in having a command line way to make an interactive preview > window for a given .scad file. My use case is to enhance the Intellij plugin > to allow quick rendering of a file you're editing in Intellij. I expect to > have to build this myself. I'm not sure what that means. Do you have a couple of specific examples how those command line calls would look like? As for "remote control" there's currently 2 way. The first one is pretty simple and covers the use case "external editor". Files can be monitored so as soon as a file of a model is modified on disk, a preview is triggered in the running OpenSCAD application. In addition there's an (experimental, Linux only) D-Bus interface that allows to interface with a running OpenSCAD instance. In principle this would allow both viewport control and executing actions. ciao, Torsten.
M
MichaelAtOz
Sun, Feb 9, 2020 11:38 PM

I suppose you want to have this preview AND be able to use the OpenSCAD GUI
at the same time?
If you don't, you can hide the console and editor (view menu), use
auto-reload & preview (design menu), as tp mentioned. So when you save the
file in the IDE, the preview is refreshed.
I sometimes do that, it works OK.


Admin - email* me if you need anything,  or if I've done something stupid...

  • click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

I suppose you want to have this preview AND be able to use the OpenSCAD GUI at the same time? If you don't, you can hide the console and editor (view menu), use auto-reload & preview (design menu), as tp mentioned. So when you save the file in the IDE, the preview is refreshed. I sometimes do that, it works OK. ----- Admin - email* me if you need anything, or if I've done something stupid... * click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
S
ssuchter
Mon, Feb 10, 2020 7:54 PM

Hm, ideally, I think we should be able to have this preview and the OpenSCAD
GUI open at the same time. But that might be a nice to have, rather than a
strict requirement.

I'll look into your suggestion, maybe that will be an easy way to achieve
what I want. I've had problems with the auto-reloading not being as reliable
as I would have expected, but maybe the first step is to reliably reproduce
that and debug.

@tp3 - thanks for the thoughts. I'd imagine the command line call (if its
really necessary, per your point) to be as simple as something like:

/path/openscad-preview main-file.scad

--
Sent from: http://forum.openscad.org/

Hm, ideally, I think we should be able to have this preview and the OpenSCAD GUI open at the same time. But that might be a nice to have, rather than a strict requirement. I'll look into your suggestion, maybe that will be an easy way to achieve what I want. I've had problems with the auto-reloading not being as reliable as I would have expected, but maybe the first step is to reliably reproduce that and debug. @tp3 - thanks for the thoughts. I'd imagine the command line call (if its really necessary, per your point) to be as simple as something like: /path/openscad-preview main-file.scad -- Sent from: http://forum.openscad.org/
S
ssuchter
Tue, Feb 11, 2020 4:45 AM

Thanks - I tried that and it worked well. I didn't understand how to
accomplish what I wanted; now that I do, I doubt I'll ever actually do this.
(Unless I really, really want a window that I can embed inside Intellij)

--
Sent from: http://forum.openscad.org/

Thanks - I tried that and it worked well. I didn't understand how to accomplish what I wanted; now that I do, I doubt I'll ever actually do this. (Unless I really, really want a window that I can embed inside Intellij) -- Sent from: http://forum.openscad.org/
TP
Torsten Paul
Wed, Feb 12, 2020 10:54 PM

On 10.02.20 20:54, ssuchter wrote:

@tp3 - thanks for the thoughts. I'd imagine the command line call (if its
really necessary, per your point) to be as simple as something like:

/path/openscad-preview main-file.scad

But what would that do special? Opening a new window every time seems
not ideal. Also that's pretty much possible right now without changes
to OpenSCAD.

ciao,
Torsten.

On 10.02.20 20:54, ssuchter wrote: > @tp3 - thanks for the thoughts. I'd imagine the command line call (if its > really necessary, per your point) to be as simple as something like: > > /path/openscad-preview main-file.scad But what would that do special? Opening a new window every time seems not ideal. Also that's pretty much possible right now without changes to OpenSCAD. ciao, Torsten.