diff options
author | Karl Berry <karl@freefriends.org> | 2011-05-28 02:18:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-05-28 02:18:52 +0000 |
commit | c59fe5fe4739f0c61560f05d4e42b4e552219b27 (patch) | |
tree | 8cf79e85e394b3177a28d374415840a4e0a025ad /Build/source/utils/asymptote/base/three.asy | |
parent | 771db15706dbf3f4af8b630dcb15646a3e5fda00 (diff) |
asy 2.10
git-svn-id: svn://tug.org/texlive/trunk@22633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/base/three.asy')
-rw-r--r-- | Build/source/utils/asymptote/base/three.asy | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Build/source/utils/asymptote/base/three.asy b/Build/source/utils/asymptote/base/three.asy index 4221646f632..033461263eb 100644 --- a/Build/source/utils/asymptote/base/three.asy +++ b/Build/source/utils/asymptote/base/three.asy @@ -28,9 +28,11 @@ struct render bool closed; // use one-sided rendering? bool tessellate; // use tessellated mesh to store straight patches? - bool3 merge; // merge nodes before rendering, for lower quality - // but faster PRC rendering? - // (default=merge only transparent patches) + + bool3 merge; // merge nodes before rendering, for faster but + // lower quality PRC rendering (the value default means + // merge opaque patches only). + int sphere; // PRC sphere type (PRCsphere or NURBSsphere). // General parameters: @@ -2408,7 +2410,8 @@ triple point(frame f, triple dir) triple point(picture pic=currentpicture, triple dir, bool user=true, projection P=currentprojection) { - triple v=pic.userMin+realmult(rectify(dir),pic.userMax-pic.userMin); + triple min = pic.userMin(), max = pic.userMax(); + triple v=min+realmult(rectify(dir),max-min); return user ? v : pic.calculateTransform3(P)*v; } @@ -2509,8 +2512,6 @@ private string format(triple v, string sep=" ") return string(v.x)+sep+string(v.y)+sep+string(v.z); } -private string[] file3; - private string projection(bool infinity, real viewplanesize) { return "activeCamera=scene.cameras.getByIndex(0); @@ -2696,9 +2697,8 @@ string embed3D(string label="", string text=label, string prefix, writeJavaScript(name,lightscript+projection(P.infinity,viewplanesize)+ billboard(index,center),script); - prefix += ".prc"; if(!settings.inlinetex) - file3.push(prefix); + file3.push(prefix+".prc"); triple target=P.target; if(P.viewportshift != 0) { @@ -2730,9 +2730,11 @@ string embed3D(string label="", string text=label, string prefix, ",3Droo="+Format(abs(v))+ ",3Dbg="+Format(light.background()); if(options != "") options3 += ","+options; - if(name != "") options3 += ",3Djscript="+stripdirectory(name); + if(settings.inlinetex) + prefix=jobname(prefix); + options3 += ",3Djscript="+prefix+".js"; - return Embed(stripdirectory(prefix),options3,width,height); + return Embed(prefix+".prc",options3,width,height); } struct scene @@ -2983,7 +2985,7 @@ object embed(string label="", string text=label, string prefix=defaultfilename, } string image; - if(preview && settings.embed) { + if((preview || (prc && settings.render == 0)) && settings.embed) { image=prefix; if(settings.inlinetex) image += "_0"; image += "."+nativeformat(); |