Skip to content

Commit

Permalink
-fix quadrant search for 2D. Need to make sure that the min z for the…
Browse files Browse the repository at this point in the history
… quadrant is -1.0 and the max z is 1.0.

-reverted other changes
  • Loading branch information
alemon-aquaveo committed May 17, 2023
1 parent 0824542 commit 848ded9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions xmsgrid/geometry/GmPtSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,7 @@ void GmPtSearchImpl::CreateOctants(const Pt3d& a_pt, std::vector<box>& a_boxes)
a_boxes.resize(0);
Pt3d bmin(m_min), bmax(m_max), pt(a_pt);
box bound(bmin, bmax);
if (!m_2dSearch)
bound.min_corner().z = pt.z;
bound.min_corner().z = pt.z;
// here are the quadrants that we create
// ---------
// | 1 | 2 |
Expand All @@ -609,23 +608,26 @@ void GmPtSearchImpl::CreateOctants(const Pt3d& a_pt, std::vector<box>& a_boxes)
// 2
aBox = bound;
aBox.min_corner() = pt;
if (m_2dSearch)
aBox.min_corner().z = -1;
a_boxes.push_back(aBox);
// 3
aBox = bound;
aBox.max_corner() = pt;
aBox.max_corner().z = m_max.z;
if (m_2dSearch)
aBox.max_corner().z = 1;
a_boxes.push_back(aBox);
// 4
aBox = bound;
aBox.min_corner().x = pt.x;
aBox.max_corner().y = pt.y;
a_boxes.push_back(aBox);
if (m_2dSearch)
{
for (auto& b : a_boxes)
{
b.min_corner().z = -1.0;
b.max_corner().z = 1.0;
}
return;
}
// do the lower octants if this is 3D
for (int i = 0; i < 4; ++i)
{
Expand Down

0 comments on commit 848ded9

Please sign in to comment.