mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Thermal Fracture: fix occasional glitch in fracture orientation.
The normal has to always point downwards, and this was not the case.
This commit is contained in:
@@ -529,7 +529,11 @@ std::vector<cvf::Vec3d>
|
||||
// Find the rotation that aligns the data so that depth (z coord) is the most similar.
|
||||
auto [e1, e2] = findPointsWithMostSimilarDepth( relativePos, depths );
|
||||
cvf::Vec3d direction = e1 - e2;
|
||||
auto rotMat2 = rotationMatrixBetweenVectors( direction.getNormalized(), cvf::Vec3d::X_AXIS );
|
||||
cvf::Vec3d directionNormal = direction.getNormalized();
|
||||
// Make sure normal is pointing down
|
||||
if ( directionNormal.y() > 0.0 ) directionNormal *= -1.0;
|
||||
|
||||
auto rotMat2 = rotationMatrixBetweenVectors( directionNormal, cvf::Vec3d::X_AXIS );
|
||||
for ( auto& r : relativePos )
|
||||
{
|
||||
r.transformVector( rotMat2 );
|
||||
|
||||
Reference in New Issue
Block a user