#2847 Add a fall back dominant direction (0, -1, 0) if the path does not extrude in z-direction.

* This direction means Left will cause it to go -x and Right +x so that the directions are correct with respect to "Left" and "Right" when you look "North".
This commit is contained in:
Gaute Lindkvist 2018-05-02 14:51:53 +02:00
parent f6cbf0f34f
commit a165172723

View File

@ -139,5 +139,11 @@ cvf::Vec3d RigWellPathGeometryTools::estimateDominantDirectionInXYPlane(const st
}
directionSum += vec;
}
if (directionSum.length() < 1.0e-8)
{
directionSum = cvf::Vec3d(0, -1, 0);
}
return directionSum.getNormalized();
}