pre-proto - Deleting line segments shorter than tolerance used when connecting line segments to polygons.

This commit is contained in:
astridkbjorke
2017-02-03 10:21:14 +01:00
parent 7738b7f74b
commit 5630df5c1c
2 changed files with 44 additions and 2 deletions

View File

@@ -76,6 +76,36 @@ TEST(RigCellGeometryTools, createMultiplePolygonTest)
EXPECT_EQ(polygons.size(), 2);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(RigCellGeometryTools, createPolygonTestRealCase)
{
std::list<std::pair<cvf::Vec3d, cvf::Vec3d>> intersectionLineSegments;
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900632511830, 20.000000000000000, -0.011799300447865143), cvf::Vec3d(13.498900632515129, 20.000000000000000, -0.011874744050458887) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900633056895, 20.000000000000000, -0.024268930302180504), cvf::Vec3d(13.498900632515127, 20.000000000000000, -0.011874744050458887) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900632511830, 20.000000000000000, -0.011799300447865143), cvf::Vec3d(13.498900631970063, 20.000000000000000, 0.00059488709383226715) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900195597713, 10.000000000000000, -0.016369358494277231), cvf::Vec3d(13.498900195056242, 10.000000000000000, -0.0039819325234285293) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900195597711, 10.000000000000000, -0.016369358494277241), cvf::Vec3d(13.498900195600806, 10.000000000000000, -0.016440172032184591) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900196142280, 10.000000000000000, -0.028827609381707260), cvf::Vec3d(13.498900195600807, 10.000000000000000, -0.016440172032184591) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900196142280, 10.000000000000000, -0.028827609381707260), cvf::Vec3d(13.498900414562046, 14.999139949621291, -0.026549475935230070) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900414637365, 15.000863944878075, -0.026548599914369600), cvf::Vec3d(13.498900633056895, 20.000000000000000, -0.024268930302180504) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900414637365, 15.000863944878075, -0.026548599914369600), cvf::Vec3d(13.498900414562046, 14.999139949621291, -0.026549475935230073) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900413511738, 14.999966890459870, -0.0016942968682188385), cvf::Vec3d(13.498900413514638, 15.000033259475705, -0.0016942630763332898) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900631970063, 20.000000000000000, 0.00059488709383226715), cvf::Vec3d(13.498900413514637, 15.000033259475705, -0.0016942630763332901) });
intersectionLineSegments.push_back({ cvf::Vec3d(13.498900413511738, 14.999966890459870, -0.0016942968682188385), cvf::Vec3d(13.498900195056240, 10.000000000000000, -0.0039819325234285319) });
std::vector<std::vector<cvf::Vec3d>> polygons;
RigCellGeometryTools::createPolygonFromLineSegments(intersectionLineSegments, polygons);
EXPECT_EQ(polygons.size(), 1);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------