Salome HOME
ParaView 4.1 / VTK 6.1 porting
[modules/hexablock.git] / doc / test_doc / cutHexa / cut_hexa.py
1 # -*- coding: utf-8 -*-
2 ####### Test for Cut Hexa ###############
3
4 import hexablock
5
6
7 doc = hexablock.addDocument("Cut Hexa Test")
8
9 size_x = 2
10 size_y = 1
11 size_z = 1
12
13 grid  = doc.makeCartesianTop (size_x,size_y,size_z)
14 arete = grid.getEdgeK (0, 0, 0)
15
16 doc.saveVtk ("decoupe1.vtk")
17 nbCuts = 2
18 grid2 = doc.cutUni (arete, nbCuts)
19 doc.saveVtk ("decoupe2.vtk")
20
21 #tablen = []
22 #reste  = 1
23 #abscisse = 0
24 #for nl in range(5):
25 #    reste     /= 2
26 #    abscisse  += reste
27 #    tablen.append (abscisse)
28 tablen = [2, 3, 8, 14, 18]
29 arete = grid2.getEdge(0)
30 grid3 = doc.cut(arete, tablen)
31 doc.saveVtk ("decoupe3.vtk")