PythonOCC/fr: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
No edit summary
Line 3: Line 3:
== Description ==
== Description ==


[[PythonOCC/fr|PythonOCC]] est un projet qui vise à fournir toute la gamme des fonctions [[OpenCASCADE/fr|OpenCASCADE Technology]] (OCCT) via le module [[Python/fr|Python]] {{incode|OCC}}. C'est une approche différente de celle de FreeCAD, où seuls certains composants d'OCCT sont exposés via l'[[Part_Module/fr|atelier Part]].
<div class="mw-translate-fuzzy">
[[PythonOCC/fr|PythonOCC]] est un projet qui vise à lier l'ensemble des fonctions de la technologie OpenCASCADE (OCCT) dans un module [[Python/fr|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 [http://www.pythonocc.org/ pythonocc.org].
</div>


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">

Revision as of 17:31, 20 February 2021

Description

PythonOCC est un projet qui vise à fournir toute la gamme des fonctions OpenCASCADE Technology (OCCT) via le module Python OCC. C'est une approche différente de celle de FreeCAD, où seuls certains composants d'OCCT sont exposés via l'atelier Part.

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. PythonOCC is only needed to launch IfcOpenShell's integrated viewer, otherwise it is not necessary.

Installation

PythonOCC must be compiled from source. For this you need to get the corresponding development files for OpenCASCADE Technology (OCCT) and SWIG. The older version of PythonOCC was intended to wrap around OCE 0.18, the community edition of OCCT 6.9.x, which is now unmaintained. The newest version of PythonOCC is now intended to work with the recent, official OCCT 7.4 version.

Together with OCCT 7.4, PythonOCC requires fairly recent dependencies like Python 3.7, CMake 3.12, and SWIG 3.0.11. Python 2 is no longer supported.

It is also possible to install pre-compiled PythonOCC libraries using Conda. For more information and compilation instructions, see the main project's repository, tpaviot/pythonocc-core.

More information