summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/examples')
-rw-r--r--Build/source/utils/asymptote/examples/arrows3.asy2
-rw-r--r--Build/source/utils/asymptote/examples/basealign.asy1
-rw-r--r--Build/source/utils/asymptote/examples/billboard.asy2
-rw-r--r--Build/source/utils/asymptote/examples/mergeExample.asy77
-rw-r--r--Build/source/utils/asymptote/examples/partitionExample.asy27
-rw-r--r--Build/source/utils/asymptote/examples/quilt.asy44
-rw-r--r--Build/source/utils/asymptote/examples/workcone.asy8
-rw-r--r--Build/source/utils/asymptote/examples/xstitch.asy5
8 files changed, 160 insertions, 6 deletions
diff --git a/Build/source/utils/asymptote/examples/arrows3.asy b/Build/source/utils/asymptote/examples/arrows3.asy
index 12ad43463ee..57fc4b3d338 100644
--- a/Build/source/utils/asymptote/examples/arrows3.asy
+++ b/Build/source/utils/asymptote/examples/arrows3.asy
@@ -2,6 +2,8 @@ import three;
size(15cm);
+defaultrender.merge=true;
+
currentprojection=perspective(24,14,13);
currentlight=light(gray(0.5),specularfactor=3,viewport=false,
(0.5,-0.5,-0.25),(0.5,0.5,0.25),(0.5,0.5,1),(-0.5,-0.5,-1));
diff --git a/Build/source/utils/asymptote/examples/basealign.asy b/Build/source/utils/asymptote/examples/basealign.asy
index 4bf83c94033..d653ec3c043 100644
--- a/Build/source/utils/asymptote/examples/basealign.asy
+++ b/Build/source/utils/asymptote/examples/basealign.asy
@@ -2,6 +2,7 @@ import fontsize;
import three;
settings.autobillboard=false;
+settings.embed=false;
currentprojection=orthographic(Z);
defaultpen(fontsize(100pt));
diff --git a/Build/source/utils/asymptote/examples/billboard.asy b/Build/source/utils/asymptote/examples/billboard.asy
index e126c1c5157..6e5df871007 100644
--- a/Build/source/utils/asymptote/examples/billboard.asy
+++ b/Build/source/utils/asymptote/examples/billboard.asy
@@ -2,6 +2,8 @@ import three;
size(100);
+currentprojection=perspective(1,-2,1);
+
draw(unitbox);
label("Billboard",X,red,Billboard);
diff --git a/Build/source/utils/asymptote/examples/mergeExample.asy b/Build/source/utils/asymptote/examples/mergeExample.asy
new file mode 100644
index 00000000000..e0fdcd0f6c7
--- /dev/null
+++ b/Build/source/utils/asymptote/examples/mergeExample.asy
@@ -0,0 +1,77 @@
+size(16cm);
+import bezulate;
+
+pen edgepen=linewidth(1)+blue;
+pen dotpen=deepgreen;
+pen labelpen=fontsize(8pt);
+
+path outer = (0.5,5){E}..(5,-1){S}..{W}(4,-4)..{W}(2.5,-1.5){W}..(-0.3,-2.5){W}..(-3,0)..cycle;
+outer = subdivide(outer);
+path[] p = {outer,shift(-0.5,1.0)*rotate(-22)*scale(1.5,2.4)*subdivide(unitcircle),shift(2.3,0.3)*scale(0.7)*unitcircle};
+
+// a
+filldraw(p,lightgrey+evenodd);
+
+real w = 1.1*(max(p).x-min(p).x);
+
+// b
+p = shift(w)*p;
+draw(p);
+path l = point(p[1],2)--point(p[0],4);
+draw(l,red);
+for(int i = 0; i < p.length; ++i)
+{
+ real[][] ts = intersections(l,p[i]);
+ for(real[] t:ts)
+ dot(point(l,t[0]));
+}
+path l2 = point(l,intersections(l,p[0])[0][0])--point(l,intersections(l,p[2])[1][0]);
+real to = intersections(l,p[0])[0][1];
+real ti = intersections(l,p[2])[1][1];
+draw(l2,edgepen);
+label("$A$",point(l2,1),2E,labelpen);
+label("$B$",point(l2,0),1.5E,labelpen);
+
+// c
+p = shift(w)*p;
+l2 = shift(w)*l2;
+draw(p);
+real timeoffset=2;
+path t1=subpath(p[0],to,to+timeoffset);
+t1=t1--point(p[2],ti)--cycle;
+fill(t1,lightgrey);
+draw(point(p[2],ti)--point(p[0],to+4),red);
+dot(Label("$A$",labelpen),point(p[2],ti),2E,dotpen);
+dot(Label("$B$",labelpen),point(p[0],to),1.5E,dotpen);
+dot(Label("$C$",labelpen),point(p[0],to+timeoffset),1.5S,dotpen);
+draw(t1,edgepen);
+dot(point(p[0],to+4));
+draw(shift(-0.5,-0.5)*subpath(p[0],to+4,to+timeoffset+0.5),Arrow(4));
+
+// d
+p = shift(w)*p;
+p[0] = subpath(p[0],to+timeoffset,to+length(p[0]))--uncycle(p[2],ti)--cycle;
+p.delete(2);
+draw(p);
+
+// e
+p = shift(w)*p;
+path q=point(p[1],0)--subpath(p[0],15.4,16)--cycle;
+p[0] = subpath(p[0],16,15.4+length(p[0]))--uncycle(p[1],0)--cycle;
+p.delete(1);
+filldraw(p,lightgrey);
+
+// f
+p = shift(w)*p;
+filldraw(bezulate(p),lightgrey);
+filldraw(shift(3w)*t1,lightgrey);
+filldraw(shift(w)*q,lightgrey);
+
+
+real x = min(p).x - 4.5w;
+string l = "abcdef";
+for(int i = 0; i < 6; ++i)
+{
+ label("("+substr(l,i,1)+")",(x,min(p).y),3S,fontsize(10pt));
+ x += w;
+}
diff --git a/Build/source/utils/asymptote/examples/partitionExample.asy b/Build/source/utils/asymptote/examples/partitionExample.asy
new file mode 100644
index 00000000000..4974d99d9ca
--- /dev/null
+++ b/Build/source/utils/asymptote/examples/partitionExample.asy
@@ -0,0 +1,27 @@
+size(15cm);
+import bezulate;
+
+path[] p = texpath("$\sigma \Theta$");
+pair m = min(p);
+pair M = max(p);
+real midy = 0.5(M.y+m.y);
+
+path[] alpha = p[0:2];
+path[] theta = p[2:5];
+filldraw(p,lightgrey,black);
+
+draw("{\tt partition}",(M.x+1mm,midy)--(M.x+5mm,midy),Arrow);
+draw((M.x+1mm,midy+1mm)--(M.x+5mm,midy+2mm),Arrow);
+draw((M.x+1mm,midy-1mm)--(M.x+5mm,midy-2mm),Arrow);
+
+filldraw(shift((M.x+8.5mm,midy+3.5mm))*alpha,lightgrey,black);
+filldraw(shift((M.x+5.5mm,0))*theta[0:2],lightgrey,black);
+filldraw(shift(M.x+5.5mm,midy-2.5mm)*theta[2:3],lightgrey,black);
+
+draw("{\tt merge}, {\tt bezulate}",(M.x+9mm,midy+3mm)--(M.x+15mm,midy+3mm),Arrow);
+draw("{\tt merge}, {\tt bezulate}",(M.x+9mm,midy)--(M.x+15mm,midy),Arrow);
+draw("{\tt bezulate}",(M.x+9mm,midy-2.5mm)--(M.x+15mm,midy-2.5mm),Arrow);
+
+filldraw(shift(M.x+16mm-min(alpha).x,midy+3.5mm)*bezulate(alpha),lightgrey,black);
+filldraw(shift(M.x+16mm-min(theta[0:2]).x,0)*bezulate(theta[0:2]),lightgrey,black);
+filldraw(shift(M.x+16mm-min(theta[0:2]).x,midy-2.5mm)*bezulate(theta[2:3]),lightgrey,black);
diff --git a/Build/source/utils/asymptote/examples/quilt.asy b/Build/source/utils/asymptote/examples/quilt.asy
new file mode 100644
index 00000000000..7a84017762c
--- /dev/null
+++ b/Build/source/utils/asymptote/examples/quilt.asy
@@ -0,0 +1,44 @@
+import math;
+
+int n=8, skip=3;
+
+pair r(int k) { return unityroot(n,k); }
+
+pen col=blue, col2=purple;
+
+guide square=box((1,1),(-1,-1));
+
+guide step(int mult)
+{
+ guide g;
+ for(int k=0; k<n; ++k)
+ g=g--r(mult*k);
+ g=g--cycle;
+ return g;
+}
+
+guide oct=step(1), star=step(skip);
+
+guide wedge(pair z, pair v, real r, real a)
+{
+ pair w=expi(a/2.0);
+ v=unit(v)*r;
+ return shift(z)*((0,0)--v*w--v*conj(w)--cycle);
+}
+
+filldraw(square, col);
+filldraw(oct, yellow);
+
+// The interior angle of the points of the star.
+real intang=pi*(1-((real)2skip)/((real)n));
+
+for(int k=0; k<n; ++k) {
+ pair z=midpoint(r(k)--r(k+1));
+ guide g=wedge(z,-z,1,intang);
+ filldraw(g,col2);
+}
+
+fill(star,yellow);
+filldraw(star,evenodd+col);
+
+size(5inch,0);
diff --git a/Build/source/utils/asymptote/examples/workcone.asy b/Build/source/utils/asymptote/examples/workcone.asy
index 37efb5cc86b..5d102d86214 100644
--- a/Build/source/utils/asymptote/examples/workcone.asy
+++ b/Build/source/utils/asymptote/examples/workcone.asy
@@ -16,22 +16,22 @@ real x1=r*s1/h;
real s2=sr+0.2;
real x2=r*s2/h;
-//render render=render(compression=Low,merge=true);
+render render=render(compression=0,merge=true);
path3 p=(0,0,0)--(x,0,s);
revolution a=revolution(p,Z);
-draw(surface(a,4),lightblue+opacity(0.5));
+draw(surface(a,4),lightblue+opacity(0.5),render);
path3 q=(x,0,s)--(r,0,h);
revolution b=revolution(q,Z);
-draw(surface(b),white+opacity(0.5));
+draw(surface(b),white+opacity(0.5),render);
draw((-r-1,0,0)--(r+1,0,0));
draw((0,0,0)--(0,0,h+1),dashed);
path3 w=(x1,0,s1)--(x2,0,s2)--(0,0,s2);
revolution b=revolution(w,Z);
-draw(surface(b),blue+opacity(0.5));
+draw(surface(b),blue+opacity(0.5),render);
draw(circle((0,0,s2),x2));
draw(circle((0,0,s1),x1));
diff --git a/Build/source/utils/asymptote/examples/xstitch.asy b/Build/source/utils/asymptote/examples/xstitch.asy
index 6e692643ae1..5f332881733 100644
--- a/Build/source/utils/asymptote/examples/xstitch.asy
+++ b/Build/source/utils/asymptote/examples/xstitch.asy
@@ -155,11 +155,12 @@ void drawSection(int xmin, int xmax, int ymin, int ymax) {
write("stitch count: ",stitchCount);
- shipout("xstitch"+string(shipoutNumber),pic);
+ // shipout("xstitch"+string(shipoutNumber),pic);
+ shipout(pic);
++shipoutNumber;
}
-drawSection(-1,width+1,-1,height+1);
+//drawSection(-1,width+1,-1,height+1);
//drawSection(-1,80,height-80,height+1);