Commit Graph

6 Commits

Author SHA1 Message Date
bklronin daed79dac6 chore: update .gitignore and remove pycache from tracking 2026-03-14 08:59:25 +01:00
bklronin e13769840b fix: ensure renderer is initialized before operations
- Add _ensure_initialized() method to Viewer3DWidget
- Queue pending meshes until widget is shown
- Add remove_mesh() method to PygfxRenderer
- Fix all viewer methods to check initialization
2026-03-14 08:59:12 +01:00
bklronin 5371bf7c38 fix: implement custom compute_normals for pygfx
pygfx doesn't have a compute_normals function, so we implement
our own vertex normal computation from positions and face indices.
2026-03-14 08:57:52 +01:00
bklronin bf00310889 feat: implement full GUI with all features from old codebase
- Main window with left/center/right panel layout
- 2D sketch widget with drawing tools (line, rectangle, circle)
- Constraint tools (coincident, horizontal, vertical, distance, midpoint)
- Snapping system (point, midpoint, horizontal, vertical, angle, grid)
- 3D viewer widget using pygfx
- Component timeline with buttons
- Sketch and body list management
- Operations (extrude, cut, combine, revolve)
- Workplane tools (origin, face, flip, move)
- Export functionality (STEP, IGES, STL)
- Import STEP/IGES files
- Code tab for CadQuery scripting
2026-03-14 08:56:13 +01:00
bklronin 8c6a413137 fix: correct OCP API usage for mesh, bounding box, and volume
- Fix BRep_Tool.Triangulation_s to use TopoDS.Face_s for face casting
- Fix BRepBndLib.AddClose_s import and usage
- Fix BRepGProp.VolumeProperties_s and SurfaceProperties_s imports
- Fix _get_shape to handle Workplane objects stored in shape attribute
- Fix OCCSketchEntity to properly inherit from SketchEntity
- Update pyproject.toml dependency versions
2026-03-14 08:52:45 +01:00
bklronin fe23ca610c feat: Replace SDF kernel with OpenCASCADE, VTK with pygfx
Major architecture migration:

- Remove SDF-based geometry kernel (sdf/)
- Remove VTK renderer (drawing_modules/)
- Remove old mesh modules (mesh_modules/)

New components:
- geometry/base.py: Abstract geometry kernel interface
- geometry_occ/kernel.py: OpenCASCADE implementation via CadQuery/OCP
- geometry_occ/sketch.py: 2D sketching with constraint solving
- rendering/base.py: Abstract renderer interface
- rendering/pygfx_renderer.py: WebGPU-based renderer
- models/data_model.py: Project, Component, Sketch, Body classes
- main.py: New Qt-based application

Features:
- STEP/IGES import/export
- Exact BRep geometry (vs approximate SDF mesh)
- Parametric sketching with constraints
- Boolean operations (union, difference, intersection)
- Fillet and chamfer operations
- Modern pygfx renderer (~30MB vs VTK ~200MB)

Dependencies:
- cadquery >= 2.4
- ocp >= 7.9.3
- pygfx >= 0.7.0
- wgpu >= 0.19.0
- PySide6 >= 6.9.0
2026-03-14 08:45:07 +01:00