|
4 | 4 | from mesh_model.mesh_struct.mesh_elements import Dart |
5 | 5 | import mesh_model.mesh_analysis as Mesh_analysis |
6 | 6 | from actions.triangular_actions import split_edge_ids |
| 7 | +from plots.mesh_plotter import plot_mesh |
7 | 8 |
|
8 | 9 | class TestMeshAnalysis(unittest.TestCase): |
9 | 10 |
|
@@ -69,6 +70,26 @@ def test_isFlipOk(self): |
69 | 70 | dart_to_test = Dart(cmap, 2) |
70 | 71 | self.assertTrue(Mesh_analysis.isFlipOk(dart_to_test)) |
71 | 72 |
|
| 73 | + def test_isSplitOk(self): |
| 74 | + nodes = [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [2.0, 0.0]] |
| 75 | + faces = [[0, 1, 2], [0, 2, 3], [1, 4, 2]] |
| 76 | + cmap = Mesh(nodes, faces) |
| 77 | + plot_mesh(cmap) |
| 78 | + dart_to_test = Dart(cmap, 0) |
| 79 | + self.assertFalse(Mesh_analysis.isSplitOk(dart_to_test)) |
| 80 | + dart_to_test = Dart(cmap, 2) |
| 81 | + self.assertTrue(Mesh_analysis.isSplitOk(dart_to_test)) |
| 82 | + |
| 83 | + def test_isCollapseOk(self): |
| 84 | + nodes = [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [2.0, 0.0]] |
| 85 | + faces = [[0, 1, 2], [0, 2, 3], [1, 4, 2]] |
| 86 | + cmap = Mesh(nodes, faces) |
| 87 | + plot_mesh(cmap) |
| 88 | + dart_to_test = Dart(cmap, 0) |
| 89 | + self.assertFalse(Mesh_analysis.isCollapseOk(dart_to_test)) |
| 90 | + dart_to_test = Dart(cmap, 2) |
| 91 | + self.assertFalse(Mesh_analysis.isCollapseOk(dart_to_test)) |
| 92 | + |
72 | 93 |
|
73 | 94 | if __name__ == '__main__': |
74 | 95 | unittest.main() |
0 commit comments