Improved libnest2d caching

This commit is contained in:
tamasmeszaros
2018-07-27 12:28:14 +02:00
parent c430f57187
commit 84f97e1f64
22 changed files with 1178 additions and 768 deletions

View File

@@ -682,7 +682,9 @@ void testNfp(const std::vector<ItemPair>& testdata) {
auto&& nfp = Nfp::noFitPolygon<lvl>(stationary.rawShape(),
orbiter.transformedShape());
auto v = ShapeLike::isValid(nfp);
strategies::correctNfpPosition(nfp, stationary, orbiter);
auto v = ShapeLike::isValid(nfp.first);
if(!v.first) {
std::cout << v.second << std::endl;
@@ -690,7 +692,7 @@ void testNfp(const std::vector<ItemPair>& testdata) {
ASSERT_TRUE(v.first);
Item infp(nfp);
Item infp(nfp.first);
int i = 0;
auto rorbiter = orbiter.transformedShape();
@@ -742,6 +744,15 @@ TEST(GeometryAlgorithms, nfpConvexConvex) {
// testNfp<NfpLevel::BOTH_CONCAVE, 1000>(nfp_concave_testdata);
//}
TEST(GeometryAlgorithms, nfpConcaveConcave) {
using namespace libnest2d;
// Rectangle r1(10, 10);
// Rectangle r2(20, 20);
// auto result = Nfp::nfpSimpleSimple(r1.transformedShape(),
// r2.transformedShape());
}
TEST(GeometryAlgorithms, pointOnPolygonContour) {
using namespace libnest2d;