
# 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 is available on pypi: https://pypi.org/project/ocp-freecad-cam/
ocp-freecad-cam does not attempt to install runtime dependencies since it's designed to run with
any combination of these three:
* [CadQuery](https://github.com/CadQuery/cadquery)
* [Build123d](https://github.com/gumyr/build123d)
* [OCP](https://github.com/CadQuery/OCP)
Additionally, FreeCAD module needs to be available.
## General guideline for hooking on FreeCAD
There are at least three options to approach this
1) Using the FreeCAD Python interpreter
2) Using system interpreter with the same major version as the FreeCAD Python interpreter
3) Compiling FreeCAD to use the system interpreter
Number one is now the recommended way and will be documented below
## Acquiring FreeCAD
Two options. Please use at FreeCAD version 1.0.0 or greater. If for some
reason you'd prefer to use an older version of FreeCAD (v0.21), see the
[v0.9.4](https://github.com/voneiden/ocp-freecad-cam/releases/tag/v0.9.4) release of
ocp-freecad-cam.
1) Official distributions https://www.freecad.org/downloads.php
2) Official portable packages https://github.com/FreeCAD/FreeCAD/releases
* includes weekly packages
## Linux AppImage installation example using a venv
This is fairly straightforward. Download the AppImage, extract it, create a virtual environment
from the included interpreter, include lib, activate it and install your preferred packages.
* https://docs.python.org/3/library/venv.html
```bash
mkdir freecad
cd freecad
wget https://github.com/voneiden/FreeCAD-Bundle/releases/download/0.21.2/FreeCAD_0.21.2-2023-12-26-conda-Linux-x86_64-py311.AppImage
chmod +x FreeCAD_0.21.2-2023-12-26-conda-Linux-x86_64-py311.AppImage
./FreeCAD_0.21.2-2023-12-26-conda-Linux-x86_64-py311.AppImage --appimage-extract
./squashfs-root/usr/bin/python -m venv --system-site-packages fcvenv
echo "$PWD/squashfs-root/usr/lib" > fcvenv/lib/python3.11/site-packages/freecad.pth
source fcenv/bin/activate
pip install cadquery build123d ocp-freecad-cam
```
Test that your interpreter works by running
```bash
python -c "import FreeCAD"
```
## Windows 7z installation example
While I would suggest using WLS, if you want to stick to pure windows, the general idea is the same
as above in the linux example with two exceptions.
1) Instead of `"$PWD/squashfs-root/usr/lib" > fcvenv/lib/python3.11/site-packages/freecad.pth` use
```shell
"$($PWD)\..\src" | Out-File -FilePath "fcvenv\Lib\site-packages\ocp_freecad_cam.pth"
```
or create the pth file manually somehow. Just note that the venv file structure is a bit different on Windows.
2) Instead of `source` you activate the venv with just
```shell
.\fcvenv\Scripts\activate
```
## Dev dependencies
Dev dependencies are listed in requirements-dev.txt, generated from requirements-dev.in with `pip-compile`
# 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.
Raw data
{
"_id": null,
"home_page": null,
"name": "ocp-freecad-cam",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "cadquery, viewer",
"author": null,
"author_email": "Matti Eiden <snaipperi@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/6d/f0/0fe126835572255ea40cf74933c5188714ebcd89f42a5550256981dc58d1/ocp_freecad_cam-1.0.0.tar.gz",
"platform": null,
"description": "\n\n\n# Overview\n\noc-freecad-cam exposes FreeCAD's Path workbench in a fluent python API that takes\nOCP TopoDS_Shape objects and their wrappers from CadQuery and Build123d to enable generating\nparametric tool paths from the comfort of your keyboard.\n\n\n\n\n\u26a0 NOTE \u26a0\n--------\n\nThis project is fairly experimental at this stage. Expect bugs and always\ndouble-check the generated gcode for naughty surprises.\n# Usage\n\nSee documentation at \nhttps://ocp-freecad-cam.readthedocs.io/en/latest/\n\n# Installation\n\nocp-freecad-cam is available on pypi: https://pypi.org/project/ocp-freecad-cam/\nocp-freecad-cam does not attempt to install runtime dependencies since it's designed to run with\nany combination of these three:\n\n* [CadQuery](https://github.com/CadQuery/cadquery)\n* [Build123d](https://github.com/gumyr/build123d)\n* [OCP](https://github.com/CadQuery/OCP)\n\nAdditionally, FreeCAD module needs to be available.\n\n## General guideline for hooking on FreeCAD\n\nThere are at least three options to approach this\n\n1) Using the FreeCAD Python interpreter\n2) Using system interpreter with the same major version as the FreeCAD Python interpreter\n3) Compiling FreeCAD to use the system interpreter\n\nNumber one is now the recommended way and will be documented below\n\n## Acquiring FreeCAD\n\nTwo options. Please use at FreeCAD version 1.0.0 or greater. If for some\nreason you'd prefer to use an older version of FreeCAD (v0.21), see the\n[v0.9.4](https://github.com/voneiden/ocp-freecad-cam/releases/tag/v0.9.4) release of\nocp-freecad-cam. \n\n1) Official distributions https://www.freecad.org/downloads.php\n2) Official portable packages https://github.com/FreeCAD/FreeCAD/releases\n * includes weekly packages\n\n## Linux AppImage installation example using a venv\n\nThis is fairly straightforward. Download the AppImage, extract it, create a virtual environment\nfrom the included interpreter, include lib, activate it and install your preferred packages. \n\n* https://docs.python.org/3/library/venv.html\n\n```bash \nmkdir freecad\ncd freecad \nwget https://github.com/voneiden/FreeCAD-Bundle/releases/download/0.21.2/FreeCAD_0.21.2-2023-12-26-conda-Linux-x86_64-py311.AppImage\nchmod +x FreeCAD_0.21.2-2023-12-26-conda-Linux-x86_64-py311.AppImage\n./FreeCAD_0.21.2-2023-12-26-conda-Linux-x86_64-py311.AppImage --appimage-extract\n./squashfs-root/usr/bin/python -m venv --system-site-packages fcvenv\necho \"$PWD/squashfs-root/usr/lib\" > fcvenv/lib/python3.11/site-packages/freecad.pth\nsource fcenv/bin/activate\npip install cadquery build123d ocp-freecad-cam \n```\n\nTest that your interpreter works by running\n\n```bash \npython -c \"import FreeCAD\"\n```\n\n## Windows 7z installation example\nWhile I would suggest using WLS, if you want to stick to pure windows, the general idea is the same \nas above in the linux example with two exceptions. \n\n1) Instead of `\"$PWD/squashfs-root/usr/lib\" > fcvenv/lib/python3.11/site-packages/freecad.pth` use \n\n```shell\n\"$($PWD)\\..\\src\" | Out-File -FilePath \"fcvenv\\Lib\\site-packages\\ocp_freecad_cam.pth\"\n```\n\nor create the pth file manually somehow. Just note that the venv file structure is a bit different on Windows.\n\n2) Instead of `source` you activate the venv with just\n\n```shell\n.\\fcvenv\\Scripts\\activate\n```\n\n\n## Dev dependencies\n\nDev dependencies are listed in requirements-dev.txt, generated from requirements-dev.in with `pip-compile`\n\n# Limitations\n\nPocket3D does not work, possibly related to https://github.com/FreeCAD/FreeCAD/issues/6815 - shouldn't be a big loss\nthough, Surface3D can get the same things done IMO.\n\nVCarve can produce unstable toolpaths, but that is probably a bug in the underlying openvoronoi library. Tweaking the \njob params may help.\n\n# Contributing\n\nContributions are welcome.\n\n* Missing params, fixes\n* Tests\n* Documentation\n\n## PR's\n\nApply black and isort and ensure that tests pass. Preferably also include test coverage for new code.\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "OCP FreeCAD CAM",
"version": "1.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/voneiden/ocp-freecad-cam/issues/",
"Documentation": "https://github.com/voneiden/ocp-freecad-cam/",
"Source Code": "https://github.com/voneiden/ocp-freecad-cam/"
},
"split_keywords": [
"cadquery",
" viewer"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5c3198b5b9df70a4006280c5150cc44d88decec362a4e899b5d5e5a1d9482efa",
"md5": "477419870092d7f800e2ca72228d7de6",
"sha256": "2256f875a8adafea1fcc0dedaddd8b74acec5982f23683c72b2626eafa975a0f"
},
"downloads": -1,
"filename": "ocp_freecad_cam-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "477419870092d7f800e2ca72228d7de6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 31632,
"upload_time": "2025-09-06T20:48:47",
"upload_time_iso_8601": "2025-09-06T20:48:47.791043Z",
"url": "https://files.pythonhosted.org/packages/5c/31/98b5b9df70a4006280c5150cc44d88decec362a4e899b5d5e5a1d9482efa/ocp_freecad_cam-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6df00fe126835572255ea40cf74933c5188714ebcd89f42a5550256981dc58d1",
"md5": "3f03080567edc334691dc6b11754ba5e",
"sha256": "05760a5df57f95ed9cba2874143d0bc39dad11e883dae059eeabcb3f9fb931b4"
},
"downloads": -1,
"filename": "ocp_freecad_cam-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "3f03080567edc334691dc6b11754ba5e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 151345,
"upload_time": "2025-09-06T20:48:48",
"upload_time_iso_8601": "2025-09-06T20:48:48.919271Z",
"url": "https://files.pythonhosted.org/packages/6d/f0/0fe126835572255ea40cf74933c5188714ebcd89f42a5550256981dc58d1/ocp_freecad_cam-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-06 20:48:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "voneiden",
"github_project": "ocp-freecad-cam",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "ocp-freecad-cam"
}