summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/three_surface.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-05-11 22:12:25 +0000
committerKarl Berry <karl@freefriends.org>2015-05-11 22:12:25 +0000
commit0417a4fa56359c545358f5fb8c9b3f88a1845db2 (patch)
treeed331ec191a82fe896f05005dee844269e406281 /Build/source/utils/asymptote/base/three_surface.asy
parente7256bd4adc1d8df03ed8434e3f9cc15817b6f22 (diff)
asy 2.33 sources
git-svn-id: svn://tug.org/texlive/trunk@37343 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.asy29
1 files changed, 22 insertions, 7 deletions
diff --git a/Build/source/utils/asymptote/base/three_surface.asy b/Build/source/utils/asymptote/base/three_surface.asy
index bf070e2a4a9..faf56b546f4 100644
--- a/Build/source/utils/asymptote/base/three_surface.asy
+++ b/Build/source/utils/asymptote/base/three_surface.asy
@@ -1115,6 +1115,21 @@ patch subpatch(patch s, pair a, pair b)
return patch(subpatch(s.P,a,b),s.straight,s.planar);
}
+// return an array containing an intersection times of path p and surface s.
+real[] intersect(path3 p, patch s, real fuzz=-1)
+{
+ return intersect(p,s.P,fuzz);
+}
+
+// return an array containing an intersection times of path p and surface s.
+real[] intersect(path3 p, surface s, real fuzz=-1)
+{
+ for(int i=0; i < s.s.length; ++i) {
+ real[] T=intersect(p,s.s[i].P,fuzz);
+ if(T.length > 0) return T;
+ }
+ return new real[];
+}
// return an array containing all intersection times of path p and patch s.
real[][] intersections(path3 p, patch s, real fuzz=-1)
@@ -1168,8 +1183,8 @@ bool overlap(triple[][] p, triple[][] q, real fuzz=-1)
triple qmin=minbound(q);
triple qmax=maxbound(q);
- static real Fuzz=1000*realEpsilon;
- real fuzz=max(10*fuzz,Fuzz*max(abs(pmin),abs(pmax)));
+ if(fuzz == -1)
+ fuzz=1000*realEpsilon*max(abs(pmin),abs(pmax),abs(qmin),abs(qmax));
return
pmax.x+fuzz >= qmin.x &&
@@ -1363,7 +1378,7 @@ nullpens.cyclic=true;
void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
material[] surfacepen, pen[] meshpen=nullpens,
- light light=currentlight, light meshlight=light, string name="",
+ light light=currentlight, light meshlight=nolight, string name="",
render render=defaultrender, projection P=currentprojection)
{
bool is3D=is3D();
@@ -1450,7 +1465,7 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
material surfacepen=currentpen, pen meshpen=nullpen,
- light light=currentlight, light meshlight=light, string name="",
+ light light=currentlight, light meshlight=nolight, string name="",
render render=defaultrender, projection P=currentprojection)
{
material[] surfacepen={surfacepen};
@@ -1462,7 +1477,7 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
material[] surfacepen, pen[] meshpen=nullpens,
- light light=currentlight, light meshlight=light, string name="",
+ light light=currentlight, light meshlight=nolight, string name="",
render render=defaultrender)
{
if(s.empty()) return;
@@ -1507,7 +1522,7 @@ void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
material surfacepen=currentpen, pen meshpen=nullpen,
- light light=currentlight, light meshlight=light, string name="",
+ light light=currentlight, light meshlight=nolight, string name="",
render render=defaultrender)
{
material[] surfacepen={surfacepen};
@@ -1519,7 +1534,7 @@ void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
material[] surfacepen, pen meshpen,
- light light=currentlight, light meshlight=light, string name="",
+ light light=currentlight, light meshlight=nolight, string name="",
render render=defaultrender)
{
pen[] meshpen={meshpen};