Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 737
    • Issues 737
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 209
    • Merge requests 209
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #17911

Closed
Open
Created May 27, 2020 by Angelos Angelopoulos@aangelos28Contributor

VTK 9.0.0: vtkStaticCellLocator::FindClosestPoint, Invalid Closest Point

Hello,

I noticed that the function FindClosestPoint in vtkStaticCellLocator does not yield the closest point as intended. I compared this to the functionality of the equivalent function in vtkCellLocator, which works properly.

FindClosestPoint in vtkStaticCellLocator is much faster than FindClosestPoint in vtkCellLocator. I believe one of the reasons for this, is this discrepancy. Basically, FindClosestPoint in vtkStaticCellLocator looks like a hack that calls FindClosestPointWithinRadius with an infinite radius. However, FindClosestPointWithinRadius does not look like it works properly when searching the entire octree.

Curiously enough, if the lines (985-988) in FindClosestPointWithinRadius, vtkStaticCellLocator are commented out, then FindClosestPoint works properly but is much slower than the version in vtkCellLocator. These are the lines:

// stop if bounding box is further away than current closest point
if (binDist2 > minDist2)
{
   break;
}

I have attached a screenshot showing a comparison of the results of the two locators. Vertices are given a color depending on how far away they are from the closest point on a bounding mesh. The further away they are, they more blue they are, and the less further away they are, the more red they are. As you can see, in the case of vtkStaticCellLocator, there is a weird straight line with a very rough change in distances, which is not present in the output of vtkCellLocator, which finds the correct closest points and results in a much better output. There are also many other issues in other parts of the mesh. The two locators are used in the exact same way.

comparison

Edited May 27, 2020 by Angelos Angelopoulos
Assignee
Assign to
Time tracking