OCP FreeCAD CAM
Project description
Overview
oc-freecad-cam exposes FreeCAD's Path workbench in a fluent python API that takes OCP TopoDS_Shape objects and their wrappers from CadQuery and Build123d to enable generating parametric tool paths from the comfort of your keyboard.
⚠ NOTE ⚠
This project is fairly experimental at this stage. Expect bugs and always double-check the generated gcode for naughty surprises.
Usage
See documentation at https://ocp-freecad-cam.readthedocs.io/en/latest/
Installation
ocp-freecad-cam does not attempt to install runtime dependencies. Your environment must have available CadQuery and/or Build123d, or just OCP if you're feeling raw.
ocp-freecad-cam is available on pypi: https://pypi.org/project/ocp-freecad-cam/
ocp-freecad-cam requires currently a relatively fresh build of FreeCAD, ie. weekly build from https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds
The Path module of FreeCAD has seen major refactorings in 2023 so older versions are not compatible.
Runtime dependencies summary
Dev dependecies
Dev dependencies are listed in requirements-dev.txt, generated from requirements-dev.in with pip-compile
Using FreeCAD AppImage
Weekly AppImage is an easy way to get started. Download the AppImage, place it in a suitable empty folder and extract it.
mkdir ~/freecad
cp ~/Downloads/FreeCAD_weekly-builds-33345-2023-06-04-conda-Linux-x86_64-py310.AppImage ~/freecad
cd ~/freecad
chmod +x ./FreeCAD_weekly-builds-33345-2023-06-04-conda-Linux-x86_64-py310.AppImage
./FreeCAD_weekly-builds-33345-2023-06-04-conda-Linux-x86_64-py310.AppImage --appimage-extract
Configuring FreeCAD paths
For this module to work, it needs to be able to find
- FreeCAD C libraries
- FreeCAD Path python libraries
- (AppImage only?) Some other Python modules located in FreeCAD's site-packages
This can be done by updating your virtual environment PYTHONPATH or by creating a pth file in site-packages.
The three paths (also contents of the .pth file) for the above AppImage example are
/home/user/freecad/squashfs-root/usr/lib
/home/user/freecad/squashfs-root/usr/Mod/Path
/home/user/freecad/squashfs-root/usr/lib/python3.10/site-packages/
in a file like
/home/user/miniconda3/envs/cq/lib/python3.10/site-packages/freecad.pth
Limitations
Pocket3D does not work, possibly related to https://github.com/FreeCAD/FreeCAD/issues/6815 - shouldn't be a big loss though, Surface3D can get the same things done IMO.
VCarve can produce unstable toolpaths, but that is probably a bug in the underlying openvoronoi library. Tweaking the job params may help.
Contributing
Contributions are welcome.
- Missing params, fixes
- Tests
- Documentation
PR's
Apply black and isort and ensure that tests pass. Preferably also include test coverage for new code.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ocp_freecad_cam-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffa9cda1677ad140ca18302faa889bfa74fffce8e6aef8f85d21536c28feeca0 |
|
MD5 | 06af3938d1802b1a0724501d967c8aea |
|
BLAKE2b-256 | 1c26698866869f10abfbfe6c46d655189bc0a204ef79a5be2086f324120dfdfc |