Hi, teams.
I have used vtkobbtree::InsideOrOutside to detect the intersection of two polys.
Then I made a tree for poly_a, and detect if poly_b.point(i) is in poly_a.
Here is the problem,
If b is far away from a, (completely outside of a).
Its running time is almost 100 seconds (For 5000+ points in b, while a is a very complex mesh)
However, if b and a intersects, it will run very fast (almost 12 seconds).
I think here comes a big logical problem in this situation.
Internal and external detection for obb tree should check the outermost box in first. If it is outside, there will be an early stop method I think.
Therefore, the farther a and b are, the faster the program should run.
But why is the situation in my test completely opposite?
If b is completely inside a, all levels of node will be judged, is it right?
In addition, I hope someone can give me a suggestion to find out the intersection part of a and b smarter.
Thank you!
Best regards.
Here is the code
auto num = m_cup->GetNumberOfPoints();
auto nptr = static_cast<float*>(m_cup->GetPoints()->GetVoidPointer(0));
int a = 0;
for(int i = 0; i < num; i++){
a = m_tree->InsideOrOutside(ndata->GetPoint(i));
std::cout<<i<<"/ "<<num <<":" <<a <<std::endl;
}