From b1eaec985133c9d4d17452e128218f142cec94fb Mon Sep 17 00:00:00 2001 From: Vladimir Elistratov Date: Mon, 4 Jan 2021 18:00:31 +0300 Subject: [PATCH] tests cleanup --- .../336079890_kropivnitsky_yaroshenka_1.py | 223 ------------------ .../test_530431938_denver_basilica.py | 99 -------- .../336079890_kropivnitsky_yaroshenka_1.osm | 0 .../530431938_denver_basilica.osm | 0 4 files changed, 322 deletions(-) delete mode 100644 debug/edge_crossing/336079890_kropivnitsky_yaroshenka_1.py delete mode 100644 debug/edge_crossing/test_530431938_denver_basilica.py rename misc/testing/osm/{debug => tests}/336079890_kropivnitsky_yaroshenka_1.osm (100%) rename misc/testing/osm/{debug => tests}/530431938_denver_basilica.osm (100%) diff --git a/debug/edge_crossing/336079890_kropivnitsky_yaroshenka_1.py b/debug/edge_crossing/336079890_kropivnitsky_yaroshenka_1.py deleted file mode 100644 index 1211347..0000000 --- a/debug/edge_crossing/336079890_kropivnitsky_yaroshenka_1.py +++ /dev/null @@ -1,223 +0,0 @@ -import pytest -from mathutils import Vector -from bpypolyskel import bpypolyskel - - -verts = [ - Vector((25.736616134643555, -0.12239281088113785, 0.0)), - Vector((25.766111373901367, 5.86659574508667, 0.0)), - Vector((26.039196014404297, 6.100368022918701, 0.0)), - Vector((26.511560440063477, 6.623571872711182, 0.0)), - Vector((26.90273666381836, 7.20243501663208, 0.0)), - Vector((27.220104217529297, 7.8258256912231445, 0.0)), - Vector((27.43414306640625, 8.493743896484375, 0.0)), - Vector((27.566991806030273, 9.18392562866211, 0.0)), - Vector((27.596511840820312, 9.885238647460938, 0.0)), - Vector((27.530080795288086, 10.58655071258545, 0.0)), - Vector((27.360321044921875, 11.26559829711914, 0.0)), - Vector((27.109375, 11.922382354736328, 0.0)), - Vector((26.76247787475586, 12.534638404846191, 0.0)), - Vector((26.341773986816406, 13.091233253479004, 0.0)), - Vector((25.83988380432129, 13.581036567687988, 0.0)), - Vector((25.212520599365234, 14.048576354980469, 0.0)), - Vector((24.526111602783203, 14.40479564666748, 0.0)), - Vector((23.788040161132812, 14.660826683044434, 0.0)), - Vector((23.020444869995117, 14.79440689086914, 0.0)), - Vector((22.24547004699707, 14.805536270141602, 0.0)), - Vector((21.470495223999023, 14.705345153808594, 0.0)), - Vector((20.72504425048828, 14.482704162597656, 0.0)), - Vector((20.02387809753418, 14.14874267578125, 0.0)), - Vector((19.381757736206055, 13.714594841003418, 0.0)), - Vector((18.806062698364258, 13.180258750915527, 0.0)), - Vector((18.326318740844727, 12.567999839782715, 0.0)), - Vector((17.942523956298828, 11.88895034790039, 0.0)), - Vector((17.6694393157959, 11.165372848510742, 0.0)), - Vector((17.514446258544922, 10.39726734161377, 0.0)), - Vector((17.492305755615234, 10.174628257751465, 0.0)), - Vector((15.706171035766602, 10.185754776000977, 0.0)), - Vector((15.728302955627441, 13.770242691040039, 0.0)), - Vector((10.148482322692871, 13.79249382019043, 0.0)), - Vector((10.126346588134766, 10.174610137939453, 0.0)), - Vector((8.354974746704102, 10.185739517211914, 0.0)), - Vector((8.347593307495117, 10.363850593566895, 0.0)), - Vector((8.19997787475586, 11.10969066619873, 0.0)), - Vector((7.941651821136475, 11.833267211914062, 0.0)), - Vector((7.579995632171631, 12.51231575012207, 0.0)), - Vector((7.115009784698486, 13.12457275390625, 0.0)), - Vector((6.568836212158203, 13.658905029296875, 0.0)), - Vector((5.941474914550781, 14.104182243347168, 0.0)), - Vector((5.255068302154541, 14.449272155761719, 0.0)), - Vector((4.5317583084106445, 14.694174766540527, 0.0)), - Vector((3.7715444564819336, 14.816625595092773, 0.0)), - Vector((3.003950357437134, 14.827756881713867, 0.0)), - Vector((2.243736982345581, 14.727568626403809, 0.0)), - Vector((1.5130462646484375, 14.504929542541504, 0.0)), - Vector((0.8192592859268188, 14.182103157043457, 0.0)), - Vector((0.17713715136051178, 13.747957229614258, 0.0)), - Vector((-0.3468936085700989, 13.269283294677734, 0.0)), - Vector((-0.7971173524856567, 12.723817825317383, 0.0)), - Vector((-1.1661533117294312, 12.122693061828613, 0.0)), - Vector((-1.4540014266967773, 11.46590805053711, 0.0)), - Vector((-1.638519525527954, 10.786858558654785, 0.0)), - Vector((-1.7344690561294556, 10.085546493530273, 0.0)), - Vector((-1.7270885705947876, 9.373101234436035, 0.0)), - Vector((-1.6237586736679077, 8.671788215637207, 0.0)), - Vector((-1.4170986413955688, 7.992739677429199, 0.0)), - Vector((-1.1218699216842651, 7.347086429595947, 0.0)), - Vector((-0.738072395324707, 6.7570929527282715, 0.0)), - Vector((-0.273086816072464, 6.21162748336792, 0.0)), - Vector((0.02952289953827858, 5.944460868835449, 0.0)), - Vector((0.0, 0.0, 0.0)), - Vector((25.736616134643555, -0.12239281088113785, 8.647566795349121)), - Vector((25.766111373901367, 5.86659574508667, 8.647566795349121)), - Vector((26.039196014404297, 6.100368022918701, 8.647566795349121)), - Vector((26.511560440063477, 6.623571872711182, 8.647566795349121)), - Vector((26.90273666381836, 7.20243501663208, 8.647566795349121)), - Vector((27.220104217529297, 7.8258256912231445, 8.647566795349121)), - Vector((27.43414306640625, 8.493743896484375, 8.647566795349121)), - Vector((27.566991806030273, 9.18392562866211, 8.647566795349121)), - Vector((27.596511840820312, 9.885238647460938, 8.647566795349121)), - Vector((27.530080795288086, 10.58655071258545, 8.647566795349121)), - Vector((27.360321044921875, 11.26559829711914, 8.647566795349121)), - Vector((27.109375, 11.922382354736328, 8.647566795349121)), - Vector((26.76247787475586, 12.534638404846191, 8.647566795349121)), - Vector((26.341773986816406, 13.091233253479004, 8.647566795349121)), - Vector((25.83988380432129, 13.581036567687988, 8.647566795349121)), - Vector((25.212520599365234, 14.048576354980469, 8.647566795349121)), - Vector((24.526111602783203, 14.40479564666748, 8.647566795349121)), - Vector((23.788040161132812, 14.660826683044434, 8.647566795349121)), - Vector((23.020444869995117, 14.79440689086914, 8.647566795349121)), - Vector((22.24547004699707, 14.805536270141602, 8.647566795349121)), - Vector((21.470495223999023, 14.705345153808594, 8.647566795349121)), - Vector((20.72504425048828, 14.482704162597656, 8.647566795349121)), - Vector((20.02387809753418, 14.14874267578125, 8.647566795349121)), - Vector((19.381757736206055, 13.714594841003418, 8.647566795349121)), - Vector((18.806062698364258, 13.180258750915527, 8.647566795349121)), - Vector((18.326318740844727, 12.567999839782715, 8.647566795349121)), - Vector((17.942523956298828, 11.88895034790039, 8.647566795349121)), - Vector((17.6694393157959, 11.165372848510742, 8.647566795349121)), - Vector((17.514446258544922, 10.39726734161377, 8.647566795349121)), - Vector((17.492305755615234, 10.174628257751465, 8.647566795349121)), - Vector((15.706171035766602, 10.185754776000977, 8.647566795349121)), - Vector((15.728302955627441, 13.770242691040039, 8.647566795349121)), - Vector((10.148482322692871, 13.79249382019043, 8.647566795349121)), - Vector((10.126346588134766, 10.174610137939453, 8.647566795349121)), - Vector((8.354974746704102, 10.185739517211914, 8.647566795349121)), - Vector((8.347593307495117, 10.363850593566895, 8.647566795349121)), - Vector((8.19997787475586, 11.10969066619873, 8.647566795349121)), - Vector((7.941651821136475, 11.833267211914062, 8.647566795349121)), - Vector((7.579995632171631, 12.51231575012207, 8.647566795349121)), - Vector((7.115009784698486, 13.12457275390625, 8.647566795349121)), - Vector((6.568836212158203, 13.658905029296875, 8.647566795349121)), - Vector((5.941474914550781, 14.104182243347168, 8.647566795349121)), - Vector((5.255068302154541, 14.449272155761719, 8.647566795349121)), - Vector((4.5317583084106445, 14.694174766540527, 8.647566795349121)), - Vector((3.7715444564819336, 14.816625595092773, 8.647566795349121)), - Vector((3.003950357437134, 14.827756881713867, 8.647566795349121)), - Vector((2.243736982345581, 14.727568626403809, 8.647566795349121)), - Vector((1.5130462646484375, 14.504929542541504, 8.647566795349121)), - Vector((0.8192592859268188, 14.182103157043457, 8.647566795349121)), - Vector((0.17713715136051178, 13.747957229614258, 8.647566795349121)), - Vector((-0.3468936085700989, 13.269283294677734, 8.647566795349121)), - Vector((-0.7971173524856567, 12.723817825317383, 8.647566795349121)), - Vector((-1.1661533117294312, 12.122693061828613, 8.647566795349121)), - Vector((-1.4540014266967773, 11.46590805053711, 8.647566795349121)), - Vector((-1.638519525527954, 10.786858558654785, 8.647566795349121)), - Vector((-1.7344690561294556, 10.085546493530273, 8.647566795349121)), - Vector((-1.7270885705947876, 9.373101234436035, 8.647566795349121)), - Vector((-1.6237586736679077, 8.671788215637207, 8.647566795349121)), - Vector((-1.4170986413955688, 7.992739677429199, 8.647566795349121)), - Vector((-1.1218699216842651, 7.347086429595947, 8.647566795349121)), - Vector((-0.738072395324707, 6.7570929527282715, 8.647566795349121)), - Vector((-0.273086816072464, 6.21162748336792, 8.647566795349121)), - Vector((0.02952289953827858, 5.944460868835449, 8.647566795349121)), - Vector((0.0, 0.0, 8.647566795349121)) -] -unitVectors = [ - Vector((0.004924852401018143, 0.9999879002571106, 0.0)), - Vector((0.7596691250801086, 0.650309681892395, 0.0)), - Vector((0.6701246500015259, 0.74224853515625, 0.0)), - Vector((0.5599089860916138, 0.8285541534423828, 0.0)), - Vector((0.45368874073028564, 0.8911601901054382, 0.0)), - Vector((0.3051702082157135, 0.9522978663444519, 0.0)), - Vector((0.18901407718658447, 0.9819744229316711, 0.0)), - Vector((0.04205528274178505, 0.9991152882575989, 0.0)), - Vector((-0.09430181980133057, 0.9955436587333679, 0.0)), - Vector((-0.24253275990486145, 0.9701432585716248, 0.0)), - Vector((-0.35691747069358826, 0.934135913848877, 0.0)), - Vector((-0.49296095967292786, 0.870051383972168, 0.0)), - Vector((-0.6029841303825378, 0.7977532148361206, 0.0)), - Vector((-0.7156718969345093, 0.6984365582466125, 0.0)), - Vector((-0.8018260598182678, 0.5975574851036072, 0.0)), - Vector((-0.8875941038131714, 0.4606264531612396, 0.0)), - Vector((-0.944770336151123, 0.32773321866989136, 0.0)), - Vector((-0.9851932525634766, 0.1714475303888321, 0.0)), - Vector((-0.9998968839645386, 0.01435947511345148, 0.0)), - Vector((-0.991746187210083, -0.1282159835100174, 0.0)), - Vector((-0.9581772685050964, -0.2861751616001129, 0.0)), - Vector((-0.9028241634368896, -0.430010050535202, 0.0)), - Vector((-0.8284197449684143, -0.5601078271865845, 0.0)), - Vector((-0.7329444885253906, -0.6802884340286255, 0.0)), - Vector((-0.6167744398117065, -0.7871399521827698, 0.0)), - Vector((-0.4920419156551361, -0.8705715537071228, 0.0)), - Vector((-0.353098601102829, -0.935586154460907, 0.0)), - Vector((-0.19779936969280243, -0.9802425503730774, 0.0)), - Vector((-0.0989576056599617, -0.9950916767120361, 0.0)), - Vector((-0.9999805688858032, 0.006229262333363295, 0.0)), - Vector((0.006174242589622736, 0.9999809265136719, 0.0)), - Vector((-0.9999920129776001, 0.003987753763794899, 0.0)), - Vector((-0.006118306424468756, -0.9999813437461853, 0.0)), - Vector((-0.9999803304672241, 0.006282791495323181, 0.0)), - Vector((-0.041407354176044464, 0.9991423487663269, 0.0)), - Vector((-0.19415223598480225, 0.9809714555740356, 0.0)), - Vector((-0.3362277150154114, 0.9417806267738342, 0.0)), - Vector((-0.47007909417152405, 0.8826242685317993, 0.0)), - Vector((-0.6048115491867065, 0.7963685393333435, 0.0)), - Vector((-0.7148129940032959, 0.6993155479431152, 0.0)), - Vector((-0.8154746294021606, 0.5787928700447083, 0.0)), - Vector((-0.8934428095817566, 0.4491770565509796, 0.0)), - Vector((-0.9471802115440369, 0.32070192694664, 0.0)), - Vector((-0.9872746467590332, 0.1590244621038437, 0.0)), - Vector((-0.999894917011261, 0.014500003308057785, 0.0)), - Vector((-0.9914273023605347, -0.13065984845161438, 0.0)), - Vector((-0.9565808773040771, -0.2914670705795288, 0.0)), - Vector((-0.9066537022590637, -0.421875536441803, 0.0)), - Vector((-0.8284215927124023, -0.5601050853729248, 0.0)), - Vector((-0.7383373975753784, -0.674431562423706, 0.0)), - Vector((-0.6365635991096497, -0.7712242007255554, 0.0)), - Vector((-0.5231850743293762, -0.8522191047668457, 0.0)), - Vector((-0.40140944719314575, -0.9158986806869507, 0.0)), - Vector((-0.2622215449810028, -0.9650077819824219, 0.0)), - Vector((-0.1355515569448471, -0.9907702803611755, 0.0)), - Vector((0.010358816012740135, -0.9999463558197021, 0.0)), - Vector((0.14576411247253418, -0.9893193244934082, 0.0)), - Vector((0.2911527156829834, -0.9566766023635864, 0.0)), - Vector((0.41584473848342896, -0.9094355702400208, 0.0)), - Vector((0.5452896952629089, -0.8382476568222046, 0.0)), - Vector((0.6487330198287964, -0.7610160112380981, 0.0)), - Vector((0.7496436238288879, -0.6618417501449585, 0.0)), - Vector((-0.004966394044458866, -0.9999876618385315, 0.0)), - Vector((0.9999886751174927, -0.004755537025630474, 0.0)) -] -holesInfo = None -firstVertIndex = 64 -numPolygonVerts = 64 - -bpypolyskel.debugOutputs["skeleton"] = 1 - - -faces = bpypolyskel.polygonize(verts, firstVertIndex, numPolygonVerts, holesInfo, 0.0, 0.5, None, unitVectors) - - -# the number of vertices in a face -for face in faces: - assert len(face) >= 3 - - -# duplications of vertex indices -for face in faces: - assert len(face) == len(set(face)) - - -# edge crossing -assert not bpypolyskel.checkEdgeCrossing(bpypolyskel.debugOutputs["skeleton"]) \ No newline at end of file diff --git a/debug/edge_crossing/test_530431938_denver_basilica.py b/debug/edge_crossing/test_530431938_denver_basilica.py deleted file mode 100644 index 6e8d65d..0000000 --- a/debug/edge_crossing/test_530431938_denver_basilica.py +++ /dev/null @@ -1,99 +0,0 @@ -import pytest -from mathutils import Vector -from bpypolyskel import bpypolyskel - - -verts = [ - Vector((0.0, 0.0, 0.0)), - Vector((-1.07854425907135, -0.45640984177589417, 0.0)), - Vector((-2.054370164871216, -1.090930700302124, 0.0)), - Vector((-3.19283390045166, -2.204125165939331, 0.0)), - Vector((-4.057382106781006, -3.551090717315674, 0.0)), - Vector((-4.562416076660156, -4.942584037780762, 0.0)), - Vector((-4.750734329223633, -6.412001132965088, 0.0)), - Vector((-4.921944618225098, -26.182342529296875, 0.0)), - Vector((9.10773754119873, -26.249130249023438, 0.0)), - Vector((9.22755241394043, -6.400865077972412, 0.0)), - Vector((9.090592384338379, -5.031635761260986, 0.0)), - Vector((8.722516059875488, -3.9184410572052, 0.0)), - Vector((8.183242797851562, -2.8831703662872314, 0.0)), - Vector((7.472772121429443, -1.9592194557189941, 0.0)), - Vector((6.6253437995910645, -1.1577198505401611, 0.0)), - Vector((5.658077239990234, -0.5120675563812256, 0.0)), - Vector((4.588092803955078, -0.033394474536180496, 0.0)), - Vector((3.458189010620117, 0.2671675682067871, 0.0)), - Vector((2.29404616355896, 0.37848660349845886, 0.0)), - Vector((1.1299033164978027, 0.28943076729774475, 0.0)), - Vector((0.0, 0.0, 16.0)), - Vector((-1.07854425907135, -0.45640984177589417, 16.0)), - Vector((-2.054370164871216, -1.090930700302124, 16.0)), - Vector((-3.19283390045166, -2.204125165939331, 16.0)), - Vector((-4.057382106781006, -3.551090717315674, 16.0)), - Vector((-4.562416076660156, -4.942584037780762, 16.0)), - Vector((-4.750734329223633, -6.412001132965088, 16.0)), - Vector((-4.921944618225098, -26.182342529296875, 16.0)), - Vector((9.10773754119873, -26.249130249023438, 16.0)), - Vector((9.22755241394043, -6.400865077972412, 16.0)), - Vector((9.090592384338379, -5.031635761260986, 16.0)), - Vector((8.722516059875488, -3.9184410572052, 16.0)), - Vector((8.183242797851562, -2.8831703662872314, 16.0)), - Vector((7.472772121429443, -1.9592194557189941, 16.0)), - Vector((6.6253437995910645, -1.1577198505401611, 16.0)), - Vector((5.658077239990234, -0.5120675563812256, 16.0)), - Vector((4.588092803955078, -0.033394474536180496, 16.0)), - Vector((3.458189010620117, 0.2671675682067871, 16.0)), - Vector((2.29404616355896, 0.37848660349845886, 16.0)), - Vector((1.1299033164978027, 0.28943076729774475, 16.0)) -] -unitVectors = [ - Vector((-0.9209358096122742, -0.3897143304347992, 0.0)), - Vector((-0.8383516669273376, -0.545129656791687, 0.0)), - Vector((-0.7149973511695862, -0.6991272568702698, 0.0)), - Vector((-0.5401570200920105, -0.8415642976760864, 0.0)), - Vector((-0.341168075799942, -0.9400023221969604, 0.0)), - Vector((-0.1271187961101532, -0.9918875694274902, 0.0)), - Vector((-0.00865963101387024, -0.9999625086784363, 0.0)), - Vector((0.9999886155128479, -0.004760404583066702, 0.0)), - Vector((0.006036431062966585, 0.999981701374054, 0.0)), - Vector((-0.0995304062962532, 0.9950344562530518, 0.0)), - Vector((-0.31393277645111084, 0.9494451880455017, 0.0)), - Vector((-0.4619814157485962, 0.8868895769119263, 0.0)), - Vector((-0.6095701456069946, 0.7927320599555969, 0.0)), - Vector((-0.7265205383300781, 0.6871447563171387, 0.0)), - Vector((-0.8317295908927917, 0.555181086063385, 0.0)), - Vector((-0.9128195643424988, 0.40836307406425476, 0.0)), - Vector((-0.9663935303688049, 0.2570672035217285, 0.0)), - Vector((-0.995459258556366, 0.09518897533416748, 0.0)), - Vector((-0.9970867037773132, -0.07627619802951813, 0.0)), - Vector((-0.9687232971191406, -0.24814364314079285, 0.0)) -] -holesInfo = None -firstVertIndex = 20 -numPolygonVerts = 20 -faces = [] - -bpypolyskel.debugOutputs["skeleton"] = 1 - - -@pytest.mark.dependency() -@pytest.mark.timeout(10) -def test_polygonize(): - global faces - faces = bpypolyskel.polygonize(verts, firstVertIndex, numPolygonVerts, holesInfo, 0.0, 0.5, None, unitVectors) - - -@pytest.mark.dependency(depends=["test_polygonize"]) -def test_numVertsInFace(): - for face in faces: - assert len(face) >= 3 - - -@pytest.mark.dependency(depends=["test_polygonize"]) -def test_duplication(): - for face in faces: - assert len(face) == len(set(face)) - - -@pytest.mark.dependency(depends=["test_polygonize"]) -def test_edgeCrossing(): - assert not bpypolyskel.checkEdgeCrossing(bpypolyskel.debugOutputs["skeleton"]) \ No newline at end of file diff --git a/misc/testing/osm/debug/336079890_kropivnitsky_yaroshenka_1.osm b/misc/testing/osm/tests/336079890_kropivnitsky_yaroshenka_1.osm similarity index 100% rename from misc/testing/osm/debug/336079890_kropivnitsky_yaroshenka_1.osm rename to misc/testing/osm/tests/336079890_kropivnitsky_yaroshenka_1.osm diff --git a/misc/testing/osm/debug/530431938_denver_basilica.osm b/misc/testing/osm/tests/530431938_denver_basilica.osm similarity index 100% rename from misc/testing/osm/debug/530431938_denver_basilica.osm rename to misc/testing/osm/tests/530431938_denver_basilica.osm