summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/bezulate.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-03 23:38:09 +0000
committerKarl Berry <karl@freefriends.org>2009-06-03 23:38:09 +0000
commit62e3ddd373e2bd1e5adbc7e45af95ba7150c03e6 (patch)
treebe497aba8d1c52ad428bf5649c53abb9fa59f8ff /Build/source/utils/asymptote/base/bezulate.asy
parent37f7f3460f7d20564974e440e873a84ca4570529 (diff)
asymptote 1.75
git-svn-id: svn://tug.org/texlive/trunk@13620 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/base/bezulate.asy')
-rw-r--r--Build/source/utils/asymptote/base/bezulate.asy13
1 files changed, 8 insertions, 5 deletions
diff --git a/Build/source/utils/asymptote/base/bezulate.asy b/Build/source/utils/asymptote/base/bezulate.asy
index 2710996b322..01b3024f7b6 100644
--- a/Build/source/utils/asymptote/base/bezulate.asy
+++ b/Build/source/utils/asymptote/base/bezulate.asy
@@ -1,6 +1,6 @@
// Bezier triangulation routines written by Orest Shardt, 2008.
-private real fuzz=sqrtEpsilon;
+private real fuzz=1e-6;
real duplicateFuzz=1e-3; // Work around font errors.
int countIntersections(path[] p, pair start, pair end)
@@ -95,19 +95,22 @@ void connect(path[] paths, path[] result, path[] patch)
real d=2*abs(max(outer)-min(outer));
while(inners.length > 0) {
int curveIndex = 0;
- real starttime = 0; // starttime is time on inners[curveIndex]
- pair direction=I*dir(inners[curveIndex],starttime);
- pair start=point(inners[curveIndex],starttime);
+ pair direction=I*dir(inners[curveIndex],0,1); // Use outgoing direction
+ if(direction == 0) // Try a random direction
+ direction=expi(2pi*unitrand());
+ pair start=point(inners[curveIndex],0);
// find first intersection of line segment with outer curve
path line = start--start+d*direction;
real[][] ints=intersections(line,outer,fuzz);
- real endtime=ints.length > 0 ? ints[0][1] : 0; // endtime is time on outer
+ assert(ints.length != 0);
+ real endtime=ints[0][1]; // endtime is time on outer
pair end = point(outer,endtime);
line = start--end;
path rline = reverse(line);
// find first intersection of rline segment with any inner curve
+ real starttime=0; // starttime is time on inners[curveIndex]
real earliestTime=1;
for(int j=0; j < inners.length; ++j) {
real[][] ints=intersections(rline,inners[j],fuzz);