mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1737 Adding unit test re-creating problem with finding well-fracture-overlap for along-oriented fracture
This commit is contained in:
parent
a3ba1991db
commit
c222612ae0
@ -272,6 +272,45 @@ TEST(RigCellGeometryTools, polylinePolygonIntersectionTest)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
TEST(RigCellGeometryTools, polylinePolygonIntersectionTest2)
|
||||||
|
//Recreating bug...
|
||||||
|
{
|
||||||
|
std::vector<cvf::Vec3d> polygonExample;
|
||||||
|
|
||||||
|
polygonExample.push_back(cvf::Vec3d(1.00, 0.00, 0.0));
|
||||||
|
polygonExample.push_back(cvf::Vec3d(0.00, 1.00, 0.0));
|
||||||
|
polygonExample.push_back(cvf::Vec3d(-1.00, 0.00, 0.0));
|
||||||
|
polygonExample.push_back(cvf::Vec3d(0.00, -1.00, 0.0));
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<cvf::Vec3d> polyLine1;
|
||||||
|
polyLine1.push_back(cvf::Vec3d(2.0, 2.0, 0.0));
|
||||||
|
polyLine1.push_back(cvf::Vec3d(0.0, 0.0, 0.0));
|
||||||
|
polyLine1.push_back(cvf::Vec3d(-2.0, -2.0, 0.0));
|
||||||
|
|
||||||
|
std::vector< std::vector<cvf::Vec3d> > clippedLines1 = RigCellGeometryTools::clipPolylineByPolygon(polyLine1,
|
||||||
|
polygonExample,
|
||||||
|
RigCellGeometryTools::INTERPOLATE_LINE_Z);
|
||||||
|
|
||||||
|
EXPECT_EQ(1, clippedLines1.size());
|
||||||
|
EXPECT_EQ(0.0, clippedLines1.front()[0].z());
|
||||||
|
|
||||||
|
std::vector<cvf::Vec3d> polyLine2;
|
||||||
|
polyLine2.push_back(cvf::Vec3d(2.0, 0.0, 0.0));
|
||||||
|
polyLine2.push_back(cvf::Vec3d(0.0, 0.0, 0.0));
|
||||||
|
polyLine2.push_back(cvf::Vec3d(-2.0, 0.0, 0.0));
|
||||||
|
|
||||||
|
std::vector< std::vector<cvf::Vec3d> > clippedLines2 = RigCellGeometryTools::clipPolylineByPolygon(polyLine2,
|
||||||
|
polygonExample,
|
||||||
|
RigCellGeometryTools::INTERPOLATE_LINE_Z);
|
||||||
|
EXPECT_EQ(1, clippedLines2.size());
|
||||||
|
EXPECT_EQ(0.0, clippedLines2.front()[0].z());
|
||||||
|
//Since both the line and the polygon is in the z=0 plane, the expected clipped line should be in this plane
|
||||||
|
}
|
||||||
|
|
||||||
#include "RigWellPathStimplanIntersector.h"
|
#include "RigWellPathStimplanIntersector.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user