mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-24 07:16:53 -06:00
Fixed missing last coordinate for filetered coords
p4#: 21955
This commit is contained in:
parent
16cd7a04ae
commit
2a2102837a
@ -547,20 +547,8 @@ void RivPipeGeometryGenerator::updateFilteredPipeCenterCoords()
|
||||
}
|
||||
}
|
||||
|
||||
// Add last cross section if not duplicate coordinate
|
||||
cvf::Vec3d coordA = m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 2);
|
||||
cvf::Vec3d coordB = m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 1);
|
||||
|
||||
cvf::Vec3d directionAB = coordB - coordA;
|
||||
if (directionAB.lengthSquared() > squareDistanceTolerance)
|
||||
{
|
||||
m_filteredPipeCenterCoords.push_back(m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove last segment as the length is below tolerance
|
||||
m_filteredPipeSegmentToResult.pop_back();
|
||||
}
|
||||
// Always append last coord as it is not added by above algorithm
|
||||
m_filteredPipeCenterCoords.push_back(m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 1));
|
||||
|
||||
CVF_ASSERT(m_filteredPipeCenterCoords.size() - 1 == m_filteredPipeSegmentToResult.size());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user