A FreeCAD macro that applies the Wave Function Collapse (WFC) algorithm to generate and iterate different design alternatives for a school layout.
This project demonstrates how generative design principles can be integrated into FreeCAD for architectural and construction applications.
freecad-wfc-school-layout/
│
├─ /docs/
│ └─ demo.mp4 # Video showing the algorithm in action
│
├─ /examples/
│ └─ WFCMaintest.FCStd # Example FreeCAD project file
│
├─ WFCV0.1.FCMacro # FreeCAD macro (Wave Function Collapse)
│
├─ README.md # Project description and usage instructions
└─ LICENSE # License file
- Implements the Wave Function Collapse algorithm in FreeCAD.
- Automatically generates multiple feasible school layout alternatives.
- Works directly with FreeCAD
.FCStdfiles. - Easy to extend for other design generation tasks.
-
Clone this repository: git clone https://github.com/yourusername/freecad-wfc-school-layout.git
-
Copy the macro file
WFCV0.1.FCMacrointo your FreeCAD Macros directory:- On Windows:
C:\Users\<YourUser>\AppData\Roaming\FreeCAD\Macro - On Linux:
~/.FreeCAD/Macro - On macOS:
~/Library/Preferences/FreeCAD/Macro
- On Windows:
-
Open FreeCAD and ensure the macro appears under Macro → Macros…
-
Open the example FreeCAD file:
examples/WFCMaintest.FCStd -
Run the macro
WFCV0.1.FCMacrofrom FreeCAD. (You can run it viaMacro → Macros…and selecting it from the list.) -
The algorithm will iterate through layout configurations and generate alternatives.
- FreeCAD 0.21 or later
- Python 3.x (built into FreeCAD)
- No external libraries required
This project is licensed under the MIT License. You are free to use, modify, and distribute it with attribution.
Contributions are welcome!
- Fork the repo and submit pull requests for improvements.
Developed by Bassel Harby Feel free to reach out for collaborations or suggestions!
