{{tag>programmation python maya maths}} ======Arbre fractal====== Par position/rotation (polygonal) : from maya.cmds import polyCube,xform from math import cos,sin def tree(x,y,z,a,b,l,w,r,s,it,lvl=0): if(lvl Par position (courbes) : from maya.cmds import curve from math import cos,sin class FractalTree(): '''Tree in one curve (inexact but light)''' def __init__(self): self.pts = [] self.it = 7 # tree iterations self.r = .7 # branch length factor self.s = .5 # branch spreading (0 from maya.cmds import curve from math import cos,sin class FractalTree(): '''Every branch is a curve (exact, 20.000+ curves in it-8)''' def __init__(self): self.it = 6 # tree iterations self.r = .7 # branch length factor self.s = .5 # branch spreading (0 {{gallery>:galerie?fractaltree*&500x500&nocrop&showtitle}} ~~DISCUSSION~~