summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples/NURBSsphere.asy
blob: d7f0e77321d298688454edd410c19eaa9cc37f47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);