How to install pythonOCC in the cloud, say in google app engine and run it?

StackOverflow https://stackoverflow.com/questions/19723208

  •  02-07-2022
  •  | 
  •  

Domanda

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?

È stato utile?

Soluzione

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

[3] http://www.youtube.com/watch?v=gkfgpkXyt0k

[4] http://dir.gmane.org/gmane.comp.cad.pythonocc.user

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top