kolrabi / stlthumb

A thumbnail generator for STL files
MIT License
3 stars 1 forks source link

Could not create window #1

Open godeye opened 7 years ago

godeye commented 7 years ago

when it convert.it shows

root@debian:/srv/stlthumb# stlthumb che.stl che.png 500 500 che.stl: 707091 Could not create window

what cause this?

kolrabi commented 7 years ago

Are you running it from the console? Right now it needs a connection to a windowing system to create a hidden window to do the rendering in.

godeye commented 7 years ago

yes i am running from console. could we use command line to use it in other script such as php/python?

kolrabi commented 7 years ago

I just committed a change that allows to use osmesa and EGL support. Add "-DUSE_API=OSMESA" (or "-DUSE_API=EGL" respectively) to your cmake arguments to enable it. Either should work from the console or a script. EGL might even be hardware accelerated. Can you try it out to see if that works for you?

godeye commented 7 years ago

root@debian:/srv/stlthumb/build# -- The CXX compiler identification is GNU 4.9.2 -- The C compiler identification is GNU 4.9.2 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found SDL2: /usr/local/lib/libSDL2.a -- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") -- checking for module 'egl' -- found egl, version 10.3.2 -- Found EGL: /usr/include -- Could NOT find OSMesa (missing: OSMESA_LIBRARY OSMESA_INCLUDE_DIR) -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.a (found version "1.2.8") -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.2.50") -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for connect -- Looking for connect - found -- Looking for remove -- Looking for remove - found -- Looking for shmat -- Looking for shmat - found -- Looking for IceConnectionNumber in ICE -- Looking for IceConnectionNumber in ICE - found -- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so Using EGL... -- Configuring done -- Generating done -- Build files have been written to: /srv/stlthumb/build root@debian:/srv/stlthumb/build# make Scanning dependencies of target stlthumb [ 10%] Building C object CMakeFiles/stlthumb.dir/src/glew.c.o [ 20%] Building CXX object CMakeFiles/stlthumb.dir/src/context_sdl2.cc.o [ 30%] Building CXX object CMakeFiles/stlthumb.dir/src/context_osmesa.cc.o [ 40%] Building CXX object CMakeFiles/stlthumb.dir/src/context_egl.cc.o [ 50%] Building CXX object CMakeFiles/stlthumb.dir/src/image.cc.o [ 60%] Building CXX object CMakeFiles/stlthumb.dir/src/main.cc.o [ 70%] Building CXX object CMakeFiles/stlthumb.dir/src/render.cc.o [ 80%] Building CXX object CMakeFiles/stlthumb.dir/src/stl.cc.o [ 90%] Building CXX object CMakeFiles/stlthumb.dir/src/stlbinary.cc.o [100%] Building CXX object CMakeFiles/stlthumb.dir/src/stltext.cc.o Linking CXX executable stlthumb [100%] Built target stlthumb root@debian:/srv/stlthumb/build# cp stlthumb /usr/local/bin root@debian:/srv/stlthumb/build# stlthumb cube.stl cube.png 500 libEGL warning: DRI2: xcb_connect failed libEGL warning: DRI2: xcb_connect failed EGL failed to initialize

kolrabi commented 7 years ago

Hmm... does it work if you use osmesa instead?

godeye commented 6 years ago

need gpu supported? i test it in my linode web server,and failed.

kolrabi commented 6 years ago

The osmesa renderer should work without a GPU, but I never tested it in a server environment.