Skip to content
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

Mesh distance symmetric #2041

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

nawazishkhan1-nk
Copy link
Contributor

@nawazishkhan1-nk nawazishkhan1-nk commented Apr 5, 2023

[WIP] - Do Not Merge

Summary

This PR addresses issue #2040.

Changes Made

  • Non-breaking change: Added a new distance method in Mesh class to compute symmetric point-to-cell distances.
  • Included this method in the ShapeWorks Python API.
  • Temporarily called it in ShapeWorks Studio Viewer when surface-to-surface distance is checked.

Testing Done

  • Tested the new distance method using different meshes.
  • Checked that the ShapeWorks Studio Viewer and API calls run without errors.

Known Issues

  • None at this time.

Screenshots

Symmetric Point-to-cell distance vs. regular Point-to-cell distance
Screen Shot 2023-04-05 at 8 28 20 AM

Copy link
Contributor

@akenmorris akenmorris left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple minor things.

auto field = m.distance(m2)[0];
auto field = m.distance(m2, Mesh::DistanceMethod::SymmetricPointToCell)[0];
// TODO: disable debug
std::cout << "Debug Mode | Computing distance with SymmetricPointToCell method in Studio Viewer " << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

K, let's remove this debug line and I think it's good to go.

referenceMesh (point) -> targetMesh (cell) (and get closestPoint)
referenceMesh (cell) -> targetMesh (closestPoint)
*/
auto targetCellLocator = vtkSmartPointer<vtkCellLocator>::New();
Copy link
Contributor

Choose a reason for hiding this comment

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

use the faster vtkStaticCellLocator

targetCellLocator->SetDataSet(target.poly_data_);
targetCellLocator->BuildLocator();

auto refCellLocator = vtkSmartPointer<vtkCellLocator>::New();
Copy link
Contributor

Choose a reason for hiding this comment

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

vtkStaticCellLocator as above

@ben2k
Copy link
Contributor

ben2k commented Apr 26, 2023

Hello, I propose also to add the signed point-to-cell metric, I will amend the commit

@@ -556,6 +556,42 @@ std::vector<Field> Mesh::distance(const Mesh& target, const DistanceMethod metho
}
} break;

case SymmetricPointToCell: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing a unit test for that case ?

@akenmorris
Copy link
Contributor

@nawazishkhan1-nk , do you have an update on the PR?

@akenmorris
Copy link
Contributor

@nawazishkhan1-nk , any update on this?

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.

None yet

3 participants