discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

running openscad on the command line?

BB
Bruno Boettcher
Sun, Aug 29, 2021 10:33 AM

Hello,

first time i try this, and i don't seem to get it to work....
i forgot to take my laptop with me, and am stuck with an android tablet :'(
so i tryed to run the thing through a ssh shell, but somehow, even after
re-reading the doc, i don't understand what's happening or where i went
wrong:

bboett@hayate:~/3dmodel$ openscad-nightly -v
OpenSCAD version 2021.08.24.nightly
bboett@hayate:~/3dmodel$ openscad-nightly -o lochmaske.png lochmaske.scad
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Unable to open a connection to the X server.
DISPLAY=
Can't create OpenGL OffscreenView. Code: -1.
Geometries in cache: 1
Geometry cache size in bytes: 0
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.000
Speicherzugriffsfehler

i don't get why it should need a connection to the X server, since i want
to run it on the command line....
the created png is empty :( i could live with the spourious error message,
but i need the view of the thing....

so what did i do wrong?

thanks in advance

Bruno Böttcher

35 rue de la république, FR-6720 Schwindratzheim
email: bboett@adlp.org, mobile:bboett@gmail.com
Fon:+33 3 88 89 91, Mob:+33 6 76 55 82 68

Dev: Java/Perl/PHP OS:GNU/LINUX, Android
Aïkido: http://aikido.zorn.free.fr, http://www.aikido-club-saverne.fr

Hello, first time i try this, and i don't seem to get it to work.... i forgot to take my laptop with me, and am stuck with an android tablet :'( so i tryed to run the thing through a ssh shell, but somehow, even after re-reading the doc, i don't understand what's happening or where i went wrong: bboett@hayate:~/3dmodel$ openscad-nightly -v OpenSCAD version 2021.08.24.nightly bboett@hayate:~/3dmodel$ openscad-nightly -o lochmaske.png lochmaske.scad Compiling design (CSG Products normalization)... Normalized CSG tree has 1 elements Unable to open a connection to the X server. DISPLAY= Can't create OpenGL OffscreenView. Code: -1. Geometries in cache: 1 Geometry cache size in bytes: 0 CGAL Polyhedrons in cache: 0 CGAL cache size in bytes: 0 Total rendering time: 0:00:00.000 Speicherzugriffsfehler i don't get why it should need a connection to the X server, since i want to run it on the command line.... the created png is empty :( i could live with the spourious error message, but i need the view of the thing.... so what did i do wrong? thanks in advance Bruno Böttcher -- 35 rue de la république, FR-6720 Schwindratzheim email: bboett@adlp.org, mobile:bboett@gmail.com Fon:+33 3 88 89 91, Mob:+33 6 76 55 82 68 ------------------------------------------------- Dev: Java/Perl/PHP OS:GNU/LINUX, Android Aïkido: http://aikido.zorn.free.fr, http://www.aikido-club-saverne.fr
NH
nop head
Sun, Aug 29, 2021 11:02 AM

OpenSCAD needs an X server to make images on Linux.

IIRC I use:

DISPLAY=:5
export DISPLAY
Xvfb :5 -screen 0 800x600x24 &

On Sun, 29 Aug 2021 at 11:34, Bruno Boettcher bboett@gmail.com wrote:

Hello,

first time i try this, and i don't seem to get it to work....
i forgot to take my laptop with me, and am stuck with an android tablet
:'(
so i tryed to run the thing through a ssh shell, but somehow, even after
re-reading the doc, i don't understand what's happening or where i went
wrong:

bboett@hayate:~/3dmodel$ openscad-nightly -v
OpenSCAD version 2021.08.24.nightly
bboett@hayate:~/3dmodel$ openscad-nightly -o lochmaske.png lochmaske.scad
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Unable to open a connection to the X server.
DISPLAY=
Can't create OpenGL OffscreenView. Code: -1.
Geometries in cache: 1
Geometry cache size in bytes: 0
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.000
Speicherzugriffsfehler

i don't get why it should need a connection to the X server, since i want
to run it on the command line....
the created png is empty :( i could live with the spourious error message,
but i need the view of the thing....

so what did i do wrong?

thanks in advance

Bruno Böttcher

35 rue de la république, FR-6720 Schwindratzheim
email: bboett@adlp.org, mobile:bboett@gmail.com
Fon:+33 3 88 89 91, Mob:+33 6 76 55 82 68

Dev: Java/Perl/PHP OS:GNU/LINUX, Android
Aïkido: http://aikido.zorn.free.fr, http://www.aikido-club-saverne.fr


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

OpenSCAD needs an X server to make images on Linux. IIRC I use: DISPLAY=:5 export DISPLAY Xvfb :5 -screen 0 800x600x24 & On Sun, 29 Aug 2021 at 11:34, Bruno Boettcher <bboett@gmail.com> wrote: > Hello, > > first time i try this, and i don't seem to get it to work.... > i forgot to take my laptop with me, and am stuck with an android tablet > :'( > so i tryed to run the thing through a ssh shell, but somehow, even after > re-reading the doc, i don't understand what's happening or where i went > wrong: > > > bboett@hayate:~/3dmodel$ openscad-nightly -v > OpenSCAD version 2021.08.24.nightly > bboett@hayate:~/3dmodel$ openscad-nightly -o lochmaske.png lochmaske.scad > Compiling design (CSG Products normalization)... > Normalized CSG tree has 1 elements > Unable to open a connection to the X server. > DISPLAY= > Can't create OpenGL OffscreenView. Code: -1. > Geometries in cache: 1 > Geometry cache size in bytes: 0 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.000 > Speicherzugriffsfehler > > i don't get why it should need a connection to the X server, since i want > to run it on the command line.... > the created png is empty :( i could live with the spourious error message, > but i need the view of the thing.... > > so what did i do wrong? > > thanks in advance > > Bruno Böttcher > -- > 35 rue de la république, FR-6720 Schwindratzheim > email: bboett@adlp.org, mobile:bboett@gmail.com > Fon:+33 3 88 89 91, Mob:+33 6 76 55 82 68 > ------------------------------------------------- > Dev: Java/Perl/PHP OS:GNU/LINUX, Android > Aïkido: http://aikido.zorn.free.fr, http://www.aikido-club-saverne.fr > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TP
Torsten Paul
Sun, Aug 29, 2021 2:09 PM

On 29.08.21 13:02, nop head wrote:

OpenSCAD needs an X server to make images on Linux.

I'm slowly working on some code that should hopefully remove
that restriction, but for now you can use Xvfb, Xvnc or any
other kind of "headless" X display like nop head showed.

Unfortunately there's some build related issues that may
mean it will that even if that code makes it into the dev
snapshot, it would still need a special build.

If anyone has ideas how to solve that, here's some technical
details:

  • Using EGL to get an OpenGL context to draw on in headless
    mode seems to work fine, tested from an iPhone via ssh
    generating a preview image
  • Problem is that OpenSCAD and also libOpenCSG use glew to
    handle OpenGL extensions
  • libGLEW (at least on Debian) does not support EGL only GLX
    which needs the X display
  • Using a different extension library like glad in OpenSCAD
    will probably not be compatible with libOpenCSG builds

So what should work is building OpenSCAD with custom libGLEW
and also custom libOpenCSG making it much more difficult to
maintain.

ciao,
Torsten.

On 29.08.21 13:02, nop head wrote: > OpenSCAD needs an X server to make images on Linux. I'm slowly working on some code that should hopefully remove that restriction, but for now you can use Xvfb, Xvnc or any other kind of "headless" X display like nop head showed. Unfortunately there's some build related issues that may mean it will that even if that code makes it into the dev snapshot, it would still need a special build. If anyone has ideas how to solve that, here's some technical details: - Using EGL to get an OpenGL context to draw on in headless mode seems to work fine, tested from an iPhone via ssh generating a preview image - Problem is that OpenSCAD and also libOpenCSG use glew to handle OpenGL extensions - libGLEW (at least on Debian) does not support EGL only GLX which needs the X display - Using a different extension library like glad in OpenSCAD will probably not be compatible with libOpenCSG builds So what should work is building OpenSCAD with custom libGLEW and also custom libOpenCSG making it much more difficult to maintain. ciao, Torsten.
BB
Bruno Boettcher
Sun, Aug 29, 2021 4:11 PM

thanks for the explanation, indeed, seems complicated, the other drawing
formats have the same limitation? e.g. svg?

otherwise thanks nop head, that works!

ciao
Bruno Böttcher

35 rue de la république, FR-6720 Schwindratzheim
email: bboett@adlp.org, mobile:bboett@gmail.com
Fon:+33 3 88 89 91, Mob:+33 6 76 55 82 68

Dev: Java/Perl/PHP OS:GNU/LINUX, Android
Aïkido: http://aikido.zorn.free.fr, http://www.aikido-club-saverne.fr

Torsten Paul Torsten.Paul@gmx.de schrieb am So., 29. Aug. 2021, 16:10:

On 29.08.21 13:02, nop head wrote:

OpenSCAD needs an X server to make images on Linux.

I'm slowly working on some code that should hopefully remove
that restriction, but for now you can use Xvfb, Xvnc or any
other kind of "headless" X display like nop head showed.

Unfortunately there's some build related issues that may
mean it will that even if that code makes it into the dev
snapshot, it would still need a special build.

If anyone has ideas how to solve that, here's some technical
details:

  • Using EGL to get an OpenGL context to draw on in headless
    mode seems to work fine, tested from an iPhone via ssh
    generating a preview image
  • Problem is that OpenSCAD and also libOpenCSG use glew to
    handle OpenGL extensions
  • libGLEW (at least on Debian) does not support EGL only GLX
    which needs the X display
  • Using a different extension library like glad in OpenSCAD
    will probably not be compatible with libOpenCSG builds

So what should work is building OpenSCAD with custom libGLEW
and also custom libOpenCSG making it much more difficult to
maintain.

ciao,
Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

thanks for the explanation, indeed, seems complicated, the other drawing formats have the same limitation? e.g. svg? otherwise thanks nop head, that works! ciao Bruno Böttcher -- 35 rue de la république, FR-6720 Schwindratzheim email: bboett@adlp.org, mobile:bboett@gmail.com Fon:+33 3 88 89 91, Mob:+33 6 76 55 82 68 ------------------------------------------------- Dev: Java/Perl/PHP OS:GNU/LINUX, Android Aïkido: http://aikido.zorn.free.fr, http://www.aikido-club-saverne.fr Torsten Paul <Torsten.Paul@gmx.de> schrieb am So., 29. Aug. 2021, 16:10: > On 29.08.21 13:02, nop head wrote: > > OpenSCAD needs an X server to make images on Linux. > > I'm slowly working on some code that should hopefully remove > that restriction, but for now you can use Xvfb, Xvnc or any > other kind of "headless" X display like nop head showed. > > Unfortunately there's some build related issues that may > mean it will that even if that code makes it into the dev > snapshot, it would still need a special build. > > If anyone has ideas how to solve that, here's some technical > details: > > - Using EGL to get an OpenGL context to draw on in headless > mode seems to work fine, tested from an iPhone via ssh > generating a preview image > - Problem is that OpenSCAD and also libOpenCSG use glew to > handle OpenGL extensions > - libGLEW (at least on Debian) does not support EGL only GLX > which needs the X display > - Using a different extension library like glad in OpenSCAD > will probably not be compatible with libOpenCSG builds > > So what should work is building OpenSCAD with custom libGLEW > and also custom libOpenCSG making it much more difficult to > maintain. > > ciao, > Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TP
Torsten Paul
Sun, Aug 29, 2021 6:19 PM

On 29.08.21 18:11, Bruno Boettcher wrote:

thanks for the explanation, indeed, seems complicated, the
other drawing formats have the same limitation? e.g. svg?

No, SVG and all the mesh exports like STL, 3MF need the full
geometry data calculated. In this case an active display is not
needed, as OpenGL is not used, it's just CPU based calculations.

ciao,
Torsten.

On 29.08.21 18:11, Bruno Boettcher wrote: > thanks for the explanation, indeed, seems complicated, the > other drawing formats have the same limitation? e.g. svg? No, SVG and all the mesh exports like STL, 3MF need the full geometry data calculated. In this case an active display is not needed, as OpenGL is not used, it's just CPU based calculations. ciao, Torsten.