PythonOCC/fr: Difference between revisions
(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 à |
||
</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
- 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?
- Scripts FreeCAD : Python, Introduction à Python, Tutoriel sur les scripts Python, Débuter avec les scripts
- Modules : Modules intégrés, Unités, Quantity
- Ateliers : Création d'atelier, Commands Gui, Les commandes, Installer des ateliers supplémentaires
- Maillages et objets Parts : Scripts Mesh, Script de données topologiques, Conversion objet Mesh en Part, PythonOCC
- Objets paramétriques : Objets créés par script, Viewproviders (Icône personnalisée dans l'arborescence)
- Scénographie : Graphe de scène Coin (Inventor), Pivy
- Interface graphique : Création d'interface, Création d'une boite de dialogue (1, 2, 3, 4, 5), PySide, Exemples PySide débutant, intermédiaire, expérimenté
- Macros : Macros, Comment installer des macros
- Intégration : Intégrer FreeCAD, Intégration de FreeCADGui
- Autre : Expressions, Extraits de codes, Fonction - tracer une ligne, Bibliothèque mathématique vectorielle de FreeCAD (déprécié)