Exemple #1
0
# - lineGenerate -
import Geom.PyTree as D
import Generator.PyTree as G
import KCore.test as test
import Converter.PyTree as C

# 1D structure
a = D.naca(12.)
b = D.line((0, 0, 0), (0, 0., 1.))
c = D.lineGenerate(a, b)
t = C.newPyTree(['Base', 2])
t[2][1][2].append(c)
test.testT(t, 1)

# 1D structure + champ noeud
a = D.circle((0, 0, 0), 1)
a = C.addVars(a, 'var')
b = D.line((0, 0, 0), (0, 0, 1))
c = D.lineGenerate(a, b)
t = C.newPyTree(['Base', 2])
t[2][1][2].append(c)
test.testT(t, 2)

# 2D structure + champ en noeuds + champ en centres
a = G.cylinder((0, 0, 0), 1, 2, 360, 0, 1, (50, 21, 1))
a = C.addVars(a, 'var')
a = C.addVars(a, 'centers:var2')
b = D.line((0, 0, 0), (0, 0., 1.))
c = D.lineGenerate(a, b)
t = C.newPyTree(['Base', 3])
t[2][1][2].append(c)
# - lineGenerate (pyTree)-
import Geom.PyTree as D
import Converter.PyTree as C

# With one driving curve
a = D.naca(12.)
l = D.line((0, 0, 0), (0, 0., 1.))
a = D.lineGenerate(a, l)
C.convertPyTree2File(a, 'out.cgns')

# With a set of driving curves
a = D.naca(12.)
d1 = D.line((0, 0, 0), (0., 0., 1.))
d2 = D.line((1, 0, 0), (2, 0, 1))
a = D.lineGenerate(a, [d1, d2])
C.convertPyTree2File(a, 'out.cgns')