Add macOS support - #1
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
(BTW, I pointed Claude at this repo when I saw there was a need for macOS as well, and it set up the PR above. But I'm a real guy, looking to support this as needed. Thanks for putting together the workbench!) |
Owner
|
Thank you — the macOS support has been merged after all 198 tests passed on both Windows and macOS. I added a visible follow-up note to the English and German documentation clarifying that the OpenCV workflow has been tested on Apple silicon, while the optional SAM / Light HQ-SAM full-vision path remains experimental on macOS until it receives equivalent end-to-end testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds macOS as a supported platform. The workbench code was already portable; this PR contributes a cross-platform per-user installer, platform-aware filesystem paths, docs, and a macOS CI leg.
scan2sketch/platform_paths.py— resolves the venv interpreter layout (bin/pythonvsScripts\python.exe), the per-user cache root (~/Library/Caches/%LOCALAPPDATA%/ XDG), and the FreeCAD user-data base. All previously Windows-hardcoded path sites inexternal_backend,calibration_runtime,diagnostics,calibration_profile, and the calibration dialogs now go through it. Windows behavior is unchanged.scripts/install_user_addon.py/uninstall_user_addon.py— stdlib-only ports of the PowerShell installers for macOS/Linux: same copy/dev-link modes, safety stops, SHA-256-verified model downloads, and isolated venvs built from FreeCAD's bundled Python. The installer asksfreecadcmdforApp.getUserAppDataDir()so it keeps targeting the right versioned directory (v1-1,v1-2, ...) across FreeCAD upgrades, and finds the bundle Python inside/Applications/FreeCAD*.appautomatically. On Windows these scripts defer to the existing.ps1files.shapelytest dependency inrequirements-opencv-spike.txt.scan2sketch/core/offset.pyrelies on the Shapely that FreeCAD ships at runtime, but the FreeCAD-independent test environment never declared it, sotest_offset.py's robust-offset test fails in a fresh CI-style environment on every platform (same situation SciPy was in before 7367ce1). Pinned to 2.1.2 to match FreeCAD 1.1.1's bundled version.core-tests.ymlnow runs awindows-latest+macos-latestmatrix.INSTALL_MACOS.md(linked from README/INSTALL.md), including honest platform floors: macOS 13+ on Apple silicon, macOS 14+ on Intel (the opencv wheel floor), and OpenCV-mode-only on Intel Macs since PyTorch publishes no Intel macOS wheels for the pinned torch — the installer fails fast with that explanation.Testing
App.getUserAppDataDir()), scan analysis through the isolated OpenCV helper, and sketch creation (5 geometries, ±0.082 mm reported uncertainty). Diagnostic export and uninstall verified.--full-vision(SAM) runtime and real-scanner input.Notes for maintainers
torch==2.5.1has no cp313 wheels on any platform, so if a future FreeCAD bundles Python 3.13 the full-vision install breaks on Windows too; the pin will need a bump at that point.🤖 Generated with Claude Code