Import and Execute OpenSCAD Files in FreeCAD

FreeCAD features native interoperability with OpenSCAD through a dedicated workbench, enabling you to import, process, and convert .scad scripts directly into parametric 3D CAD models. This guide covers how to set up the OpenSCAD executable within FreeCAD preferences, open your code, and execute the geometry generation process.

Step 1: Configure the OpenSCAD Path in FreeCAD

Before FreeCAD can process complex OpenSCAD code and CSG (Constructive Solid Geometry) operations, it requires access to the installed OpenSCAD engine on your system.

  1. Ensure OpenSCAD is installed on your computer.
  2. Launch FreeCAD.
  3. Open the preferences menu by navigating to Edit > Preferences (or FreeCAD > Preferences on macOS).
  4. In the left sidebar, select OpenSCAD.
  5. Locate the OpenSCAD executable field under the OpenSCAD settings tab.
  6. Click the browse button and point to the path of the OpenSCAD binary:
    • Windows: Usually C:\Program Files\OpenSCAD\openscad.exe
    • Linux: Typically /usr/bin/openscad
    • macOS: Typically /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
  7. Click Apply and then OK.

Step 2: Import the OpenSCAD File

Once configured, FreeCAD can open .scad files directly through its standard file handling options.

  1. Go to File > Open or File > Import.
  2. Set the file format filter to OpenSCAD files (.scad .SCAD) or All files.
  3. Select your .scad file and click Open.

FreeCAD calls the external OpenSCAD executable in the background to evaluate the script, parse the CSG tree, and display the resulting solids in the 3D viewport.

Step 3: Work with the OpenSCAD Workbench

To manipulate the executed geometry or run specific OpenSCAD commands inside FreeCAD:

  1. Switch to the OpenSCAD Workbench using the workbench selector drop-down menu at the top of the interface.
  2. Inspect the Tree View in the left panel. Your model will appear as a hierarchy of CSG operations (such as unions, differences, and intersections).
  3. To convert the result into native FreeCAD geometry for further modeling, select the top-level feature in the tree view and navigate to OpenSCAD > Convert to Solid.
  4. If you need to edit the source code directly within FreeCAD, select the imported feature and access the code editor view in the properties panel to make adjustments and re-execute the feature.