summaryrefslogtreecommitdiff
path: root/graphics/asymptote/base/graph3.asy
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-28 03:01:23 +0000
committerNorbert Preining <norbert@preining.info>2024-02-28 03:01:23 +0000
commit0afdc3e8c2d8e96d0cd0a5f05f1481a4eecc51d2 (patch)
tree805f2acf8e0115574bc5781d1dfb87fbe2e63ba8 /graphics/asymptote/base/graph3.asy
parenta64a01e8eaa2c096e7879421f075ebfa2a8bb7f0 (diff)
CTAN sync 202402280301
Diffstat (limited to 'graphics/asymptote/base/graph3.asy')
-rw-r--r--graphics/asymptote/base/graph3.asy21
1 files changed, 21 insertions, 0 deletions
diff --git a/graphics/asymptote/base/graph3.asy b/graphics/asymptote/base/graph3.asy
index f17b4e9707..b9b872f451 100644
--- a/graphics/asymptote/base/graph3.asy
+++ b/graphics/asymptote/base/graph3.asy
@@ -1880,6 +1880,27 @@ surface surface(picture pic=currentpicture, real[][] f, real[] x, real[] y,
splinetype ysplinetype=xsplinetype,
bool[][] cond={})
{
+ if(xsplinetype == linear && ysplinetype == linear) {
+ int nx=f.length-1;
+ int ny=nx > 0 ? f[0].length-1 : 0;
+
+ if(nx == 0 || ny == 0) return nullsurface;
+
+ bool all=cond.length == 0;
+
+ triple[][] v=new triple[nx+1][ny+1];
+
+ for(int i=0; i <= nx; ++i) {
+ bool[] condi=all ? null : cond[i];
+ real xi=x[i];
+ real[] fi=f[i];
+ triple[] vi=v[i];
+ for(int j=0; j <= ny; ++j)
+ vi[j]=(xi,y[j],fi[j]);
+ }
+ return surface(pic,v,cond);
+ }
+
real[][] f=ScaleZ(pic,f);
real[] x=map(pic.scale.x.T,x);
real[] y=map(pic.scale.y.T,y);