11import pyMagix3D as Mgx3D
22
3- def test_issue208_2_sectionByPlane ():
3+ # Tests de la fonction sectionByPlane du GeomManager
4+ # pour laquelle un certain nombres de bug a été trouvé
5+ # (cf. Issue#208)
6+
7+ def test_3_boxes ():
48 ctx = Mgx3D .getStdContext ()
59 ctx .clearSession () # Clean the session after the previous test
610 gm = ctx .getGeomManager ()
@@ -34,7 +38,7 @@ def test_issue208_2_sectionByPlane():
3438 ctx .redo ()
3539 assert gm .getNbVolumes () == 5
3640
37- def test_issue208_single_sectionByPlane ():
41+ def test_3_boxes_two_sections ():
3842 ctx = Mgx3D .getStdContext ()
3943 ctx .clearSession () # Clean the session after the previous test
4044 gm = ctx .getGeomManager ()
@@ -58,7 +62,7 @@ def test_issue208_single_sectionByPlane():
5862 ctx .redo ()
5963 assert gm .getNbVolumes () == 5
6064
61- def test_issue208_nested_volumes ():
65+ def test_nested_spheres ():
6266 ctx = Mgx3D .getStdContext ()
6367 ctx .clearSession () # Clean the session after the previous test
6468 gm = ctx .getGeomManager ()
@@ -84,3 +88,26 @@ def test_issue208_nested_volumes():
8488 # Des volumes sont créés en double => 6 volumes au lieu de 4
8589 assert gm .getNbVolumes () == 4
8690 assert gm .getNbSurfaces () == 6
91+
92+ def test_nested_surfaces ():
93+ ctx = Mgx3D .getStdContext ()
94+ ctx .clearSession () # Clean the session after the previous test
95+ gm = ctx .getGeomManager ()
96+
97+ # Création d'une boite avec une topologie
98+ gm .newBox (Mgx3D .Point (0 , 0 , 0 ), Mgx3D .Point (1 , 1 , 1 ))
99+ # Création d'une boite avec une topologie
100+ gm .newBox (Mgx3D .Point (- 1 , - 1 , - 1 ), Mgx3D .Point (1 , 2 , 2 ))
101+ # Collage entre Vol0000 Vol0001
102+ gm .glue (["Vol0000" ,"Vol0001" ])
103+ # Destruction de Vol0002 Vol0000
104+ gm .destroy (["Vol0002" , "Vol0000" ], False )
105+ assert gm .getNbSurfaces () == 12
106+
107+ # Section par un plan de Surf0012 suivant [ [ 1, .5, 0] , [ 0, 1, 0] ]
108+ gm .sectionByPlane (["Surf0012" ], Mgx3D .Plane (Mgx3D .Point (1 , .5 , 0 ), Mgx3D .Vector (0 , 1 , 0 )), "" )
109+ assert gm .getNbSurfaces () == 13
110+ ctx .undo ()
111+ assert gm .getNbSurfaces () == 12
112+ gm .sectionByPlane (["Surf0012" , "Surf0001" ], Mgx3D .Plane (Mgx3D .Point (1 , .5 , 0 ), Mgx3D .Vector (0 , 1 , 0 )), "" )
113+ assert gm .getNbSurfaces () == 14
0 commit comments