
FreeCAD
Open Source 3D Parametric CAD Modeler
Create, Modify & Automate 3D Designs with Python API for Mechanical Engineering, Architecture & Product Design.
What is FreeCAD?
FreeCAD is a powerful, open-source 3D parametric CAD modeler designed for creating real-world objects of any size. It supports parametric modeling, enabling users to easily modify designs by adjusting parameters in the model history. Built on a robust architecture using OpenCASCADE, Coin3D, Qt, and Python, FreeCAD caters to mechanical engineering, architecture, product design, and more. Its flexible Python API empowers developers and power users to automate tasks, extend functionality, and integrate with external tools. Whether you're a hobbyist, student, engineer, or educator, FreeCAD provides a professional-grade platform for 3D design without licensing costs.
FreeCAD's core strength lies in its ability to bridge 2D sketching and 3D modeling, allowing users to sketch geometry-constrained 2D profiles and extrude them into 3D features. It includes specialized workbenches for Part Design, Assembly, Drafting, Architecture, and more. The application runs natively on Windows, macOS, and Linux, ensuring broad accessibility. With active community support, comprehensive documentation, and a modular plugin architecture, FreeCAD is ideal for both beginners and experienced CAD professionals seeking a transparent, customizable, and free alternative to proprietary tools. Its integration with simulation and manufacturing workflows makes it suitable for the full product development lifecycle.
Getting Started with FreeCAD
FreeCAD is available as precompiled installers for Windows, macOS, and Linux on the latest releases page. On Linux, it's often available via your distribution's package manager or software center. For developers and advanced users, building from source is supported using CMake. The official Developers Handbook provides detailed build instructions. Once installed, launch FreeCAD and explore the workbenches via the toolbar. The Python console and macro system enable automation and customization. For learning resources, visit the Getting Started guide on the FreeCAD wiki.
Install FreeCAD via Package Manager (Linux) or Download
# Ubuntu/Debian
sudo apt install freecad
# macOS (Homebrew)
brew install --cask freecad
# Windows: Download from https://github.com/FreeCAD/FreeCAD/releases/latest
Parametric 3D Modeling with Python API
FreeCAD's parametric modeling engine allows users to define objects with editable parameters, enabling design iterations by simply adjusting values. The Python API exposes the entire modeling stack, letting developers create complex geometries programmatically. Using the Part and PartDesign workbenches, you can generate primitives, perform Boolean operations, add fillets/chamfers, and create features like pads, pockets, and revolutions—all via Python. This capability is essential for generative design, topology optimization, and integrating CAD with simulation or manufacturing workflows. The API supports both object-oriented and functional approaches, making it suitable for scripting, macros, and full-featured plugins. With access to the underlying OpenCASCADE kernel, FreeCAD delivers professional-grade geometric operations while maintaining ease of use for beginners.
Create a Parametric Cube and Modify Its Dimensions via Python
import FreeCAD as App
import Part
# Create document and object
doc = App.newDocument()
cube = doc.addObject("Part::Box", "Cube")
cube.Length = 10
cube.Width = 20
cube.Height = 30
App.ActiveDocument.recompute()
# Modify dimensions later
cube.Length = 15
App.ActiveDocument.recompute()
2D Sketching & Drafting Workbench
FreeCAD includes a robust 2D sketching environment integrated with the 3D modeling pipeline. The Sketcher workbench allows users to draw geometry-constrained 2D profiles using lines, arcs, circles, and splines. Constraints such as horizontal, vertical, parallel, perpendicular, and dimensional constraints ensure precise control over the sketch geometry. Once complete, these sketches serve as the foundation for 3D features like extrusions, revolutions, and lofts. Additionally, the Draft workbench provides tools for creating 2D vector drawings without constraints, ideal for architectural floor plans or technical illustrations. The Drawing workbench enables the generation of orthographic projections, section views, and annotated drawings from 3D models, supporting ISO-compliant technical documentation with dimensioning, tolerancing, and bill-of-materials features.
Create a Sketch, Add Constraints, and Extrude to Form a 3D Feature
import FreeCAD as App
import Sketcher
import PartDesign
doc = App.newDocument()
Part = doc.addObject("PartDesign::Body")
Sketch = doc.addObject("Sketcher::SketchObject", "Sketch")
Sketch.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(App.Vector(0,0,1),0))
# Add geometry
Sketch.addGeometry(Part.LineSegment(App.Vector(-10,0,0),App.Vector(10,0,0)),False)
Sketch.addGeometry(Part.LineSegment(App.Vector(10,0,0),App.Vector(10,10,0)),False)
Sketch.addGeometry(Part.LineSegment(App.Vector(10,10,0),App.Vector(-10,10,0)),False)
Sketch.addGeometry(Part.LineSegment(App.Vector(-10,10,0),App.Vector(-10,0,0)),False)
# Add constraints
Sketch.addConstraint(Sketcher.Constraint('Coincident',0,2,1,1))
Sketch.addConstraint(Sketcher.Constraint('Coincident',1,2,2,1))
Sketch.addConstraint(Sketcher.Constraint('Coincident',2,2,3,1))
Sketch.addConstraint(Sketcher.Constraint('Coincident',3,2,0,1))
Sketch.addConstraint(Sketcher.Constraint('Horizontal',0))
Sketch.addConstraint(Sketcher.Constraint('Vertical',1))
# Extrude
Pad = doc.addObject("PartDesign::Pad", "Pad")
Pad.Profile = Sketch
Pad.Length = 5
doc.recompute()
Assembly Design & Constraint Solving
FreeCAD supports complex assembly modeling through the Assembly4 and Assembly3 workbenches, enabling users to combine multiple parts into functional mechanisms. Assemblies are built using constraints such as coincident, parallel, perpendicular, tangent, and distance to define relative positions and movements between components. The solver automatically updates the assembly when any part or constraint is modified, ensuring design integrity. This capability is vital for mechanical engineering tasks like gear trains, linkages, and housing designs. Assemblies can be exported as STEP files for collaboration with other CAD systems, and motion simulation is possible through integration with external tools like Yade or custom Python scripts. The parametric nature of FreeCAD ensures that changes to individual parts propagate automatically to the assembly, reducing manual updates and minimizing errors.
Create a Simple Assembly with Two Parts and Apply a Coincident Constraint
import FreeCAD as App
import Assembly4
doc = App.newDocument("Assembly")
# Add parts
Part1 = doc.addObject("Part::Box", "Block1")
Part1.Length, Part1.Width, Part1.Height = 10, 10, 10
Part2 = doc.addObject("Part::Cylinder", "Cylinder1")
Part2.Radius, Part2.Height = 3, 15
# Create assembly
asm = doc.addObject("App::Part", "Assembly")
asm.Type = "Assembly"
asm.addObject(Part1)
asm.addObject(Part2)
# Apply constraint (simplified)
# In practice, use Assembly4's Constraint class for full functionality
App.ActiveDocument.recompute()
BIM & Architectural Modeling Tools
FreeCAD includes specialized tools for Building Information Modeling (BIM) and architectural design through the Arch workbench. Users can create walls, floors, roofs, windows, doors, and structural elements using intuitive parametric objects. These objects automatically update when their parameters change, supporting iterative design and compliance with building codes. The workbench supports IFC (Industry Foundation Classes) import/export, enabling interoperability with industry-standard BIM software like Revit and Archicad. Features like site planning, energy analysis setup, and material take-offs make FreeCAD suitable for early-stage architectural design and documentation. Additionally, the Draft and Sketcher workbenches integrate seamlessly for creating precise floor plans and elevations, while the Drawing workbench generates construction documents with annotations, dimensions, and schedules.
Create a Wall and Add a Window Using Python API
import FreeCAD as App
import Arch
doc = App.newDocument("Building")
# Create wall
Wall = Arch.makeWall(length=5000, width=200, height=3000)
Wall.Base = Arch.makeSketch([0,0,0], [5000,0,0], [5000,200,0], [0,200,0])
# Create window
Window = Arch.makeWindow(1200, 1500)
Window.Base = Arch.makeSketch([1000,100,0], [2200,100,0], [2200,1600,0], [1000,1600,0])
Window.Host = Wall
App.ActiveDocument.recompute()
