I need to install pythonOCC in the cloud, say google app engine so that I can run it in the server and get the results to a browser?
1 Answers
yes you can, its actually pretty easy. we've done this by wrapping standard pythonocc functions with decorators that take care of piping results over SOAP, or XML-RPC. a few years ago, Thomas Paviot and I presented a demo, where a server would generate a CAD design and another one meshes it and performs a FEM analyses [1]. you'll find a presentation here [2]
the important bit is serialization. all classes inheriting TopoDS_Shape can be easily serialized and hence send over a network. just as long as your taking arguments and results that can be pickled, your fine. pythonocc also has methods that can write shapes to webgl [2] so its pretty easy to built such a application. i would not recommended starting these experiments by running in a managed environment as google app, but i'm not particularly familiar with, though i think its fair to assume it will not make the task easier. flask is probably is nice way to wrap the calls to pythonocc. please join the mailing list for further info [4]
Finally, installing pythonocc
is straightfwd via conda
:
# install pythonocc in the active environment with python 3.5
conda install -c conda-forge -c dlr-sc -c pythonocc -c oce
pythonocc-core==0.18.1 python=3.5
which will land you an installation on either linux osx or windows
[1] http://www.youtube.com/watch?v=KrY3SCUYEws
[2] http://www.slideshare.net/tpaviot/pythonocc-pde2009-presentation

- 690
- 4
- 13
-
Hi Jelle, Thank you for the great explanation and feedback! – user1804995 Nov 04 '13 at 04:56
-
Hi Jelle, One quick question, is installing opencascade for pythonOCC, on the server is the same as you do in your local machine ie. install all dependencies and then install pythonOCC? – user1804995 Nov 04 '13 at 07:29
-
Basically, yes. If your on debian / ubuntu it should take you very little time since binaries can be apt-get'd – Jelle Nov 05 '13 at 06:26