From 43302e4235ec0431ecd3365616212c18892d6187 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 31 May 2012 23:08:27 +0000 Subject: asymptote 2.16 git-svn-id: svn://tug.org/texlive/trunk@26747 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/doc/asymptote/CAD.pdf | Bin 67539 -> 67553 bytes Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf | Bin 31404 -> 31448 bytes Master/texmf/doc/asymptote/asy-latex.pdf | Bin 207758 -> 194336 bytes Master/texmf/doc/asymptote/asyRefCard.pdf | Bin 0 -> 47440 bytes Master/texmf/doc/asymptote/asymptote.pdf | Bin 1758774 -> 1234515 bytes .../asymptote/examples/animations/earthmoon.asy | 2 +- .../doc/asymptote/examples/animations/sphere.asy | 6 +- .../doc/asymptote/examples/animations/wheel.asy | 16 ++++- .../doc/asymptote/examples/electromagnetic.asy | 12 ++-- .../texmf/doc/asymptote/examples/hyperboloid.asy | 4 +- .../asymptote/examples/hyperboloidsilhouette.asy | 4 +- Master/texmf/doc/asymptote/examples/latexusage.tex | 2 +- .../texmf/doc/asymptote/examples/pseudosphere.asy | 33 ++++++++++ Master/texmf/doc/asymptote/examples/ring.asy | 1 - Master/texmf/doc/asymptote/examples/splitpatch.asy | 69 +++++++++++++++++++-- 15 files changed, 123 insertions(+), 26 deletions(-) create mode 100644 Master/texmf/doc/asymptote/asyRefCard.pdf create mode 100644 Master/texmf/doc/asymptote/examples/pseudosphere.asy (limited to 'Master/texmf/doc/asymptote') diff --git a/Master/texmf/doc/asymptote/CAD.pdf b/Master/texmf/doc/asymptote/CAD.pdf index af88c9c9895..bb61b12dd4d 100644 Binary files a/Master/texmf/doc/asymptote/CAD.pdf and b/Master/texmf/doc/asymptote/CAD.pdf differ diff --git a/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf b/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf index 669f1660b2f..61dfa38cc71 100644 Binary files a/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf and b/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf differ diff --git a/Master/texmf/doc/asymptote/asy-latex.pdf b/Master/texmf/doc/asymptote/asy-latex.pdf index c028d584dd5..55883f461c8 100644 Binary files a/Master/texmf/doc/asymptote/asy-latex.pdf and b/Master/texmf/doc/asymptote/asy-latex.pdf differ diff --git a/Master/texmf/doc/asymptote/asyRefCard.pdf b/Master/texmf/doc/asymptote/asyRefCard.pdf new file mode 100644 index 00000000000..bed262c88fd Binary files /dev/null and b/Master/texmf/doc/asymptote/asyRefCard.pdf differ diff --git a/Master/texmf/doc/asymptote/asymptote.pdf b/Master/texmf/doc/asymptote/asymptote.pdf index 03e6987937e..914215456fb 100644 Binary files a/Master/texmf/doc/asymptote/asymptote.pdf and b/Master/texmf/doc/asymptote/asymptote.pdf differ diff --git a/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy b/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy index 08c578d86d2..efca043b8bc 100644 --- a/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy +++ b/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy @@ -62,7 +62,7 @@ draw(pic,shift(cst,0,0)*scale3(Rtl/2)*unitsphere,yellow); surface terre=scale3(Rtl/5)*unitsphere; surface lune=scale3(Rl)*unitsphere; -int n=100; +int n=50; real step=2pi/n; for(int i=0; i < n; ++i) { diff --git a/Master/texmf/doc/asymptote/examples/animations/sphere.asy b/Master/texmf/doc/asymptote/examples/animations/sphere.asy index 56c5f73e3b6..125cecc5566 100644 --- a/Master/texmf/doc/asymptote/examples/animations/sphere.asy +++ b/Master/texmf/doc/asymptote/examples/animations/sphere.asy @@ -22,11 +22,7 @@ for(int i=0; i < nbpts; ++i) { transform3 t=rotate(angle,(0,0,0),(1,0.25,0.25)); revolution r=sphere(O,3); draw(surface(r),lightgrey); -skeleton s; -r.transverse(s,reltime(r.g,0.5)); -r.longitudinal(s); -draw(s.transverse.back,linetype("8 8",8)); -draw(s.transverse.front); +draw(r,backpen=linetype("8 8",8)); animation A; diff --git a/Master/texmf/doc/asymptote/examples/animations/wheel.asy b/Master/texmf/doc/asymptote/examples/animations/wheel.asy index 2ea45f75613..6620d590850 100644 --- a/Master/texmf/doc/asymptote/examples/animations/wheel.asy +++ b/Master/texmf/doc/asymptote/examples/animations/wheel.asy @@ -1,4 +1,9 @@ import graph; + +// Uncomment the following 2 lines to support pdf animations: +// usepackage("animate"); +// settings.tex="pdflatex"; + import animation; size(0,200); @@ -24,6 +29,8 @@ guide wheel(guide g=nullpath, real a, real b, int n) real t1=0; real t2=t1+2*pi; +animation a; + draw(circle((0,0),1)); draw(wheel(t1,t2,100),linetype("0 2")); yequals(Label("$y=-1$",1.0),-1,extend=true,linetype("4 4")); @@ -34,8 +41,6 @@ pair z2=wheelpoint(t2); dot(z1); dot(z2); -animation a; - int n=10; real dt=(t2-t1)/n; for(int i=0; i <= n; ++i) { @@ -49,5 +54,10 @@ for(int i=0; i <= n; ++i) { restore(); } -// Produce the final merged gif. +erase(); + +// Merge the images into a gif animation. a.movie(BBox(0.25cm),loops=10,delay=250); + +// Merge the images into a pdf animation. +// label(a.pdf(BBox(0.25cm),delay=250,"controls",multipage=false)); diff --git a/Master/texmf/doc/asymptote/examples/electromagnetic.asy b/Master/texmf/doc/asymptote/examples/electromagnetic.asy index 058c7c5c574..d229f76b748 100644 --- a/Master/texmf/doc/asymptote/examples/electromagnetic.asy +++ b/Master/texmf/doc/asymptote/examples/electromagnetic.asy @@ -33,15 +33,15 @@ picture q=secondaryX(new void(picture p) { scale(p,LogLeft,Linear); xlimits(p,lambda(fmax),lambda(fmin)); ylimits(p,0,1); - xaxis(p,Label("\nano\metre",1),Top,LeftTicks(DefaultLogFormat,n=10)); + xaxis(p,Label("\nano\metre",1,0.01N),Top,LeftTicks(DefaultLogFormat,n=10)); }); add(q,above=true); margin margin=PenMargin(0,0); -draw("radio",Scale((10,1))--Scale((5e12,1)),N,Arrow); -draw("infrared",Scale((1e12,1.5))--Scale(shift(0,1.5)*ir),Arrows,margin); -draw("UV",Scale(shift(0,1.5)*uv)--Scale((1e17,1.5)),Arrows,margin); -draw("x-rays",Scale((1e16,1))--Scale((1e21,1)),N,Arrows); -draw("$\gamma$-rays",Scale((fmax,1.5))--Scale((2e18,1.5)),Arrow); +draw("radio",Scale((10,1))--Scale((5e12,1)),S,Arrow); +draw("infrared",Scale((1e12,1.75))--Scale(shift(0,1.75)*ir),LeftSide,Arrows,margin); +draw("UV",Scale(shift(0,1.75)*uv)--Scale((1e17,1.76)),LeftSide,Arrows,margin); +draw("x-rays",Scale((1e16,1))--Scale((1e21,1)),RightSide,Arrows); +draw("$\gamma$-rays",Scale((fmax,1.75))--Scale((2e18,1.75)),Arrow); diff --git a/Master/texmf/doc/asymptote/examples/hyperboloid.asy b/Master/texmf/doc/asymptote/examples/hyperboloid.asy index 0cf6da08c40..22f3b3d80b0 100644 --- a/Master/texmf/doc/asymptote/examples/hyperboloid.asy +++ b/Master/texmf/doc/asymptote/examples/hyperboloid.asy @@ -2,7 +2,7 @@ size(200); import solids; currentprojection=perspective(4,4,3); -revolution hyperboloid=revolution(new real(real x) {return sqrt(1+x*x);}, - -2,2,20,operator..,X); +revolution hyperboloid=revolution(graph(new triple(real z) { + return (sqrt(1+z*z),0,z);},-2,2,20,operator ..),axis=Z); draw(surface(hyperboloid),green,render(compression=Low,merge=true)); draw(hyperboloid,6,blue,longitudinalpen=nullpen); diff --git a/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy b/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy index 1187208a670..1bb265de622 100644 --- a/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy +++ b/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy @@ -4,6 +4,6 @@ settings.render=0; settings.prc=false; currentprojection=perspective(4,4,3); -revolution hyperboloid=revolution(new real(real x) {return sqrt(1+x*x);}, - -2,2,20,operator..,X); +revolution hyperboloid=revolution(graph(new triple(real z) { + return (sqrt(1+z*z),0,z);},-2,2,20,operator ..),axis=Z); draw(hyperboloid.silhouette(64),blue); diff --git a/Master/texmf/doc/asymptote/examples/latexusage.tex b/Master/texmf/doc/asymptote/examples/latexusage.tex index f3c858348b9..910cef5bf10 100644 --- a/Master/texmf/doc/asymptote/examples/latexusage.tex +++ b/Master/texmf/doc/asymptote/examples/latexusage.tex @@ -84,7 +84,7 @@ renderer. To support {\tt latexmk}, 3D figures should specify attachments; this requires the \verb+attach=true+ option as well as the \verb+attachfile2+ \LaTeX\ package. \begin{center} -\begin{asy}[height=4cm,inline=true,attach=false] +\begin{asy}[height=4cm,inline=true,attach=false,viewportwidth=\linewidth] currentprojection=orthographic(5,4,2); draw(unitcube,blue); label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt)); diff --git a/Master/texmf/doc/asymptote/examples/pseudosphere.asy b/Master/texmf/doc/asymptote/examples/pseudosphere.asy new file mode 100644 index 00000000000..a740381ef0e --- /dev/null +++ b/Master/texmf/doc/asymptote/examples/pseudosphere.asy @@ -0,0 +1,33 @@ +// Pseudosphere: +// x = a sin(u) cos(v); +// y = a sin(u) sin(v); +// z = a (ln(tg(u/2))+cos(u)); + +import three; +import solids; +import graph3; +import palette; + +triple pseudosphere(real x) { + return (sin(x),0,cos(x)+log(tan(x/2))); +} + +size(20cm,IgnoreAspect); +currentprojection=orthographic(160,40,100); +currentlight=(50,50,50); + +path3 G=graph(pseudosphere,0.5pi,0.965pi,10,Spline); + +revolution r=revolution(O,G,Z); + +draw(r,1,longitudinalpen=nullpen); +surface s=surface(r); +s.colors(palette(s.map(zpart),Gradient(cyan+white+opacity(0.9), + magenta+white+opacity(0.9)))); +draw(s); + +draw(r,6,backpen=linetype("10 10",10),longitudinalpen=nullpen); + +int n=10; +for(int i=0; i < n; ++i) + draw(rotate(i*360/n,O,Z)*G); diff --git a/Master/texmf/doc/asymptote/examples/ring.asy b/Master/texmf/doc/asymptote/examples/ring.asy index 6963d42d23f..5fec60d4c0b 100644 --- a/Master/texmf/doc/asymptote/examples/ring.asy +++ b/Master/texmf/doc/asymptote/examples/ring.asy @@ -1,5 +1,4 @@ size(0,100); -path unitcircle=E..N..W..S..cycle; path g=scale(2)*unitcircle; label("$a \le r \le b$"); radialshade(unitcircle^^g,yellow+evenodd,(0,0),1.0,yellow+brown,(0,0),2); diff --git a/Master/texmf/doc/asymptote/examples/splitpatch.asy b/Master/texmf/doc/asymptote/examples/splitpatch.asy index f1f5b6b98ba..2e9fae66431 100644 --- a/Master/texmf/doc/asymptote/examples/splitpatch.asy +++ b/Master/texmf/doc/asymptote/examples/splitpatch.asy @@ -2,6 +2,64 @@ import three; size(300); +// A structure to subdivide two intersecting patches about their intersection. +struct split +{ + surface[] S=sequence(new surface(int i) {return new surface;},1); + surface[] T=sequence(new surface(int i) {return new surface;},1); + + struct tree { + tree[] tree=new tree[2]; + } + // Default subdivision depth. + int n=20; + + // Subdivide p and q to depth n if they overlap. + void write(tree pt, tree qt, triple[][] p, triple[][] q, int depth=n) { + --depth; + triple[][][] Split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit; + triple[][][] P=Split(p); + triple[][][] Q=Split(q); + + for(int i=0; i < 2; ++i) { + triple[][] Pi=P[i]; + for(int j=0; j < 2; ++j) { + triple[][] Qj=Q[j]; + if(overlap(Pi,Qj)) { + if(!pt.tree.initialized(i)) + pt.tree[i]=new tree; + if(!qt.tree.initialized(j)) + qt.tree[j]=new tree; + if(depth > 0) + write(pt.tree[i],qt.tree[j],Pi,Qj,depth); + } + } + } + } + + // Output the subpatches of p from subdivision. + void read(surface[] S, tree t, triple[][] p, int depth=n) { + --depth; + triple[][][] Split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit; + triple[][][] P=Split(p); + + for(int i=0; i < 2; ++i) { + if(t.tree.initialized(i)) + read(S,t.tree[i],P[i],depth); + else { + S[0].push(patch(P[i])); + } + } + } + + void operator init(triple[][] p, triple[][] q, int depth=n) { + tree ptrunk,qtrunk; + write(ptrunk,qtrunk,p,q,depth); + read(T,ptrunk,p,depth); + read(S,qtrunk,q,depth); + } +} + currentprojection=orthographic(0,0,1); triple[][] A={ @@ -18,11 +76,12 @@ triple[][] B={ {(0.5,0,2),(0.5,1,2),(0.5,2,2),(0.5,3,2)} }; -split S=split(A,B,10); -//write(S.T.length); +split S=split(B,A); defaultrender.merge=true; -for(int i=0; i < S.T.length; ++i) - draw(surface(patch(S.T[i])),Pen(i)); -draw(surface(patch(B)),blue); +for(int i=0; i < S.S[0].s.length; ++i) + draw(surface(S.S[0].s[i]),Pen(i)); + +for(int i=0; i < S.T[0].s.length; ++i) + draw(surface(S.T[0].s[i]),Pen(i)); -- cgit v1.2.3