PythonOCC
Description
PythonOCC est un projet qui vise à lier l'ensemble des fonctions de la technologie OpenCASCADE (OCCT) dans un module Python. Il s'agit d'une approche différente de FreeCAD, où seuls certains composants de l'OCCT sont utilisés, résultant en une structure beaucoup plus simple. La page du projet est pythonocc.org.
PythonOCC, d'autre part, il vous donne accès à toutes les classes et fonctions OCC, est très complexe mais aussi très puissant. C'est donc un très bel ajout à FreeCAD. Lorsque vous êtes limité par la fonctionnalité OCCT disponible de FreeCAD dans vos scripts Python, il est temps de charger pythonOCC
.
Usage
Actuellement dans l'Atelier Part, nous avons les méthodes Part.__toPythonOCC__()
et Part.__fromPythonOCC__()
pour échanger TopoDS_Shape
(Part TopoShape) entités vers et depuis pythonOCC. Cela nous permet d'utiliser toute la puissance d'OCTT en Python puis de remettre les formes résultantes dans FreeCAD.
PythonOCC is internally used by the IFC viewer included with the IfcOpenShell libraries. IfcOpenShell is used to read and write IFC documents with FreeCAD, through the Arch and BIM Workbenches. PythonOCC is only needed to launch IfcOpenShell's integrated viewer, otherwise, it is not used at all by FreeCAD.
More information
- Project page: pythonocc.org
- Newer version compatible with OCCT 7.4, tpaviot/pythonocc-core.
- Older version compatible with OCE 0.18, the community edition of OCCT 6.9.x, tpaviot/pythonocc.
- IfcPlusPlus compiled on Gentoo - questions and alternatives?

- FreeCAD scripting: Python, Introduction to Python, Python scripting tutorial, FreeCAD Scripting Basics
- Modules: Builtin modules, Units, Quantity
- Workbenches: Workbench creation, Gui Commands, Commands, Installing more workbenches
- Meshes and Parts: Mesh Scripting, Topological data scripting, Mesh to Part, PythonOCC
- Parametric objects: Scripted objects, Viewproviders (Custom icon in tree view)
- Scenegraph: Coin (Inventor) scenegraph, Pivy
- Graphical interface: Interface creation, Interface creation completely in Python (1, 2, 3, 4, 5), PySide, PySide examples beginner, intermediate, advanced
- Macros: Macros, How to install macros
- Embedding: Embedding FreeCAD, Embedding FreeCADGui
- Other: Expressions, Code snippets, Line drawing function, FreeCAD vector math library (deprecated)
- Hubs: User hub, Power users hub, Developer hub