Hi!
i am new in Python and C++, i wanna improving FreeCAD source code. But i do not know how did it embedded Python into C++.
I am searching in Google and find something: pybind11, CPython and Boost.Python. So, what does we use for FreeCAD? i wanna know to learning, please help me!
What does FreeCAD use to embedded Python to C++
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: What does FreeCAD use to embedded Python to C++
We use several Python binding libraries. boost.python or alternatively pybind11 is used for the flatmesh and area modules. But for the vast majority we use our own wrapper. For a class to be wrapped an XML file must be provided and an *Imp.cpp file where the C++ <-> Python stuff is done. The framework is very close to how it's described in the section of embedding in the Python documentation.haonk wrote: ↑Fri Jul 19, 2019 4:54 am Hi!
i am new in Python and C++, i wanna improving FreeCAD source code. But i do not know how did it embedded Python into C++.
I am searching in Google and find something: pybind11, CPython and Boost.Python. So, what does we use for FreeCAD? i wanna know to learning, please help me!
Re: What does FreeCAD use to embedded Python to C++
And how about GUI? what does we use for FreeCAD? i see PySide, PyQt in FreeCAD projectwmayer wrote: ↑Fri Jul 19, 2019 8:55 am We use several Python binding libraries. boost.python or alternatively pybind11 is used for the flatmesh and area modules. But for the vast majority we use our own wrapper. For a class to be wrapped an XML file must be provided and an *Imp.cpp file where the C++ <-> Python stuff is done. The framework is very close to how it's described in the section of embedding in the Python documentation.
Where should i start?
Re: What does FreeCAD use to embedded Python to C++
The above mentioned libraries are used to write your own Python wrappers for C++ classes while PySide is an already 3rd party wrapper for Qt which we can use as is.And how about GUI? what does we use for FreeCAD?
Re: What does FreeCAD use to embedded Python to C++
Thanks!!! but i have an question!
Just like Arch or Draft workbenches, Can I using only Python to create a new module? or i have to use both if i want a perfectly module?.
I didn't know about C++
Re: What does FreeCAD use to embedded Python to C++
You may have a look at the several addon workbenches to see how they build the GUI and interface with FreeCAD structures.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.