summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-08 13:46:05 +0000
committerKarl Berry <karl@freefriends.org>2010-06-08 13:46:05 +0000
commita960e44eb527236f39aec81babc0474911a86078 (patch)
tree9950eca71791d90820a80a521a7cc252c0955db5 /Build/source/utils/asymptote/examples
parent6443467452320c296faa1f43f0606a9457bd4463 (diff)
asy 1.96
git-svn-id: svn://tug.org/texlive/trunk@18817 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/examples')
-rw-r--r--Build/source/utils/asymptote/examples/100d.views33
-rw-r--r--Build/source/utils/asymptote/examples/BezierSurface.asy9
-rw-r--r--Build/source/utils/asymptote/examples/Klein.asy15
-rw-r--r--Build/source/utils/asymptote/examples/NURBSsphere.asy70
-rw-r--r--Build/source/utils/asymptote/examples/label3zoom.asy16
-rw-r--r--Build/source/utils/asymptote/examples/parametricsurface.asy4
-rw-r--r--Build/source/utils/asymptote/examples/pdb.asy15
-rw-r--r--Build/source/utils/asymptote/examples/pipeintersection.asy2
-rw-r--r--Build/source/utils/asymptote/examples/sphere.asy2
9 files changed, 121 insertions, 45 deletions
diff --git a/Build/source/utils/asymptote/examples/100d.views b/Build/source/utils/asymptote/examples/100d.views
index b3a1be12936..5e73cb0c8b9 100644
--- a/Build/source/utils/asymptote/examples/100d.views
+++ b/Build/source/utils/asymptote/examples/100d.views
@@ -1,3 +1,30 @@
-{0 0 -14.425469398498535}{0 0 1}{14.425469398498535}{}{27.905145957890003}
-{0.3336401879787445 -0.0024074832908809185 -14.015975952148438}{-0.7636404037475586 -0.17614173889160156 0.6211501359939575}{15.868016873340485}{-58.88738872302071}{27.905145957890003}
-[Arbitrary Label]{0.3336401879787445 -0.0024074832908809185 -14.015975952148438}{-0.8299760222434998 0.19688645005226135 -0.5218961238861084}{15.868016035928465}{-94.62674045286937}{27.905145957890003}
+VIEW%={View A}
+ COO=0.000001944790710695088 -0.000000199754154551 -303.740966796875
+ C2C=-0.43931567668914795 -0.011656288057565689 0.8982571363449097
+ ROO=367.52660744556164
+ ROLL=-75.86431813030065
+ AAC=34.903342413559436
+ BGCOLOR=1. 1. 1.
+ LIGHTS=Artwork
+ RENDERMODE=Solid
+END
+VIEW%={View B}
+ COO=-52.16141891479492 50.85958480834961 -249.23748779296875
+ C2C=-0.0608830563724041 0.722907543182373 -0.6882571578025818
+ ROO=117.10558117788756
+ ROLL=105.68252665017765
+ AAC=34.903342413559436
+ BGCOLOR=1. 1. 1.
+ LIGHTS=Artwork
+ RENDERMODE=Solid
+END
+VIEW%={View C}
+ COO=2.2545230388641357 2.9914066791534424 -300.3456115722656
+ C2C=0.8536049127578735 0.3032689690589905 -0.42354053258895874
+ ROO=303.7410359852936
+ ROLL=-126.08445879535664
+ AAC=34.903342413559436
+ BGCOLOR=1. 1. 1.
+ LIGHTS=Artwork
+ RENDERMODE=Solid
+END
diff --git a/Build/source/utils/asymptote/examples/BezierSurface.asy b/Build/source/utils/asymptote/examples/BezierSurface.asy
index bf386baf7e5..f8cbc458ca0 100644
--- a/Build/source/utils/asymptote/examples/BezierSurface.asy
+++ b/Build/source/utils/asymptote/examples/BezierSurface.asy
@@ -1,8 +1,13 @@
import three;
-string viewpoint="{-24.132780075073242 7.2992024421691895 7.695427417755127}{0.8244762420654297 -0.563306450843811 0.0540805421769619}{35.62141440580922}{17.392748820528627}{}";
+string viewpoint="
+COO=-684.0787963867188 206.90650939941406 218.13809204101562
+C2C=0.8244762420654297 -0.563306450843811 0.0540805421769619
+ROO=1009.7407942621448
+ROLL=17.39344555165265
+";
-//viewpoint=getstring("viewpoint",viewpoint);
+// viewpoint=getstring("viewpoint",viewpoint);
currentprojection=perspective(viewpoint);
triple[][][] P={
diff --git a/Build/source/utils/asymptote/examples/Klein.asy b/Build/source/utils/asymptote/examples/Klein.asy
index 0d31c495f01..b2f6d1b0e79 100644
--- a/Build/source/utils/asymptote/examples/Klein.asy
+++ b/Build/source/utils/asymptote/examples/Klein.asy
@@ -22,7 +22,7 @@ triple f(pair t) {
}
surface s=surface(f,(0,0),(2pi,2pi),8,8,Spline);
-draw(s,lightolive+white);
+draw(s,lightolive+white,"bottle");
string lo="$\displaystyle u\in[0,\pi]: \cases{x=3\cos u(1+\sin u)+(2-\cos u)\cos u\cos v,\cr
y=8\sin u+(2-\cos u)\sin u\cos v,\cr
@@ -34,11 +34,18 @@ z=(2-\cos u)\sin v.\cr}$";
real h=0.0125;
-draw(surface(xscale(-0.38)*yscale(-0.18)*lo,s,0,1.7,h,bottom=false));
-draw(surface(xscale(0.26)*yscale(0.1)*rotate(90)*hi,s,4.9,1.4,h,bottom=false));
+begingroup3("parametrization");
+draw(surface(xscale(-0.38)*yscale(-0.18)*lo,s,0,1.7,h,bottom=false),
+ "[0,pi]");
+draw(surface(xscale(0.26)*yscale(0.1)*rotate(90)*hi,s,4.9,1.4,h,bottom=false),
+ "[pi,2pi]");
+endgroup3();
+
+begingroup3("boundary");
draw(s.uequals(0),blue+dashed);
draw(s.uequals(pi),blue+dashed);
+endgroup3();
add(new void(frame f, transform3 t, picture pic, projection P) {
- draw(f,invert(box(min(f,P),max(f,P)),P));
+ draw(f,invert(box(min(f,P),max(f,P)),P),"frame");
});
diff --git a/Build/source/utils/asymptote/examples/NURBSsphere.asy b/Build/source/utils/asymptote/examples/NURBSsphere.asy
index d7f0e77321d..5258c9986de 100644
--- a/Build/source/utils/asymptote/examples/NURBSsphere.asy
+++ b/Build/source/utils/asymptote/examples/NURBSsphere.asy
@@ -1,32 +1,46 @@
import three;
-size(400);
+/* Reference:
+@article{Qin97,
+ title={{Representing quadric surfaces using NURBS surfaces}},
+ author={Qin, K.},
+ journal={Journal of Computer Science and Technology},
+ volume={12},
+ number={3},
+ pages={210--216},
+ year={1997},
+ publisher={Springer}
+}
+*/
+
+size(10cm);
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);
+// udegree=2, vdegree=3, nu=3, nv=4;
+
+real[] W={2/3,1/3,1};
+real[] w={1,1/3,1/3,1};
+
+// 10 distinct control points
+triple[][] P={{(0,0,1),(-2,-2,1),(-2,-2,-1),(0,0,-1)},
+ {(0,0,1),(2,-2,1),(2,-2,-1),(0,0,-1)},
+ {(0,0,1),(2,2,1),(2,2,-1),(0,0,-1)},
+ {(0,0,1),(-2,2,1),(-2,2,-1),(0,0,-1)}};
+
+P.cyclic=true;
+
+real[][] weights=new real[3][4];
+for(int i=0; i < 3; ++i)
+for(int j=0; j < 4; ++j)
+ weights[i][j]=W[i]*w[j];
+
+real[] uknot={0,0,1/3,1/2,1,1};
+real[] vknot={0,0,0,0,1,1,1,1};
+
+int N=1;
+
+for(int k=0; k < N; ++k)
+for(int i=0; i < 4; ++i)
+ draw(shift(k*Z)*P[i:i+3],uknot,vknot,weights,blue);
+
+// draw(unitsphere,red+opacity(0.1));
diff --git a/Build/source/utils/asymptote/examples/label3zoom.asy b/Build/source/utils/asymptote/examples/label3zoom.asy
new file mode 100644
index 00000000000..7eafccd8fcd
--- /dev/null
+++ b/Build/source/utils/asymptote/examples/label3zoom.asy
@@ -0,0 +1,16 @@
+import three;
+
+currentlight=Headlamp;
+size(469.75499pt,0);
+
+currentprojection=perspective(
+camera=(160.119024441391,136.348802919248,253.822628496226),
+up=(-0.188035408976828,0.910392236102215,-0.368549401594584),
+target=(25.5462739598034,1.77605243766079,-9.93996244768584),
+zoom=5.59734733413271,
+angle=5.14449021168139,
+viewportshift=(0.813449720559684,-0.604674743165144),
+autoadjust=false);
+
+draw(scale3(4)*extrude("$\displaystyle\int\limits_{-\infty}^{+\infty}\!\! e^{-\alpha x^2}\!\!=\sqrt{\frac{\pi}{\alpha}}$",2Z),
+ material(blue,ambientpen=mediumgray));
diff --git a/Build/source/utils/asymptote/examples/parametricsurface.asy b/Build/source/utils/asymptote/examples/parametricsurface.asy
index f78e8470658..de669b59faf 100644
--- a/Build/source/utils/asymptote/examples/parametricsurface.asy
+++ b/Build/source/utils/asymptote/examples/parametricsurface.asy
@@ -14,10 +14,10 @@ pen p=rgb(0.2,0.5,0.7);
surface s=surface(f,(0,0),(2pi,2pi),8,8,Spline);
// surface only
-draw(s,lightgray);
+//draw(s,lightgray);
// mesh only
// draw(s,nullpen,meshpen=p);
// surface & mesh
-// draw(s,lightgray,meshpen=p);
+draw(s,lightgray,meshpen=p);
diff --git a/Build/source/utils/asymptote/examples/pdb.asy b/Build/source/utils/asymptote/examples/pdb.asy
index e06b1241bce..b4f9175ae14 100644
--- a/Build/source/utils/asymptote/examples/pdb.asy
+++ b/Build/source/utils/asymptote/examples/pdb.asy
@@ -9,12 +9,12 @@ bool getviews=true;
currentlight=White;
//currentlight=nolight;
+defaultrender.merge=true; // Fast low-quality rendering
+//defaultrender.merge=false; // Slow high-quality rendering
+
size(200);
currentprojection=perspective(30,30,15);
-// Uncomment this line for more accurate (but slower) PDF rendering
-//dotgranularity=0;
-
pen chainpen=green;
pen hetpen=purple;
@@ -121,6 +121,7 @@ while(true) {
write("Number of atomic chains: ",chains.length);
int natoms;
+begingroup3("chained");
for(chain c : chains) {
for(int i=0; i < c.a.length-1; ++i)
draw(c.a[i].v--c.a[i+1].v,chainpen,currentlight);
@@ -128,25 +129,30 @@ for(chain c : chains) {
dot(a.v,color(a.name),currentlight);
natoms += c.a.length;
}
+endgroup3();
write("Number of chained atoms: ",natoms);
write("Number of hetero atoms: ",atoms.length);
+begingroup3("hetero");
for(atom h : atoms)
dot(h.v,color(h.name),currentlight);
+endgroup3();
write("Number of hetero bonds: ",bonds.length);
+begingroup3("bonds");
for(bond b : bonds) {
triple v(int i) {return atoms[find(serials == i)].v;}
draw(v(b.i)--v(b.j),hetpen,currentlight);
}
+endgroup3();
string options;
string viewfilename=prefix+".views";
if(!error(input(viewfilename,check=false)))
- options="3Dviews="+viewfilename;
+ options="3Dviews2="+viewfilename;
if(getviews) {
picture pic;
@@ -155,3 +161,4 @@ if(getviews) {
shipout(prefix,pic,options=options);
} else
shipout(prefix,options=options);
+
diff --git a/Build/source/utils/asymptote/examples/pipeintersection.asy b/Build/source/utils/asymptote/examples/pipeintersection.asy
index d65b8b562ea..5bf9cfbe6f3 100644
--- a/Build/source/utils/asymptote/examples/pipeintersection.asy
+++ b/Build/source/utils/asymptote/examples/pipeintersection.asy
@@ -9,4 +9,4 @@ real f(pair z) {return min(sqrt(1-z.x^2),sqrt(1-z.y^2));}
surface s=surface(f,(0,0),(1,1),40,Spline);
transform3 t=rotate(90,O,Z), t2=t*t, t3=t2*t, i=xscale3(-1)*zscale3(-1);
-draw(surface(s,t*s,t2*s,t3*s,i*s,i*t*s,i*t2*s,i*t3*s),blue);
+draw(surface(s,t*s,t2*s,t3*s,i*s,i*t*s,i*t2*s,i*t3*s),blue,render(merge=true));
diff --git a/Build/source/utils/asymptote/examples/sphere.asy b/Build/source/utils/asymptote/examples/sphere.asy
index 8c5a444d01a..41f3f548895 100644
--- a/Build/source/utils/asymptote/examples/sphere.asy
+++ b/Build/source/utils/asymptote/examples/sphere.asy
@@ -3,4 +3,4 @@ import three;
size(200);
currentprojection=orthographic(5,4,3);
-draw(unitsphere,green);
+draw(unitsphere,green,render(compression=Zero));