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
File details
Details for the file ocp-freecad-cam-0.9.4.tar.gz
.
File metadata
- Download URL: ocp-freecad-cam-0.9.4.tar.gz
- Upload date:
- Size: 124.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e29582f5542244ab605b51612e32445f3fa2dd5b7aa6b8a12e2428b804e20de5 |
|
MD5 | 94bbc0cb0e87e09851b643edddf4f023 |
|
BLAKE2b-256 | 86c73825a3a1bc639bf428fa6f6bcaa009ddcf147db928ca34bc943491735500 |
File details
Details for the file ocp_freecad_cam-0.9.4-py3-none-any.whl
.
File metadata
- Download URL: ocp_freecad_cam-0.9.4-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ecfb60e44ea25d295b764ee9c375031d8a2b305c50051731a1b6e77240e4df |
|
MD5 | ae838a902e72f814a0f5f9db78047d0c |
|
BLAKE2b-256 | 0f6587ab75c2c310f97f0f3cdc5df51877b9f9e3f9b7e0707f8326c3737da765 |