From 59562aec295b6636755f2f181d6a3e6d114e45fd Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 8 Mar 2021 13:07:34 +0100 Subject: [PATCH] #7470 Well Path Tools : Use a positive value of each component to represent length --- .../ReservoirDataModel/RigWellPathIntersectionTools.cpp | 4 +++- .../ReservoirDataModel/RigWellPathIntersectionTools.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.cpp index cccebb9960..0eb8592453 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.cpp @@ -131,7 +131,9 @@ cvf::Vec3d RigWellPathIntersectionTools::calculateLengthInCell( const std::array jAxisDirection.z(), kAxisDirection.z() ); - return vec.getTransformedVector( localCellCoordinateSystem.getInverted() ); + auto signedVector = vec.getTransformedVector( localCellCoordinateSystem.getInverted() ); + + return { std::fabs( signedVector.x() ), std::fabs( signedVector.y() ), std::fabs( signedVector.z() ) }; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.h b/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.h index a20165e896..2f8b37fa9f 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.h +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathIntersectionTools.h @@ -59,6 +59,8 @@ public: const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ); + // Returns the length along each axis in local cell coordinate system + // The returned vector has unsigned component values static cvf::Vec3d calculateLengthInCell( const RigMainGrid* grid, size_t cellIndex, const cvf::Vec3d& startPoint,