foxtrot
foxtrot copied to clipboard
Modernize Codebase to Rust 2024 and Fix Critical CDT Issues
TLDR; This PR improves stability and maintainability of Foxtrot while bringing it up to current Rust ecosystem standards.
Rust 2024 Edition
- Updated entire workspace from Rust 2021 to Rust 2024 edition.
- Fixed all compilation warnings (220+ lifetime elision warnings, 43+ dead code warnings).
- Applied
rustfmtandclippyfixes across all crates. - Updated all dependencies to latest compatible versions.
GUI/Rendering
- Migrated to
wgpuv26 andwinitv0.30 APIs. - Replaced
winitevent loop withApplicationHandlertrait. - Updated WGSL shaders from
[[attributes]]to@attributessyntax. - Fixed
Surfacelifetime management withArc. - Handle empty meshes gracefully with early exit and clear error messages.
Bug Fixes
- Fixed panic in
cdttriangulation when processing complex models (e.g., Raspberry Pi 4 STEP file). - Replaced assertions with proper error handling using new
Error::HullMismatchvariant. - Added test cases for problematic
cdtinput that was causing crashes. - Fixed buffer panics when models have no vertices or triangles.
Detailed Changes
Express Parser Improvements
- Fixed
nom7 API compatibility (fold_many0/fold_many1now use closures). - Resolved lifetime issues in alias macro for proper
IResultusage. - Applied
clippyrecommendations (renamed methods, removed redundant closures).
Code Quality
- Renamed
parallelfeature torayonand enabled by default. - Renamed structs to comply with Rust API naming guidelines (RFC 430).
- Applied
cargo-sortfor consistent dependency ordering.
cdt Improvements
- Merged PR #14 adding test cases for problematic triangulation input.
- Fixed assertions that would panic on malformed hull structures.
- Errors are now properly propagated instead of causing crashes.
Testing
- All existing tests pass.
- New test cases added for problematic
cdtscenarios. - Successfully loads and displays complex STEP files that previously crashed.