PythonOCC
Description
PythonOCC è un progetto abbastanza giovane e dinamico che mira a unire la gamma di funzioni di OpenCascade in un modulo python. Questo è un metodo molto differente da quello di FreeCAD, che utilizza solo alcuni componenti di OpenCascade, e che risulta una struttura molto più semplice.
PythonOCC, d'altra parte, dato che fornisce l'accesso a tutte le classi e funzioni OCC, è molto complesso, ma è anche molto potente. È quindi una bella aggiunta a FreeCAD. Quando si è limitati dalle funzionalità OCC disponibili in FreeCAD per gli script python, è il momento di caricare pythonOCC.
Usage
Attualmente nel modulo Parte abbiamo i metodi: Part.__toPythonOCC__() e Part.__fromPythonOCC__() per scambiare entità TopoDS_Shape da o per pythonOCC. Questo permette di utilizzare tutta la potenza di OCC in python (con pythonocc) e poi di mettere nuovamente le forme risultanti in 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