mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3422 Handle straight well paths better
This commit is contained in:
parent
70a7b3ae5c
commit
71c36208c3
@ -35,9 +35,10 @@ RiaJCurveCalculator::RiaJCurveCalculator(cvf::Vec3d p1, double azi1, double inc1
|
|||||||
|
|
||||||
cvf::Vec3d p1p2 = p2 - p1;
|
cvf::Vec3d p1p2 = p2 - p1;
|
||||||
bool isOk = true;
|
bool isOk = true;
|
||||||
cvf::Vec3d tr1 = (p1p2 - (p1p2.dot(t1)) * t1).getNormalized(&isOk);
|
|
||||||
|
|
||||||
if (!isOk)
|
cvf::Vec3d tr1 = p1p2 - (p1p2.dot(t1)) * t1;
|
||||||
|
double tr1Length = tr1.length();
|
||||||
|
if (tr1Length < 1e-9)
|
||||||
{
|
{
|
||||||
// p2 is on the p1 + t12 line. Degenerates to a line.
|
// p2 is on the p1 + t12 line. Degenerates to a line.
|
||||||
m_curveStatus = OK_STRAIGHT_LINE;
|
m_curveStatus = OK_STRAIGHT_LINE;
|
||||||
@ -48,6 +49,8 @@ RiaJCurveCalculator::RiaJCurveCalculator(cvf::Vec3d p1, double azi1, double inc1
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tr1 /= tr1Length;
|
||||||
|
|
||||||
cvf::Vec3d c1 = p1 + r1 * tr1;
|
cvf::Vec3d c1 = p1 + r1 * tr1;
|
||||||
cvf::Vec3d p2c1 = c1 - p2;
|
cvf::Vec3d p2c1 = c1 - p2;
|
||||||
|
|
||||||
|
@ -395,6 +395,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
RimWellPathTarget* target1 = activeWellPathTargets[tIdx];
|
RimWellPathTarget* target1 = activeWellPathTargets[tIdx];
|
||||||
RimWellPathTarget* target2 = activeWellPathTargets[tIdx+1];
|
RimWellPathTarget* target2 = activeWellPathTargets[tIdx+1];
|
||||||
|
|
||||||
|
// Ignore targets in the same place
|
||||||
|
if ((target1->targetPointXYZ() - target2->targetPointXYZ()).length() < 1e-6) continue;
|
||||||
|
|
||||||
target1->flagRadius2AsIncorrect(false, 0);
|
target1->flagRadius2AsIncorrect(false, 0);
|
||||||
target2->flagRadius1AsIncorrect(false, 0);
|
target2->flagRadius1AsIncorrect(false, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user