#3422 Handle straight well paths better

This commit is contained in:
Jacob Støren 2018-09-27 14:19:10 +02:00
parent 70a7b3ae5c
commit 71c36208c3
2 changed files with 8 additions and 2 deletions

View File

@ -35,9 +35,10 @@ RiaJCurveCalculator::RiaJCurveCalculator(cvf::Vec3d p1, double azi1, double inc1
cvf::Vec3d p1p2 = p2 - p1;
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.
m_curveStatus = OK_STRAIGHT_LINE;
@ -48,6 +49,8 @@ RiaJCurveCalculator::RiaJCurveCalculator(cvf::Vec3d p1, double azi1, double inc1
return;
}
tr1 /= tr1Length;
cvf::Vec3d c1 = p1 + r1 * tr1;
cvf::Vec3d p2c1 = c1 - p2;

View File

@ -395,6 +395,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
RimWellPathTarget* target1 = activeWellPathTargets[tIdx];
RimWellPathTarget* target2 = activeWellPathTargets[tIdx+1];
// Ignore targets in the same place
if ((target1->targetPointXYZ() - target2->targetPointXYZ()).length() < 1e-6) continue;
target1->flagRadius2AsIncorrect(false, 0);
target2->flagRadius1AsIncorrect(false, 0);