mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1602 Consolidate some intersection functionality to common tools class
This commit is contained in:
@@ -104,37 +104,6 @@ TEST(RigCellGeometryTools, createPolygonTestRealCase)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RigCellGeometryTools, planeHexCellIntersectionTest)
|
||||
{
|
||||
cvf::Vec3d hexCorners[8];
|
||||
hexCorners[0] = cvf::Vec3d(0, 0, 0);
|
||||
hexCorners[1] = cvf::Vec3d(1, 0, 0);
|
||||
hexCorners[2] = cvf::Vec3d(0, 1, 0);
|
||||
hexCorners[3] = cvf::Vec3d(0, 0, 1);
|
||||
hexCorners[4] = cvf::Vec3d(0, 1, 1);
|
||||
hexCorners[5] = cvf::Vec3d(1, 1, 0);
|
||||
hexCorners[6] = cvf::Vec3d(1, 0, 1);
|
||||
hexCorners[7] = cvf::Vec3d(1, 1, 1);
|
||||
|
||||
std::list<std::pair<cvf::Vec3d, cvf::Vec3d > > intersectionLineSegments;
|
||||
bool isCellIntersected = false;
|
||||
cvf::Plane fracturePlane;
|
||||
|
||||
fracturePlane.setFromPointAndNormal(cvf::Vec3d(0.5, 0.5, 0.5), cvf::Vec3d(1, 0, 0) );
|
||||
isCellIntersected = RigCellGeometryTools::planeHexCellIntersection(hexCorners, fracturePlane, intersectionLineSegments);
|
||||
EXPECT_TRUE(isCellIntersected);
|
||||
|
||||
fracturePlane.setFromPointAndNormal(cvf::Vec3d(1.5, 1.5, 1.5), cvf::Vec3d(1, 0, 0));
|
||||
isCellIntersected = RigCellGeometryTools::planeHexCellIntersection(hexCorners, fracturePlane, intersectionLineSegments);
|
||||
EXPECT_FALSE(isCellIntersected);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user