Este é o local ideal para você, se for um usuário experiente e deseja aprender mais sobre como personalizar e expandir o FreeCAD.
O FreeCAD é extensível por meio de código Python que é executado diretamente no console Python, ou carregado a partir de módulos na inicialização. Isso significa que você pode modificar o FreeCAD sem precisar recompilar o programa. Por exemplo, você pode:
- Criar e modificar geometria: você pode criar um novo tipo de objeto, seja do zero ou adaptando um tipo existente.
- Criar ferramentas e comandos personalizados: adicione seu próprio conjunto de ferramentas que executam seu código.
- Modificar a interface: crie barras de ferramentas para adicionar suas ferramentas, crie janelas especiais, painéis ou interfaces para interagir com suas ferramentas.
- Modificar a representação do scenegraph: O FreeCAD possui processos separados para construir a geometria e exibi-la na tela. Você tem acesso total à maneira como o conteúdo da cena é exibido, portanto, pode modificar essa representação, interagir com ela ou adicionar comportamentos personalizados. Também é possível adicionar widgets de tela personalizados, como informações, manipuladores, âncoras ou entidades temporárias.
Se você gostaria de contribuir com conteúdo para essas páginas, solicite uma conta na wiki com permissões de editor [aqui no fórum](https://forum.freecadweb.org/viewtopic.php?f=21&t=6830) e leia as Páginas da Wiki para as diretrizes gerais que você deve seguir. Para outras formas de contribuir com o projeto, veja a página Ajuda FreeCAD.
Customizando o FreeCAD
Programação em FreeCAD
Gerais
Modulos
The functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.
- The Builtin modules are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.
- Workbench creation shows you how to create your own workbench
Working with Meshes
Working with Parts
Accessing the Coin scenegraph
Controlling the Qt interface
Working with parametric objects
Examples
- Code snippets : A collection of pieces of FreeCAD Python code, to serve as ingredients in your scripts...
- Line drawing function: How to build a simple tool to draw lines
- Dialog creation: How to construct dialogs with Qt designer, and use them in FreeCAD
- Embedding FreeCAD: How to import FreeCAD as a Python module in other applications
- The Draft Workbench adds basic 2d drawing functions to freecad. It is written entirely in Python, so it can be a good example if you want to write your own modules.
- FreeCAD vector math library : A couple of handy functions to manipulate FreeCAD vectors. This library is also included in the Draft module.
API Functions
The complete API documentation of FreeCAD is located at http://www.freecadweb.org/api/ . It contains both C++ and Python APIs, and is not totally well formatted yet, which can be confusing when looking for python-only code. An easier to browse version can be found here. Note that it can be incomplete, since it is updated manually. For more accurate information, browse the modules directly from FreeCAD's Python console.
Related: Exposing C++ to Python
Advanced modification
Python tutorials
These are good generic tutorials, not specific to FreeCAD, that might interest you if you are totally new to python.
Python
PySide - How to create and manage FreeCAD's Qt UI interface from python
The following two references are PyQt specific (not PySide) but may offer some information of use:
Pivy - How to interact with FreeCAD's 3D scenes
On the Community portal, you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to Help FreeCAD.
Power user documentation
- Parametric objects: Scripted objects, Viewproviders (Custom icon in tree view)
- Scenegraph: Coin (Inventor) scenegraph, Pivy
- Graphical interface: Interface creation, Interface creation completely in Python (1, 2, 3, 4, 5), PySide, PySide examples beginner, intermediate, advanced
- Macros: Macros, How to install macros
- Embedding: Embedding FreeCAD, Embedding FreeCADGui