diff --git a/.gitignore b/.gitignore index 3c40110..6813f69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,38 @@ *.xml *.iml -.idea \ No newline at end of file +.idea + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# Virtual environments +.venv/ +venv/ +ENV/ + +# Lock files +uv.lock + +# IDE +.vscode/ +*.swp +*.swo \ No newline at end of file diff --git a/src/fluency/__pycache__/__init__.cpython-312.pyc b/src/fluency/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 1bc1bbd..0000000 Binary files a/src/fluency/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/__pycache__/main.cpython-312.pyc b/src/fluency/__pycache__/main.cpython-312.pyc deleted file mode 100644 index 03b8697..0000000 Binary files a/src/fluency/__pycache__/main.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/geometry/__pycache__/__init__.cpython-312.pyc b/src/fluency/geometry/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 1a6f52d..0000000 Binary files a/src/fluency/geometry/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/geometry/__pycache__/base.cpython-312.pyc b/src/fluency/geometry/__pycache__/base.cpython-312.pyc deleted file mode 100644 index 1ee15b5..0000000 Binary files a/src/fluency/geometry/__pycache__/base.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/geometry_occ/__pycache__/__init__.cpython-312.pyc b/src/fluency/geometry_occ/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 7675b18..0000000 Binary files a/src/fluency/geometry_occ/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/geometry_occ/__pycache__/kernel.cpython-312.pyc b/src/fluency/geometry_occ/__pycache__/kernel.cpython-312.pyc deleted file mode 100644 index 0e5faa8..0000000 Binary files a/src/fluency/geometry_occ/__pycache__/kernel.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/geometry_occ/__pycache__/sketch.cpython-312.pyc b/src/fluency/geometry_occ/__pycache__/sketch.cpython-312.pyc deleted file mode 100644 index 3bf94b7..0000000 Binary files a/src/fluency/geometry_occ/__pycache__/sketch.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/models/__pycache__/__init__.cpython-312.pyc b/src/fluency/models/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index feb8c4d..0000000 Binary files a/src/fluency/models/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/models/__pycache__/data_model.cpython-312.pyc b/src/fluency/models/__pycache__/data_model.cpython-312.pyc deleted file mode 100644 index 4f7bfce..0000000 Binary files a/src/fluency/models/__pycache__/data_model.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/rendering/__pycache__/__init__.cpython-312.pyc b/src/fluency/rendering/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 989aaae..0000000 Binary files a/src/fluency/rendering/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/rendering/__pycache__/base.cpython-312.pyc b/src/fluency/rendering/__pycache__/base.cpython-312.pyc deleted file mode 100644 index 39fc249..0000000 Binary files a/src/fluency/rendering/__pycache__/base.cpython-312.pyc and /dev/null differ diff --git a/src/fluency/rendering/__pycache__/pygfx_renderer.cpython-312.pyc b/src/fluency/rendering/__pycache__/pygfx_renderer.cpython-312.pyc deleted file mode 100644 index 3f766e6..0000000 Binary files a/src/fluency/rendering/__pycache__/pygfx_renderer.cpython-312.pyc and /dev/null differ diff --git a/src/fluency_cad.egg-info/PKG-INFO b/src/fluency_cad.egg-info/PKG-INFO deleted file mode 100644 index cf3f1b3..0000000 --- a/src/fluency_cad.egg-info/PKG-INFO +++ /dev/null @@ -1,146 +0,0 @@ -Metadata-Version: 2.4 -Name: fluency-cad -Version: 2.0.0 -Summary: Parametric CAD application with OpenCASCADE geometry kernel -Author: Fluency CAD Team -License: MIT -Project-URL: Homepage, https://github.com/fluency-cad/fluency -Project-URL: Documentation, https://github.com/fluency-cad/fluency#readme -Project-URL: Repository, https://github.com/fluency-cad/fluency -Keywords: cad,parametric,opencascade,3d-modeling -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: End Users/Desktop -Classifier: License :: OSI Approved :: MIT License -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: 3.12 -Classifier: Topic :: Scientific/Engineering :: CAD -Requires-Python: >=3.10 -Description-Content-Type: text/markdown -Requires-Dist: cadquery>=2.4 -Requires-Dist: pygfx>=0.1.0 -Requires-Dist: wgpu>=0.1.0 -Requires-Dist: PySide6>=6.4.0 -Requires-Dist: numpy>=1.24.0 -Requires-Dist: scipy>=1.10.0 -Requires-Dist: pillow>=10.0.0 -Provides-Extra: dev -Requires-Dist: pytest>=8.0; extra == "dev" -Requires-Dist: black>=24.0; extra == "dev" -Requires-Dist: mypy>=1.8; extra == "dev" -Requires-Dist: ruff>=0.4.0; extra == "dev" - -# Fluency CAD 2.0 - -A parametric CAD application built on OpenCASCADE Technology (OCCT) with a modern pygfx-based 3D renderer. - -## Features - -- **OpenCASCADE Geometry Kernel**: Industry-standard BRep geometry with exact precision -- **STEP/IGES Import/Export**: Full support for industry-standard CAD file formats -- **Parametric Sketching**: 2D sketching with constraint solving using CadQuery -- **Boolean Operations**: Union, difference, and intersection -- **Fillet & Chamfer**: Apply edge treatments to solid bodies -- **Modern Renderer**: WebGPU-based rendering with pygfx (smaller footprint than VTK) - -## Architecture - -``` -fluency/ -├── src/fluency/ -│ ├── geometry/ # Geometry abstraction layer -│ │ └── base.py # Abstract interfaces -│ ├── geometry_occ/ # OpenCASCADE implementation -│ │ ├── kernel.py # OCGeometryKernel -│ │ └── sketch.py # OCCSketch with constraints -│ ├── rendering/ # Rendering abstraction -│ │ ├── base.py # Abstract renderer -│ │ └── pygfx_renderer.py -│ ├── models/ # Data models -│ │ └── data_model.py # Project, Component, Sketch, Body -│ └── main.py # Application entry point -├── tests/ -│ └── test_geometry.py -└── pyproject.toml -``` - -## Installation - -```bash -# Create virtual environment -python -m venv .venv -source .venv/bin/activate # On Windows: .venv\Scripts\activate - -# Install dependencies -pip install -e ".[dev]" -``` - -## Dependencies - -| Package | Purpose | -|---------|---------| -| cadquery | High-level OpenCASCADE Python bindings | -| ocp | Low-level OpenCASCADE Python bindings | -| pygfx | WebGPU-based 3D renderer | -| wgpu | WebGPU Python bindings | -| PySide6 | Qt GUI framework | -| numpy | Numerical computing | -| scipy | Scientific computing | - -## Usage - -```bash -# Run the application -fluency-cad - -# Or directly -python -m fluency.main -``` - -## API Example - -```python -from fluency.geometry_occ.kernel import OCGeometryKernel -from fluency.geometry.base import Point2D - -# Create kernel -kernel = OCGeometryKernel() - -# Create a sketch -points = [ - Point2D(0, 0), - Point2D(10, 0), - Point2D(10, 10), - Point2D(0, 10), -] -polygon = kernel.create_polygon(points) - -# Extrude to 3D -body = kernel.extrude(polygon, height=20.0) - -# Apply fillet -body = kernel.fillet(body, radius=2.0) - -# Export to STEP -kernel.export_step(body, "part.step") - -# Export to STL -kernel.export_stl(body, "part.stl") -``` - -## Comparison: Before vs After - -| Aspect | Before (SDF + VTK) | After (OCC + pygfx) | -|--------|-------------------|---------------------| -| Geometry Precision | Approximate (mesh) | Exact (BRep) | -| Export Formats | STL only | STEP, IGES, STL, BREP | -| File Size | Large (mesh) | Small (BRep) | -| Fillet/Chamfer | Approximate | Exact | -| Dependency Size | ~200MB (VTK) | ~30MB (pygfx) | -| Constraint Solver | SolveSpace (separate) | CadQuery (integrated) | - -## License - -MIT License diff --git a/src/fluency_cad.egg-info/SOURCES.txt b/src/fluency_cad.egg-info/SOURCES.txt deleted file mode 100644 index 67d87c7..0000000 --- a/src/fluency_cad.egg-info/SOURCES.txt +++ /dev/null @@ -1,23 +0,0 @@ -README.md -pyproject.toml -src/fluency/__init__.py -src/fluency/main.py -src/fluency/geometry/__init__.py -src/fluency/geometry/base.py -src/fluency/geometry_occ/__init__.py -src/fluency/geometry_occ/kernel.py -src/fluency/geometry_occ/sketch.py -src/fluency/models/__init__.py -src/fluency/models/data_model.py -src/fluency/rendering/__init__.py -src/fluency/rendering/base.py -src/fluency/rendering/pygfx_renderer.py -src/fluency/utils/__init__.py -src/fluency/widgets/__init__.py -src/fluency_cad.egg-info/PKG-INFO -src/fluency_cad.egg-info/SOURCES.txt -src/fluency_cad.egg-info/dependency_links.txt -src/fluency_cad.egg-info/entry_points.txt -src/fluency_cad.egg-info/requires.txt -src/fluency_cad.egg-info/top_level.txt -tests/test_geometry.py \ No newline at end of file diff --git a/src/fluency_cad.egg-info/dependency_links.txt b/src/fluency_cad.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/src/fluency_cad.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/fluency_cad.egg-info/entry_points.txt b/src/fluency_cad.egg-info/entry_points.txt deleted file mode 100644 index 5a75165..0000000 --- a/src/fluency_cad.egg-info/entry_points.txt +++ /dev/null @@ -1,2 +0,0 @@ -[console_scripts] -fluency-cad = fluency.main:main diff --git a/src/fluency_cad.egg-info/requires.txt b/src/fluency_cad.egg-info/requires.txt deleted file mode 100644 index bf2ecea..0000000 --- a/src/fluency_cad.egg-info/requires.txt +++ /dev/null @@ -1,13 +0,0 @@ -cadquery>=2.4 -pygfx>=0.1.0 -wgpu>=0.1.0 -PySide6>=6.4.0 -numpy>=1.24.0 -scipy>=1.10.0 -pillow>=10.0.0 - -[dev] -pytest>=8.0 -black>=24.0 -mypy>=1.8 -ruff>=0.4.0 diff --git a/src/fluency_cad.egg-info/top_level.txt b/src/fluency_cad.egg-info/top_level.txt deleted file mode 100644 index cf4e381..0000000 --- a/src/fluency_cad.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -fluency diff --git a/tests/__pycache__/test_geometry.cpython-312-pytest-9.0.2.pyc b/tests/__pycache__/test_geometry.cpython-312-pytest-9.0.2.pyc deleted file mode 100644 index 708d10e..0000000 Binary files a/tests/__pycache__/test_geometry.cpython-312-pytest-9.0.2.pyc and /dev/null differ