Freecad Internals (dev)

Developer hub / Power users hub / mastodon

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.

caption

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.

caption

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

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:

build process

Written on July 3, 2023, Last update on June 18, 2025
freecad code-review python