@@ -190,6 +190,36 @@ def test_command_common(capfd):
190190 assert gm .getNbSurfaces ()== 11
191191 assert gm .getNbCurves ()== 20
192192
193+ def test_command_common2d (capfd ):
194+ ctx = Mgx3D .getStdContext ()
195+ ctx .clearSession () # Clean the session after the previous test
196+ gm = ctx .getGeomManager ()
197+ tm = ctx .getTopoManager ()
198+
199+ # Création d'une boite avec une topologie
200+ tm .newBoxWithTopo (Mgx3D .Point (0 , 0 , 0 ), Mgx3D .Point (1 , 1 , 1 ), 10 , 10 , 10 )
201+ # Création d'une boite avec une topologie
202+ tm .newBoxWithTopo (Mgx3D .Point (.2 , .2 , .2 ), Mgx3D .Point (.8 , .8 , .8 ), 10 , 10 , 10 )
203+ # Création d'une boite avec une topologie
204+ tm .newBoxWithTopo (Mgx3D .Point (.2 , .8 , .2 ), Mgx3D .Point (.8 , 1.4 , .8 ), 10 , 10 , 10 )
205+ # Collage entre géométries avec topologies
206+ gm .glue (["Vol0001" ,"Vol0002" ])
207+ assert gm .getNbSurfaces ()== 17
208+ assert gm .getNbCurves ()== 32
209+
210+ # Intersection booléenne entre 2 géométries 1D ou 2D avec topologies
211+ gm .common2D ("Surf0003" , "Surf0016" , "" )
212+ assert gm .getNbSurfaces ()== 15
213+ assert gm .getNbCurves ()== 25
214+ # Annulation de : Intersection booléenne entre 2 géométries 1D ou 2D, sans destruction
215+ ctx .undo ()
216+ assert gm .getNbSurfaces ()== 17
217+ assert gm .getNbCurves ()== 32
218+ # Rejeu de : Intersection booléenne entre 2 géométries 1D ou 2D, sans destruction
219+ ctx .redo ()
220+ assert gm .getNbSurfaces ()== 15
221+ assert gm .getNbCurves ()== 25
222+
193223def assertPoint (gm , point , x , y , z ):
194224 p = gm .getCoord (point )
195225 assert p .getX () == x
0 commit comments