Skip to content

feat: Multi-format MeshIO, performance optimizations, bug fixes, and CI test suite - #62

Open
Siddharth0089 wants to merge 1 commit into
huxingyi:masterfrom
Siddharth0089:feature/improvements
Open

Siddharth0089 wants to merge 1 commit into
huxingyi:masterfrom
Siddharth0089:feature/improvements

Conversation

@Siddharth0089

Copy link
Copy Markdown

Summary of Changes

This PR introduces stability fixes, performance optimizations, native multi-format mesh I/O, and CI automation:

1. Native Multi-Format Mesh I/O (MeshIO)

  • Adds lightweight, self-contained \MeshIO\ module supporting:
    • OBJ: Fast loading and export (using vendored tinyobjloader and native exporter).
    • STL: ASCII and binary reader/writer with automatic vertex welding via 3D spatial hashing (\PositionKey).
    • PLY: ASCII and binary (little-endian) reader and writer.
  • Updated GUI Open/Save dialogs and headless CLI to accept .obj, .stl, and .ply.

2. Performance Optimizations

  • Parallel Mesh Area: Parallelized \calculateMeshArea\ using \ bb::parallel_reduce\ for meshes with >= 1000 triangles, plus cached top-level mesh surface area.
  • O(1) Stage Timing: Replaced linear string scanning under \m_stageTimingMutex\ with an \std::unordered_map\ index table.
  • Adaptive Remesh Passes: Added configurable iterations (3 passes for >100k triangles, 4 for smaller meshes) in \IsotropicRemesher.
  • Progress Tracking: Eliminated linear scanning over all island threads on every progress tick.
  • Range Insert: Replaced manual element-by-element loops with range \insert\ during island vertex merging.

3. Correctness & Portability

  • Silenced Release Logging: Wrapped heavy \std::cerr\ spam in \quadextractor.cpp\ inside #if AUTO_REMESHER_DEBUG\ blocks to eliminate I/O flushing overhead in release builds.
  • Safe Island Connection Padding: Handled bounds padding cleanly during island connection merging in \�utoremesher.cpp\ to prevent truncation.
  • Intel oneAPI Compatibility: Guarded TBB headers with __has_include(<oneapi/tbb/...>)\ in \parameterizer.cpp, \quadparameterizer.cpp, and \ ramefield.cpp.
  • Cross-Version Qt Compatibility: Modernized whitespace splitting in \MeshIO\ using \simplified().split(' ')\ for compatibility across Qt 5 and Qt 6.

4. Features & UX

  • Hard Surface Mode: Implemented \ModelType::HardSurface\ logic (tightened 45 degree crease dihedral threshold, disabled normal smoothing), accessible in GUI sidebar and CLI (--model-type organic|hardsurface).
  • Live Cancellation: Added \std::atomic m_cancelled\ in \AutoRemesher\ and \QuadMeshGenerator, wired up to the UI button.
  • Undo / Redo Stack: 20-state history stack with standard \Ctrl+Z\ / \Ctrl+Y.
  • Statistics Dialog: Phase execution timings accessible via \Help -> Statistics.
  • Safe Widget Lifetimes: Replaced raw static widget pointers with safe \QPointer\ management in \mainwindow.cpp.

5. Tests & CI Automation

  • Unit Test Runner (tests/): Full test suite covering vector math, format detection, OBJ/STL/PLY roundtrips, and pipeline cancellation.
  • GitHub Actions (.github/workflows/development.yml): Automated Linux compilation, unit test execution, and smoke tests (both organic and hard surface modes).
  • Grouped directory formatting in \ci/lint.sh.

…t MeshIO, and CI test suite

- Correctness: Wrap quadextractor debug logs with AUTO_REMESHER_DEBUG, fix island merge padding, guard modern oneAPI TBB includes
- Performance: Parallelize calculateMeshArea with tbb::parallel_reduce, cache area, O(1) stage timing hash map, adaptive remesh passes, lazy progress tracking
- Features: Implement native MeshIO supporting OBJ, STL (ASCII/Binary with spatial hash welding), and PLY (ASCII/Binary)
- UI/UX: Add Hard Surface model type (45° crease threshold), live pipeline cancellation, 20-state Undo/Redo stack, and Remeshing Statistics dialog
- CLI: Add --model-type option to headless command line interface
- Testing & CI: Add unit test suite (tests/), tests.pro, and GitHub Actions CI workflow for automated builds, smoke tests, and linting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants