Freecad Internals (dev)
Organisation
FreeCAD is designed from the ground up with Python integration at its core. It provides a powerful Python API that allows users to script, automate, and extend almost every part of the application. - ChatGPT
You can write Python scripts outside of FreeCAD and run them using:
$ freecadcmd script.py
Part Module
Essentially all 2D and 3D drawing functions in every workbench (Workbench Draft.svg Draft, Workbench Sketcher.svg Sketcher, Workbench PartDesign.svg PartDesign, etc.), are based on these functions exposed by the Part Workbench. Therefore, the Part Workbench is considered the corGUI component of the modelling capabilities of FreeCAD.
Part objects are more complex than mesh objects created with the Mesh Workbench, as they permit more advanced operations like coherent boolean operations, modifications history, and parametric behaviour.
Sketcher scripting
Interface Creation
- Interface in a .ui file - This is the recommended approach.
- Interface completely in Python code - This method is recommended only for small interfaces that don’t define more than a few widgets, for example in macros.
GUI / Coin3D (SceneGraph)
In FreeCAD, normally, we don’t need to interact directly with the Open Inventor scenegraph. Every object in a FreeCAD document, being a mesh, a part shape or anything else, gets automatically converted to Open Inventor code and inserted in the main scenegraph that you see in a 3D view. That scenegraph gets updated continuously when you modify, add or remove objects. In fact every object (in App space) has a view provider (a corresponding object in Gui space) responsible for issuing Open Inventor code.
see also
- FeatureHole.cpp - where all metrics for hole are hardcoded…
Building Freecad
On recent Linux distributions, FreeCAD is generally easy to build, since all dependencies are usually provided by the package manager. It basically involves three steps:
- Getting the FreeCAD source code
- Getting the dependencies or packages that FreeCAD depends on
-
Configure with cmake and compile with make
- Using Linux Mint 22.x OpenFOAM 11 and self compiling FreeCAD (0.21.1)
- [SOLVED] help on compile FreeCAD (0.19) on Linux Mint