Feature request: Introduce TCP connection to openscad

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Feature request: Introduce TCP connection to openscad

Torsten Wagner
Hi,
recently I tried to use Emacs as an external editor for openscad.
Using the autocompile and hiding the internal editor worked out great.
Whenever I saved the buffer in Emacs, the preview was instantly
updated (well my model was not that complex hence instantly).

This made me wonder if Openscad should introduce some IPC
(inter-process-communication) to let external programs communicate
with Openscad.
We could have editors which modifies scad files and and ask for
compilation and preview (that is what happens now already). In
addition Openscad could report compile errors which e.g. will be used
by the external editor to highlight the problematic line. Furthermore,
 external programs could request rendering, export, etc.
Openscad would be able to get more detailed feedback and data from
other programs as well.

This would not be limited to external editors, but also enables
communication with external viewers and other programs, this includes
web-apps or control from other platforms (smartphones, tablets, etc.)
or even other programming languages.

I was looking into it and one challenge would be to us something
platform independent.
A TCP socket seems to be the best way to guarantee that. In addition
Openscad would get some sort of network/server capabilities. This
enables to run it on a bigger machine (server) and communicate with
less powerful clients.

What to do you think?

Torwag

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Bryan Bishop
On Wed, Oct 10, 2012 at 10:04 AM, Torsten Wagner
<[hidden email]> wrote:
> A TCP socket seems to be the best way to guarantee that. In addition
> Openscad would get some sort of network/server capabilities. This

Does openscad compile without the GUI yet? Otherwise running it as a
daemon seems really ridiculous.

- Bryan
http://heybryan.org/
1 512 203 0507

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Peter Shenkin
In reply to this post by Torsten Wagner
>From a purely functional perspective, I'd love to be able to use vi in an OpenSCAD context.

Client/server computation is another level. Are the CGAL algorithms parallelized either at the thread level or the process level? 15 minutes for a pretty simple Minkowski surface (on a 2009 Macbook Pro) is kind of a drag. ;-) If so, those with access to a cluster or something could take advantage of it.

But ability to use one's editor of choice easily in an OpenSCAD context would be higher priority for me.

-P.

On Wed, Oct 10, 2012 at 11:04 AM, Torsten Wagner <[hidden email]> wrote:
Hi,
recently I tried to use Emacs as an external editor for openscad.
Using the autocompile and hiding the internal editor worked out great.
Whenever I saved the buffer in Emacs, the preview was instantly
updated (well my model was not that complex hence instantly).

This made me wonder if Openscad should introduce some IPC
(inter-process-communication) to let external programs communicate
with Openscad.
We could have editors which modifies scad files and and ask for
compilation and preview (that is what happens now already). In
addition Openscad could report compile errors which e.g. will be used
by the external editor to highlight the problematic line. Furthermore,
 external programs could request rendering, export, etc.
Openscad would be able to get more detailed feedback and data from
other programs as well.

This would not be limited to external editors, but also enables
communication with external viewers and other programs, this includes
web-apps or control from other platforms (smartphones, tablets, etc.)
or even other programming languages.

I was looking into it and one challenge would be to us something
platform independent.
A TCP socket seems to be the best way to guarantee that. In addition
Openscad would get some sort of network/server capabilities. This
enables to run it on a bigger machine (server) and communicate with
less powerful clients.

What to do you think?

Torwag
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Joel Bodenmann
This sounds very interesting to me as well!
Another nice thing would be that we are able to finally use OpenSCAD on Android. (Regarding to the high data volume, you should be connected to a free WLAN :D

But I'd be mostly interested in using vim as my OpenSCAD editor. The sytnax highlighting itself could be done very easily.


~ Joel Bodenmann

On Wed, Oct 10, 2012 at 11:04 AM, Torsten Wagner <[hidden email]> wrote:
Hi,
recently I tried to use Emacs as an external editor for openscad.
Using the autocompile and hiding the internal editor worked out great.
Whenever I saved the buffer in Emacs, the preview was instantly
updated (well my model was not that complex hence instantly).

This made me wonder if Openscad should introduce some IPC
(inter-process-communication) to let external programs communicate
with Openscad.
We could have editors which modifies scad files and and ask for
compilation and preview (that is what happens now already). In
addition Openscad could report compile errors which e.g. will be used
by the external editor to highlight the problematic line. Furthermore,
 external programs could request rendering, export, etc.
Openscad would be able to get more detailed feedback and data from
other programs as well.

This would not be limited to external editors, but also enables
communication with external viewers and other programs, this includes
web-apps or control from other platforms (smartphones, tablets, etc.)
or even other programming languages.

I was looking into it and one challenge would be to us something
platform independent.
A TCP socket seems to be the best way to guarantee that. In addition
Openscad would get some sort of network/server capabilities. This
enables to run it on a bigger machine (server) and communicate with
less powerful clients.

What to do you think?

Torwag


Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Alan Cox
On Wed, 10 Oct 2012 21:58:15 +0200
Joel Bodenmann <[hidden email]> wrote:

> This sounds very interesting to me as well!
> Another nice thing would be that we are able to finally use OpenSCAD on
> Android. (Regarding to the high data volume, you should be connected to
> a free WLAN :D

You can already display X11 apps on Android via vnc type clients. What
exactly is the additional usage model you have in mind ?

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Drew Rogge
In reply to this post by Joel Bodenmann
This thread got me interested in also using vim for my editor and I did a bit of investigating.
Probably most everybody knows this already but for those that don't, it is possible to use an
external editor by opening the file in both OpenSCAD, File->Open, and in your editor, vi xxx,
and then enabling Design->Automatic Reload and Compile in OpenSCAD. It seems that every time
you write the file from within your editor OpenSCAD will see the change, reload the file, compile
it and show the results in its render window. It cleans things up a bit if you View->Hide Editor.

Drew

On 10/10/2012 12:58 PM, Joel Bodenmann wrote:
> This sounds very interesting to me as well!
> Another nice thing would be that we are able to finally use OpenSCAD on Android. (Regarding to the high data volume, you should be connected to a free WLAN :D
>
> But I'd be mostly interested in using vim as my OpenSCAD editor. The sytnax highlighting itself could be done very easily.
>
>
> ~ Joel Bodenmann

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Joel Bodenmann
On 10/10/2012 09:40 PM, Drew Rogge wrote:
> This thread got me interested in also using vim for my editor and I did a bit of investigating.
> Probably most everybody knows this already but for those that don't, it is possible to use an
> external editor by opening the file in both OpenSCAD, File->Open, and in your editor, vi xxx,
> and then enabling Design->Automatic Reload and Compile in OpenSCAD. It seems that every time
> you write the file from within your editor OpenSCAD will see the change, reload the file, compile
> it and show the results in its render window. It cleans things up a bit if you View->Hide Editor.
>
> Drew
Sir, this is amazing! I love you :D


~ Joel

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Drew Rogge
Have fun!

On 10/10/2012 02:43 PM, Joel Bodenmann wrote:

> On 10/10/2012 09:40 PM, Drew Rogge wrote:
>> This thread got me interested in also using vim for my editor and I did a bit of investigating.
>> Probably most everybody knows this already but for those that don't, it is possible to use an
>> external editor by opening the file in both OpenSCAD, File->Open, and in your editor, vi xxx,
>> and then enabling Design->Automatic Reload and Compile in OpenSCAD. It seems that every time
>> you write the file from within your editor OpenSCAD will see the change, reload the file, compile
>> it and show the results in its render window. It cleans things up a bit if you View->Hide Editor.
>>
>> Drew
> Sir, this is amazing! I love you :D
>
>
> ~ Joel
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Joel Bodenmann
In reply to this post by Drew Rogge
On 10/10/2012 09:40 PM, Drew Rogge wrote:
> This thread got me interested in also using vim for my editor and I did a bit of investigating.
> Probably most everybody knows this already but for those that don't, it is possible to use an
> external editor by opening the file in both OpenSCAD, File->Open, and in your editor, vi xxx,
> and then enabling Design->Automatic Reload and Compile in OpenSCAD. It seems that every time
> you write the file from within your editor OpenSCAD will see the change, reload the file, compile
> it and show the results in its render window. It cleans things up a bit if you View->Hide Editor.
>
> Drew
>
Okay, I gave it a try. this works very very nicely.
The only missing feature is the lack of a syntax highlighter and the
missing error highlighter. I know that the syntax highlighting can be
done easily, but no idea about the second.


~ Joel

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Joshua Holbrook
It sounds interesting, but I'd rather see things like Real Stack Traces first.

--Josh

On Wed, Oct 10, 2012 at 4:17 PM, Joel Bodenmann <[hidden email]> wrote:

> On 10/10/2012 09:40 PM, Drew Rogge wrote:
>> This thread got me interested in also using vim for my editor and I did a bit of investigating.
>> Probably most everybody knows this already but for those that don't, it is possible to use an
>> external editor by opening the file in both OpenSCAD, File->Open, and in your editor, vi xxx,
>> and then enabling Design->Automatic Reload and Compile in OpenSCAD. It seems that every time
>> you write the file from within your editor OpenSCAD will see the change, reload the file, compile
>> it and show the results in its render window. It cleans things up a bit if you View->Hide Editor.
>>
>> Drew
>>
> Okay, I gave it a try. this works very very nicely.
> The only missing feature is the lack of a syntax highlighter and the
> missing error highlighter. I know that the syntax highlighting can be
> done easily, but no idea about the second.
>
>
> ~ Joel
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566



--
Joshua Holbrook
Head of Support
Nodejitsu Inc.
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

tbuser
In reply to this post by Joel Bodenmann
vim openscad syntax highlighting: https://github.com/rantenki/vim-openscad

Though I prefer using TextMate in OSX  :) See: http://www.thingiverse.com/thing:15292

On Wed, Oct 10, 2012 at 7:17 PM, Joel Bodenmann <[hidden email]> wrote:
On 10/10/2012 09:40 PM, Drew Rogge wrote:
> This thread got me interested in also using vim for my editor and I did a bit of investigating.
> Probably most everybody knows this already but for those that don't, it is possible to use an
> external editor by opening the file in both OpenSCAD, File->Open, and in your editor, vi xxx,
> and then enabling Design->Automatic Reload and Compile in OpenSCAD. It seems that every time
> you write the file from within your editor OpenSCAD will see the change, reload the file, compile
> it and show the results in its render window. It cleans things up a bit if you View->Hide Editor.
>
> Drew
>
Okay, I gave it a try. this works very very nicely.
The only missing feature is the lack of a syntax highlighter and the
missing error highlighter. I know that the syntax highlighting can be
done easily, but no idea about the second.


~ Joel
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Len Trigg
It would be nice to bundle more of these directly in the openscad
distribution (the contrib directory already contains the editor
extensions for emacs, bbedit, notepad+)

On Thu, Oct 11, 2012 at 10:49 AM, Tony Buser <[hidden email]> wrote:

> vim openscad syntax highlighting: https://github.com/rantenki/vim-openscad
>
> Though I prefer using TextMate in OSX  :) See:
> http://www.thingiverse.com/thing:15292
>
> On Wed, Oct 10, 2012 at 7:17 PM, Joel Bodenmann <[hidden email]> wrote:
>>
>> On 10/10/2012 09:40 PM, Drew Rogge wrote:
>> > This thread got me interested in also using vim for my editor and I did
>> > a bit of investigating.
>> > Probably most everybody knows this already but for those that don't, it
>> > is possible to use an
>> > external editor by opening the file in both OpenSCAD, File->Open, and in
>> > your editor, vi xxx,
>> > and then enabling Design->Automatic Reload and Compile in OpenSCAD. It
>> > seems that every time
>> > you write the file from within your editor OpenSCAD will see the change,
>> > reload the file, compile
>> > it and show the results in its render window. It cleans things up a bit
>> > if you View->Hide Editor.
>> >
>> > Drew
>> >
>> Okay, I gave it a try. this works very very nicely.
>> The only missing feature is the lack of a syntax highlighter and the
>> missing error highlighter. I know that the syntax highlighting can be
>> done easily, but no idea about the second.
>>
>>
>> ~ Joel
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>> http://openscad.org - https://flattr.com/thing/121566
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

Torsten Wagner
In reply to this post by Bryan Bishop
Hi,

well it would make sense even with GUI.
You can already hide the editor and console output in Openscad. This
leaves you with an interactive preview window. Now communicate with VI
or Emacs and be able to zoom, roate and move the result in these
preview window is pretty much perfect.
However, more can be done. Emacs and VI could send commands to rotate,
zoom and move an object. That would enable you to stay in your editor
and still interactively investigate the output of your openscad file.


Torwag

On 11 October 2012 00:15, Bryan Bishop <[hidden email]> wrote:

> On Wed, Oct 10, 2012 at 10:04 AM, Torsten Wagner
> <[hidden email]> wrote:
>> A TCP socket seems to be the best way to guarantee that. In addition
>> Openscad would get some sort of network/server capabilities. This
>
> Does openscad compile without the GUI yet? Otherwise running it as a
> daemon seems really ridiculous.
>
> - Bryan
> http://heybryan.org/
> 1 512 203 0507

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Introduce TCP connection to openscad

clothbot
In reply to this post by Drew Rogge
[Just noticed this sitting in my Draft folder; sending it before it gets too stale]

Another alternative is to run command-line openscad from within your vi session:

:! openscad -o test.stl %

…will run openscad on the current file and generate an stl if the "openscad" executable can be found in your path.

On Mac, I have a ~/.exrc entry mapping the /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD path to "openscad":

--snip--

map openscad :!/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD %

--end-snip--

…which is dynamically substituted when you start typing "!openscad "

Andrew.

On 2012-10-10, at 3:40 PM, Drew Rogge wrote:

This thread got me interested in also using vim for my editor and I did a bit of investigating.
Probably most everybody knows this already but for those that don't, it is possible to use an
external editor by opening the file in both OpenSCAD, File->Open, and in your editor, vi xxx,
and then enabling Design->Automatic Reload and Compile in OpenSCAD. It seems that every time
you write the file from within your editor OpenSCAD will see the change, reload the file, compile
it and show the results in its render window. It cleans things up a bit if you View->Hide Editor.

Drew

On 10/10/2012 12:58 PM, Joel Bodenmann wrote:
This sounds very interesting to me as well!
Another nice thing would be that we are able to finally use OpenSCAD on Android. (Regarding to the high data volume, you should be connected to a free WLAN :D

But I'd be mostly interested in using vim as my OpenSCAD editor. The sytnax highlighting itself could be done very easily.


~ Joel Bodenmann
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

--

"The future is already here.  It's just not very evenly distributed" -- William Gibson

Me: http://clothbot.com/wiki/