1
1
import pyMagix3D as Mgx3D
2
2
3
- def test_topo_box ():
3
+ def test_topo_box (capfd ):
4
4
ctx = Mgx3D .getStdContext ()
5
5
ctx .clearSession () # Clean the session after the previous test
6
- tm = ctx .getTopoManager ()
6
+ tm = ctx .getTopoManager ()
7
7
8
8
tm .newBoxWithTopo (Mgx3D .Point (0 , 0 , 0 ), Mgx3D .Point (1 , 1 , 1 ), 10 , 10 , 10 )
9
9
assert tm .getNbBlocks ()== 1
10
10
assert tm .getNbFaces ()== 6
11
11
12
- def test_fuse_geom_topo ():
12
+ out , err = capfd .readouterr ()
13
+ assert len (err ) == 0
14
+
15
+ def test_fuse_geom (capfd ):
13
16
ctx = Mgx3D .getStdContext ()
14
17
ctx .clearSession () # Clean the session after the previous test
15
18
gm = ctx .getGeomManager ()
16
- tm = ctx .getTopoManager ()
19
+ tm = ctx .getTopoManager ()
20
+ mm = ctx .getMeshManager ()
21
+
22
+ # Création du cylindre Vol0000
23
+ gm .newCylinder (Mgx3D .Point (0 , 0 , 0 ), 1 , Mgx3D .Vector (1 , 0 , 0 ), 1.800000e+02 )
24
+ # Création du volume Vol0001
25
+ gm .newSphere (Mgx3D .Point (1 , 0 , 0 ), 1 , Mgx3D .Portion .QUART )
26
+ # Rotation de Vol0001 suivant [ [ 1, 0, 0] , [ 1, 0, 1] , 270]
27
+ gm .rotate (["Vol0001" ], Mgx3D .Rotation (Mgx3D .Point (1 , 0 , 0 ), Mgx3D .Point (1 , 0 , 1 ), 270 ))
28
+ # Fusion Booléenne de Vol0001 Vol0000
29
+ gm .fuse (["Vol0001" ,"Vol0000" ])
30
+ assert gm .getNbVolumes () == 1
31
+ # Création d'un bloc topologique non structuré sur une géométrie (Vol0002)
32
+ tm .newUnstructuredTopoOnGeometry ("Vol0002" )
33
+ # Création du maillage pour tous les blocs
34
+ mm .newAllBlocksMesh ()
35
+
36
+ out , err = capfd .readouterr ()
37
+ assert len (err ) == 0
38
+
39
+ def test_fuse_geom_topo (capfd ):
40
+ ctx = Mgx3D .getStdContext ()
41
+ ctx .clearSession () # Clean the session after the previous test
42
+ gm = ctx .getGeomManager ()
43
+ tm = ctx .getTopoManager ()
17
44
18
45
# Création d'une boite avec une topologie
19
46
tm .newBoxWithTopo (Mgx3D .Point (0 , 0 , 0 ), Mgx3D .Point (1 , 1 , 1 ), 10 , 10 , 10 )
@@ -33,3 +60,6 @@ def test_fuse_geom_topo():
33
60
tm .fuse2Blocks ("Bl0000" ,"Bl0001" )
34
61
assert tm .getNbBlocks () == 1
35
62
assert tm .getNbFaces () == 10
63
+
64
+ out , err = capfd .readouterr ()
65
+ assert len (err ) == 0
0 commit comments