summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote
diff options
context:
space:
mode:
authorMojca Miklavec <mojca.miklavec@gmail.com>2014-05-17 18:38:56 +0000
committerMojca Miklavec <mojca.miklavec@gmail.com>2014-05-17 18:38:56 +0000
commiteee5aedecc1c0c3f484016a2b73f29a6f4cb9cb7 (patch)
treeca2673ba2b18b70ed6c32fda317dd108afd7c172 /Master/texmf-dist/asymptote
parent237141a8094c14ab28177177c991d14c5041c116 (diff)
asymptote 2.31
git-svn-id: svn://tug.org/texlive/trunk@34082 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote')
-rw-r--r--Master/texmf-dist/asymptote/bezulate.asy3
-rw-r--r--Master/texmf-dist/asymptote/embed.asy18
-rw-r--r--Master/texmf-dist/asymptote/math.asy2
-rw-r--r--Master/texmf-dist/asymptote/three.asy5
-rw-r--r--Master/texmf-dist/asymptote/three_surface.asy34
5 files changed, 30 insertions, 32 deletions
diff --git a/Master/texmf-dist/asymptote/bezulate.asy b/Master/texmf-dist/asymptote/bezulate.asy
index a0f6689b504..60be8cb7045 100644
--- a/Master/texmf-dist/asymptote/bezulate.asy
+++ b/Master/texmf-dist/asymptote/bezulate.asy
@@ -2,6 +2,7 @@
private real fuzz=sqrtEpsilon;
real duplicateFuzz=1e-3; // Work around font errors.
+real maxrefinements=7;
private real[][] intersections(pair a, pair b, path p)
{
@@ -291,7 +292,7 @@ path[] bezulate(path[] p)
if(!found && k == SIZE_STEPS && length(p) > 4 && i == length(p)-1) {
// avoid infinite recursion
++refinements;
- if(refinements > mantissaBits) {
+ if(refinements > maxrefinements) {
warning("subdivisions","too many subdivisions",position=true);
} else {
p=subdivide(p);
diff --git a/Master/texmf-dist/asymptote/embed.asy b/Master/texmf-dist/asymptote/embed.asy
index ad2b710c36b..588ad79c283 100644
--- a/Master/texmf-dist/asymptote/embed.asy
+++ b/Master/texmf-dist/asymptote/embed.asy
@@ -1,12 +1,12 @@
-if(latex() && !settings.inlineimage) {
+if(latex()) {
usepackage("hyperref");
texpreamble("\hypersetup{"+settings.hyperrefOptions+"}");
usepackage("media9","bigfiles");
- texpreamble("\makeatletter%
-\newif\ifnoplaybutton
-\@ifpackagelater{media9}{2013/11/15}{%
-\noplaybuttontrue}{}%
-\makeatother%");
+ texpreamble("\newif\ifplaybutton");
+ texpreamble("\count255=\the\catcode`\@\makeatletter%
+\@ifpackagelater{media9}{2013/11/15}{}{\playbuttontrue}%
+\catcode`\@=\the\count255
+%");
}
// For documentation of the options see
@@ -19,10 +19,10 @@ string embedplayer(string name, string text="", string options="",
if(width != 0) options += ",width="+(string) (width/pt)+"pt";
if(height != 0) options += ",height="+(string) (height/pt)+"pt";
return "%
-\ifnoplaybutton%
-\includemedia[noplaybutton,"+options+"]{"+text+"}{"+name+"}%
-\else%
+\ifplaybutton%
\includemedia["+options+"]{"+text+"}{"+name+"}%
+\else%
+\includemedia[noplaybutton,"+options+"]{"+text+"}{"+name+"}%
\fi";
}
diff --git a/Master/texmf-dist/asymptote/math.asy b/Master/texmf-dist/asymptote/math.asy
index 69863634210..47044a75df1 100644
--- a/Master/texmf-dist/asymptote/math.asy
+++ b/Master/texmf-dist/asymptote/math.asy
@@ -175,7 +175,7 @@ int[][] segment(bool[] b)
int[][] S=segmentlimits(b);
return sequence(new int[](int i) {
return sequence(S[i][0],S[i][1]);
- },S[0].length);
+ },S.length);
}
// If the sorted array a does not contain x, insert it sequentially,
diff --git a/Master/texmf-dist/asymptote/three.asy b/Master/texmf-dist/asymptote/three.asy
index 1c3716173d3..210ed55ddfe 100644
--- a/Master/texmf-dist/asymptote/three.asy
+++ b/Master/texmf-dist/asymptote/three.asy
@@ -3,7 +3,7 @@ private import math;
if(inXasyMode) settings.render=0;
if(prc0()) {
- if(settings.tex == "context") settings.prc=false;
+ if(!latex()) settings.prc=false;
else {
access embed;
Embed=embed.embedplayer;
@@ -1611,8 +1611,7 @@ transform transform(triple u, triple v, triple O=O,
projection P=currentprojection)
{
transform3 t=P.t;
- static real[] O={0,0,0,1};
- real[] tO=t*O;
+ real[] tO=t*new real[] {O.x,O.y,O.z,1};
real tO3=tO[3];
real factor=1/tO3^2;
real[] x=(tO3*t[0]-tO[0]*t[3])*factor;
diff --git a/Master/texmf-dist/asymptote/three_surface.asy b/Master/texmf-dist/asymptote/three_surface.asy
index fc09ac798d9..bf070e2a4a9 100644
--- a/Master/texmf-dist/asymptote/three_surface.asy
+++ b/Master/texmf-dist/asymptote/three_surface.asy
@@ -954,7 +954,7 @@ private triple[] split(triple z0, triple c0, triple c1, triple z1, real t=0.5)
// Return the control points of the subpatches
// produced by a horizontal split of P
-triple[][][] hsplit(triple[][] P)
+triple[][][] hsplit(triple[][] P, real v=0.5)
{
// get control points in rows
triple[] P0=P[0];
@@ -962,10 +962,10 @@ triple[][][] hsplit(triple[][] P)
triple[] P2=P[2];
triple[] P3=P[3];
- triple[] c0=split(P0[0],P0[1],P0[2],P0[3]);
- triple[] c1=split(P1[0],P1[1],P1[2],P1[3]);
- triple[] c2=split(P2[0],P2[1],P2[2],P2[3]);
- triple[] c3=split(P3[0],P3[1],P3[2],P3[3]);
+ triple[] c0=split(P0[0],P0[1],P0[2],P0[3],v);
+ triple[] c1=split(P1[0],P1[1],P1[2],P1[3],v);
+ triple[] c2=split(P2[0],P2[1],P2[2],P2[3],v);
+ triple[] c3=split(P3[0],P3[1],P3[2],P3[3],v);
// bottom, top
return new triple[][][] {
{{P0[0],c0[0],c0[1],c0[2]},
@@ -981,7 +981,7 @@ triple[][][] hsplit(triple[][] P)
// Return the control points of the subpatches
// produced by a vertical split of P
-triple[][][] vsplit(triple[][] P)
+triple[][][] vsplit(triple[][] P, real u=0.5)
{
// get control points in rows
triple[] P0=P[0];
@@ -989,10 +989,10 @@ triple[][][] vsplit(triple[][] P)
triple[] P2=P[2];
triple[] P3=P[3];
- triple[] c0=split(P0[0],P1[0],P2[0],P3[0]);
- triple[] c1=split(P0[1],P1[1],P2[1],P3[1]);
- triple[] c2=split(P0[2],P1[2],P2[2],P3[2]);
- triple[] c3=split(P0[3],P1[3],P2[3],P3[3]);
+ triple[] c0=split(P0[0],P1[0],P2[0],P3[0],u);
+ triple[] c1=split(P0[1],P1[1],P2[1],P3[1],u);
+ triple[] c2=split(P0[2],P1[2],P2[2],P3[2],u);
+ triple[] c3=split(P0[3],P1[3],P2[3],P3[3],u);
// left, right
return new triple[][][] {
{{P0[0],P0[1],P0[2],P0[3]},
@@ -1008,7 +1008,7 @@ triple[][][] vsplit(triple[][] P)
// Return a 2D array of the control point arrays of the subpatches
// produced by horizontal and vertical splits of P at u and v
-triple[][][][] split(triple[][] P, real u=1/2, real v=1/2)
+triple[][][][] split(triple[][] P, real u=0.5, real v=0.5)
{
triple[] P0=P[0];
triple[] P1=P[1];
@@ -1160,15 +1160,13 @@ triple[] intersectionpoints(path3 p, surface s, real fuzz=-1)
return sequence(new triple(int i) {return point(p,t[i][0]);},t.length);
}
-// Return true iff the bounding boxes of patch p and q overlap.
+// Return true iff the control point bounding boxes of patches p and q overlap.
bool overlap(triple[][] p, triple[][] q, real fuzz=-1)
{
- triple p0=p[0][0];
- triple q0=q[0][0];
- triple pmin=minbezier(p,p0);
- triple pmax=maxbezier(p,p0);
- triple qmin=minbezier(q,q0);
- triple qmax=maxbezier(q,q0);
+ triple pmin=minbound(p);
+ triple pmax=maxbound(p);
+ triple qmin=minbound(q);
+ triple qmax=maxbound(q);
static real Fuzz=1000*realEpsilon;
real fuzz=max(10*fuzz,Fuzz*max(abs(pmin),abs(pmax)));