summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/three_surface.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/three_surface.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/three_surface.asy')
-rw-r--r--Build/source/utils/asymptote/base/three_surface.asy14
1 files changed, 10 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/base/three_surface.asy b/Build/source/utils/asymptote/base/three_surface.asy
index f1303d2e973..55060cb516d 100644
--- a/Build/source/utils/asymptote/base/three_surface.asy
+++ b/Build/source/utils/asymptote/base/three_surface.asy
@@ -892,21 +892,27 @@ real[][] intersections(path3 p, surface s, real fuzz=-1)
for(real[] s: intersections(p,s.s[i].P,fuzz))
T.push(s);
- sort(T);
-
static real fuzzFactor=10.0;
static real Fuzz=1000.0*realEpsilon;
real fuzz=max(fuzzFactor*fuzz,Fuzz)*abs(max(s)-min(s));
// Remove intrapatch duplicate points.
for(int i=0; i < T.length; ++i) {
+ triple v=point(p,T[i][0]);
for(int j=i+1; j < T.length;) {
- if(abs(point(p,i)-point(p,j)) < fuzz)
+ if(abs(v-point(p,T[j][0])) < fuzz)
T.delete(j);
else ++j;
}
}
- return T;
+ return sort(T);
+}
+
+// return an array containing all intersection points of path p and surface s.
+triple[] intersectionpoints(path3 p, patch s, real fuzz=-1)
+{
+ real[][] t=intersections(p,s,fuzz);
+ return sequence(new triple(int i) {return point(p,t[i][0]);},t.length);
}
// return an array containing all intersection points of path p and surface s.