mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fixed Well pipe "peaks". The centerline filtering tolerance was too small.
p4#: 21580
This commit is contained in:
parent
eecd069b0a
commit
6784a8e596
@ -469,7 +469,7 @@ void RivPipeGeometryGenerator::updateFilteredPipeCenterCoords()
|
|||||||
if (m_filteredPipeCenterCoords.size() > 0) return;
|
if (m_filteredPipeCenterCoords.size() > 0) return;
|
||||||
|
|
||||||
|
|
||||||
double distanceTolerance = 1e-10;
|
double squareDistanceTolerance = 1e-4*1e-4;
|
||||||
double angleTolerance = 1e-5;
|
double angleTolerance = 1e-5;
|
||||||
|
|
||||||
size_t firstSegmentWithLength = 0;
|
size_t firstSegmentWithLength = 0;
|
||||||
@ -477,7 +477,8 @@ void RivPipeGeometryGenerator::updateFilteredPipeCenterCoords()
|
|||||||
for (i = 0; i < m_originalPipeCenterCoords->size() - 1; i++)
|
for (i = 0; i < m_originalPipeCenterCoords->size() - 1; i++)
|
||||||
{
|
{
|
||||||
cvf::Vec3d candidateDir = (*m_originalPipeCenterCoords)[i] - (*m_originalPipeCenterCoords)[i+1];
|
cvf::Vec3d candidateDir = (*m_originalPipeCenterCoords)[i] - (*m_originalPipeCenterCoords)[i+1];
|
||||||
if (candidateDir.normalize())
|
double dirLengthSq = candidateDir.lengthSquared();
|
||||||
|
if (dirLengthSq > squareDistanceTolerance && candidateDir.normalize())
|
||||||
{
|
{
|
||||||
firstSegmentWithLength = i;
|
firstSegmentWithLength = i;
|
||||||
break;
|
break;
|
||||||
@ -502,14 +503,15 @@ void RivPipeGeometryGenerator::updateFilteredPipeCenterCoords()
|
|||||||
cvf::Vec3d directionAB = coordB - coordA;
|
cvf::Vec3d directionAB = coordB - coordA;
|
||||||
|
|
||||||
// Skip segment lengths below tolerance
|
// Skip segment lengths below tolerance
|
||||||
if (directionAB.lengthSquared() > distanceTolerance)
|
double dirLengthSq = directionAB.lengthSquared();
|
||||||
|
if (directionAB.lengthSquared() > squareDistanceTolerance)
|
||||||
{
|
{
|
||||||
lastValidDirectionAB = directionAB.getNormalized();
|
lastValidDirectionAB = directionAB.getNormalized();
|
||||||
lastValidSegment = i;
|
lastValidSegment = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
cvf::Vec3d directionBC = coordC - coordB;
|
cvf::Vec3d directionBC = coordC - coordB;
|
||||||
if (directionBC.lengthSquared() < distanceTolerance)
|
if (directionBC.lengthSquared() < squareDistanceTolerance)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -550,7 +552,7 @@ void RivPipeGeometryGenerator::updateFilteredPipeCenterCoords()
|
|||||||
cvf::Vec3d coordB = m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 1);
|
cvf::Vec3d coordB = m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 1);
|
||||||
|
|
||||||
cvf::Vec3d directionAB = coordB - coordA;
|
cvf::Vec3d directionAB = coordB - coordA;
|
||||||
if (directionAB.lengthSquared() > distanceTolerance)
|
if (directionAB.lengthSquared() > squareDistanceTolerance)
|
||||||
{
|
{
|
||||||
m_filteredPipeCenterCoords.push_back(m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 1));
|
m_filteredPipeCenterCoords.push_back(m_originalPipeCenterCoords->get(m_originalPipeCenterCoords->size() - 1));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user