PythonOCC/ru

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 это довольно новый и активный проект с целью привязки всех функций OpenCasCADe Technology (OCCT) к модулю Python. Этот подход сильно отличается от подхода FreeCAD, где используются лишь некоторые компоненты OpenCasCade, что приводит к куда более простой структуре. Страница проекта есть на pythonocc.org.

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

Usage

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.

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