for i,f in enumerate(F[1:]):
       G[0].append(connect([F[i],f,f],bias=[0,1,0]))
       if i > 0:
           G[1].append(connect([F[i],F[i],f],bias=[0,1,1]))
    G = map(Formex.concatenate,G)
    for i,f in enumerate(G):
       f.setProp(i+1)
    G = Formex.concatenate(G)

    clear()
    draw(G)
    
    smoothwire()
    #GD.canvas.update()
    T = G.translate([0,bot,r]).spherical()
    clear()
    draw(T)

    T += T.reflect(dir=2)
    clear()
    draw(T)

    if ack('Export this model in STL format?',default='No'):
        fn = askNewFilename(getcfg('workdir'),"Stl files (*.stl)")
        if fn:
            from plugins import surface
            f = file(fn,'w')
            surface.write_stla(f,T.coords)
            f.close()

    b = e.reverseElements()
    #b.setProp(2)
    
# create the bumps
for p in a:
    e = e.bump(2,p, lambda x:exp(-0.5*x),[0,1])
if shrink:
    e = e.shrink(0.8)

renderMode(rendermode)
if transparent:
    GD.canvas.alphablend = True
if bottom:
    draw(b,color=yellow,alpha=1.0)

draw(e,alpha=0.8)

if export:
    from plugins import surface
    f = file('novation.stl','w')
    F = e # + b
    # Create triangles
    G = F.selectNodes([0,1,2])
    # If polygones, add more triangles
    for i in range(3,F.nplex()):
        G += F.selectNodes([0,i-1,i])
    clear()
    draw(G)
    surface.write_stla(f,G.f)
    f.close()
    for i,f in enumerate(F[1:]):
       G[0].append(connect([F[i],f,f],bias=[0,1,0]))
       if i > 0:
           G[1].append(connect([F[i],F[i],f],bias=[0,1,1]))
    G = map(Formex.concatenate,G)
    for i,f in enumerate(G):
       f.setProp(i+1)
    G = Formex.concatenate(G)

    clear()
    draw(G)
    
    smoothwire()
    #GD.canvas.update()
    T = G.translate([0,bot,r]).spherical()
    clear()
    draw(T)

    T += T.reflect(dir=2)
    clear()
    draw(T)

    if ack('Export this model in STL format?',default='No'):
        fn = askNewFilename(getcfg('workdir'),"Stl files (*.stl)")
        if fn:
            from plugins import surface
            f = file(fn,'w')
            surface.write_stla(f,T.f)
            f.close()