Skip to content

[Core] Refactor QEF Utility (QuadraticErrorFunction ). Replace eigenvalue computation with SVD #13214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 21, 2025

Conversation

loumalouomega
Copy link
Member

📝 Description

Summary

This PR involves modifications across three files: test_qef_utility.cpp, qef_utility.cpp, and qef_utility.h. The changes primarily focus on:

  1. Code Refactoring:

    • Reorganization of helper functions and data structures within the QEF utility.
    • Replaced eigenvalue computations with Singular Value Decomposition (SVD).
    • Changes to improve consistency and readability in the handling of points, distances, and matrices in the QEF computations.
    • Modifications to matrix operations and intersection logic, particularly in terms of how the bounding box and edge endpoints are calculated.
  2. New Methods Added:

    • Refactor methods like FirstEnd and SecondEnd for computing the endpoints of edges within a bounding box.
    • Additional helper methods for handling geometry intersections and normal vectors.
  3. Clean up test

TODO

  • Current implementation uses the intersection with edges, this could be simplified

🆕 Changelog

@loumalouomega loumalouomega added Enhancement Cleanup Kratos Core Refactor When code is moved or rewrote keeping the same behavior labels Mar 11, 2025
@loumalouomega loumalouomega requested a review from a team as a code owner March 11, 2025 10:30
@loumalouomega loumalouomega enabled auto-merge March 11, 2025 10:30
@RiccardoRossi
Copy link
Member

@AriadnaCortesDanes can you review this?

@RiccardoRossi
Copy link
Member

my only comment, without really understanding the code, is that SVD is more expensive than standard eigenvalue calculation for square matrices

@loumalouomega
Copy link
Member Author

my only comment, without really understanding the code, is that SVD is more expensive than standard eigenvalue calculation for square matrices

It is more expensive, but it is the proper thing to do. In fact the rare thing was it was working until now. @pooyan-dadvand agrees this change.

Copy link
Contributor

@AriadnaCortesDanes AriadnaCortesDanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor looks good to me :)

@loumalouomega loumalouomega merged commit a083ed5 into master Jun 21, 2025
11 checks passed
@loumalouomega loumalouomega deleted the core/refactor-qef-utility-svd branch June 21, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Enhancement Kratos Core Refactor When code is moved or rewrote keeping the same behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants