def createTools(): global TOOLS if TOOLS != []: return # deja crees # square P0 = (0, 0, 0) # pointe P0 = (0, 0, 0) P1 = (-1, -1, 1) P2 = (-1, 1, 1) P3 = (-1, 1, -1) P4 = (-1, -1, -1) t1 = D.triangle(P0, P1, P2) t2 = D.triangle(P0, P2, P3) t3 = D.triangle(P0, P3, P4) t4 = D.triangle(P0, P4, P1) t = T.join([t1, t2, t3, t4]) t = G.close(t) TOOLS.append(t) # biseau horizontal P0 = (0, -1, 0) P1 = (0, 1, 0) P1 = (-1, -1, 1) P2 = (-1, 1, 1) P3 = (-1, 1, -1) P4 = (-1, -1, -1) t1 = D.triangle(P0, P1, P2) t2 = D.triangle(P0, P2, P3) t3 = D.triangle(P0, P3, P4) t4 = D.triangle(P0, P4, P1) t = T.join([t1, t2, t3, t4]) t = G.close(t) # biseau vertical # pointe spherique return TOOLS
# - triangle (pyTree) - import Geom.PyTree as D import Converter.PyTree as C import KCore.test as test a = D.triangle((0, 0, 0), (0.1, 0., 0.1), (0.05, 0.08, 0.1)) t = C.newPyTree(['Base', 2, a]) test.testT(t, 1) test.writeCoverage(100)
# - convertHO2LO (pyTree) - import Converter.PyTree as C import Geom.PyTree as D import Generator.PyTree as G import Transform.PyTree as T import KCore.test as test # BAR -> BAR_3 a = D.line((0,0,0), (1,0,0), N=3) a = C.convertArray2Hexa(a) a = C.convertLO2HO(a, 0) a = C.convertHO2LO(a, 0) test.testT(a, 1) # TRI -> TRI_6 a = D.triangle((0,0,0), (1,0,0), (1,1,0)) a = C.convertLO2HO(a, 0) a = C.convertHO2LO(a, 0) test.testT(a, 2) # QUAD -> QUAD_8 a = D.quadrangle((0,0,0), (1,0,0), (1,1,0), (0,1,0)) a = C.convertLO2HO(a, 0) a = C.convertHO2LO(a, 0) test.testT(a, 3) # QUAD -> QUAD_9 a = D.quadrangle((0,0,0), (1,0,0), (1,1,0), (0,1,0)) a = C.convertLO2HO(a, 1) a = C.convertHO2LO(a, 0) test.testT(a, 4)