diff options
author | Karl Berry <karl@freefriends.org> | 2009-07-03 00:02:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-07-03 00:02:22 +0000 |
commit | c20b61928150008d080bab09e967fcaebc93da81 (patch) | |
tree | bffa7c8765003c0e8f2a40c72479e5caa6f748bd /Build/source/utils/asymptote/base/three_surface.asy | |
parent | 9ec802a431dfe1b27063bac2f8dd9bc58cf997b0 (diff) |
asy 1.79
git-svn-id: svn://tug.org/texlive/trunk@14078 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.asy | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Build/source/utils/asymptote/base/three_surface.asy b/Build/source/utils/asymptote/base/three_surface.asy index 597104ad202..2f5d80aacbe 100644 --- a/Build/source/utils/asymptote/base/three_surface.asy +++ b/Build/source/utils/asymptote/base/three_surface.asy @@ -731,14 +731,22 @@ struct surface { for(int i=0; i < L; ++i) { path3 h=subpath(g,i,i+1); path3 r=reverse(h); - triple max=max(h); - triple min=min(h); - triple perp=perp(max-c,axis); - real fuzz=epsilon*max(abs(max),abs(min)); - if(abs(perp) < fuzz) - perp=perp(min-c,axis); + path3 H=shift(-c)*h; + real M=0; + triple perp; + void test(real[] t) { + for(int i=0; i < 3; ++i) { + triple v=point(H,t[i]); + triple V=v-dot(v,axis)*axis; + real a=abs(V); + if(a > M) {M=a; perp=V;} + } + } + test(maxtimes(H)); + test(mintimes(H)); + perp=unit(perp); - triple normal=cross(axis,perp); + triple normal=unit(cross(axis,perp)); triple dir(real j) {return Cos(j)*normal-Sin(j)*perp;} real j=angle1; transform3 Tk=T[0]; |