PythonOCC

From FreeCAD Documentation
Revision as of 20:23, 15 May 2020 by FuzzyBot (talk | contribs) (Updating to match new version of source page)

PythonOCC is a project that aims at binding the whole range of OpenCASCADE Technology (OCCT) functions into a Python module. This is a different approach than FreeCAD, where only certain components of OCCT are used, resulting in a much simpler structure. The project page is pythonocc.org.

PythonOCC, on the other hand, since it provides you access to all of OCC classes and functions, is very complex, but also very powerful. It is therefore a very fine addition to FreeCAD. When you are limited by FreeCAD's available OCCT functionality in your Python scripts, it's time to load pythonOCC.

Currently in the Part module we have the methods Part.__toPythonOCC__() and Part.__fromPythonOCC__() to exchange TopoDS_Shape (Part TopoShape) entities to and from pythonOCC. This allows us to use the full power of OCCT in Python and then put the resulting shapes back to FreeCAD.