PythonOCC

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

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