import three; size(400); currentprojection=perspective(5,4,2,autoadjust=false); real[] uknot={0,0,0,1,1,2,2,3,3,4,4,4}; real[] vknot={0,0,0,1,1,2,2,2}; triple[][] P={{(0,0,1),(1,0,1),(1,0,0),(1,0,-1),(0,0,-1)}, {(0,0,1),(1,1,1),(1,1,0),(1,1,-1),(0,0,-1)}, {(0,0,1),(0,1,1),(0,1,0),(0,1,-1),(0,0,-1)}, {(0,0,1),(-1,1,1),(-1,1,0),(-1,1,-1),(0,0,-1)}, {(0,0,1),(-1,0,1),(-1,0,0),(-1,0,-1),(0,0,-1)}, {(0,0,1),(-1,-1,1),(-1,-1,0),(-1,-1,-1),(0,0,-1)}, {(0,0,1),(0,-1,1),(0,-1,0),(0,-1,-1),(0,0,-1)}, {(0,0,1),(1,-1,1),(1,-1,0),(1,-1,-1),(0,0,-1)}, {(0,0,1),(1,0,1),(1,0,0),(1,0,-1),(0,0,-1)}}; real[][] weights={ {1,1,2,1,1}, {1,1,2,1,1}, {2,2,4,2,2}, {1,1,2,1,1}, {1,1,2,1,1}, {1,1,2,1,1}, {2,2,4,2,2}, {1,1,2,1,1}, {1,1,2,1,1} }; draw(P,uknot,vknot,weights,yellow);