summaryrefslogtreecommitdiff
path: root/Master/texmf/doc/asymptote/examples/NURBSsphere.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf/doc/asymptote/examples/NURBSsphere.asy')
-rw-r--r--Master/texmf/doc/asymptote/examples/NURBSsphere.asy32
1 files changed, 32 insertions, 0 deletions
diff --git a/Master/texmf/doc/asymptote/examples/NURBSsphere.asy b/Master/texmf/doc/asymptote/examples/NURBSsphere.asy
new file mode 100644
index 00000000000..d7f0e77321d
--- /dev/null
+++ b/Master/texmf/doc/asymptote/examples/NURBSsphere.asy
@@ -0,0 +1,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);