summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/three.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/base/three.asy')
-rw-r--r--Build/source/utils/asymptote/base/three.asy27
1 files changed, 22 insertions, 5 deletions
diff --git a/Build/source/utils/asymptote/base/three.asy b/Build/source/utils/asymptote/base/three.asy
index cc7534f6f79..5b3dd26aba7 100644
--- a/Build/source/utils/asymptote/base/three.asy
+++ b/Build/source/utils/asymptote/base/three.asy
@@ -2610,12 +2610,10 @@ struct scene
if(!P.absolute) {
this.P=t*P;
- if(this.P.center) {
- bool recalculate=false;
+ if(this.P.center && settings.render != 0) {
triple target=0.5*(m+M);
this.P.target=target;
- recalculate=true;
- if(recalculate) this.P.calculate();
+ this.P.calculate();
}
if(this.P.autoadjust || this.P.infinity)
adjusted=adjusted | this.P.adjust(m,M);
@@ -2754,7 +2752,7 @@ object embed(string label="", string text=label, string prefix=defaultfilename,
P=S.T*P;
}
if(settings.verbose > 0) {
- if(P.center || (!P.infinity && P.autoadjust))
+ if((P.center && settings.render != 0) || (!P.infinity && P.autoadjust))
write("adjusting target to ",tinv*target);
}
}
@@ -3091,6 +3089,25 @@ fit=new frame[](string prefix="", picture[] pictures, string format="",
fit3(prefix,pictures,all,format,view,options,script,P);
};
+// Add frame src to picture dest about position.
+void add(picture dest=currentpicture, frame src, triple position)
+{
+ if(is3D(src)) {
+ dest.add(new void(frame f, transform3 t, picture, projection) {
+ add(f,shift(t*position)*src);
+ },true);
+ } else {
+ dest.add(new void(frame, transform3 t, picture pic, projection P) {
+ if(pic != null) {
+ pic.add(new void(frame f, transform T) {
+ add(f,T*shift(project(t*position,P))*src);
+ },true);
+ }
+ },true);
+ }
+ dest.addBox(position,position,min3(src),max3(src));
+}
+
exitfcn currentexitfunction=atexit();
void exitfunction()