Params np = getParams(n);
int numChildren = 0;
Iterator childIter = n.children();
while ( childIter.hasNext() ) {
NodeItem c = (NodeItem)childIter.next();
if ( c.isVisible() ) ++numChildren;
}
double dd = l*np.d;
double p = t + Math.PI;
double fs = (numChildren==0 ? 0 : np.f/numChildren);
double pr = 0;
childIter = n.children();
while ( childIter.hasNext() ) {
NodeItem c = (NodeItem)childIter.next();
if ( !c.isVisible() ) continue;
Params cp = getParams(c);
double aa = np.c * cp.a;
double rr = np.d * Math.tan(aa)/(1-Math.tan(aa));
p += pr + aa + fs;
double xx = (l*rr+dd)*Math.cos(p);