diff options
Diffstat (limited to 'Build/source/utils/asymptote/base/three.asy')
-rw-r--r-- | Build/source/utils/asymptote/base/three.asy | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/Build/source/utils/asymptote/base/three.asy b/Build/source/utils/asymptote/base/three.asy index b0d9c456faa..2de8b4a5cca 100644 --- a/Build/source/utils/asymptote/base/three.asy +++ b/Build/source/utils/asymptote/base/three.asy @@ -36,6 +36,7 @@ struct render // General parameters: real margin; // shrink amount for rendered openGL viewport, in bp. real tubegranularity; // granularity for rendering tubes + bool labelfill; // fill subdivision cracks in unlighted labels static render defaultrender; @@ -46,7 +47,8 @@ struct render bool3 merge=defaultrender.merge, int sphere=defaultrender.sphere, real margin=defaultrender.margin, - real tubegranularity=defaultrender.tubegranularity) + real tubegranularity=defaultrender.tubegranularity, + bool labelfill=defaultrender.labelfill) { this.compression=compression; this.granularity=granularity; @@ -56,6 +58,7 @@ struct render this.sphere=sphere; this.margin=margin; this.tubegranularity=tubegranularity; + this.labelfill=labelfill; } } @@ -70,6 +73,7 @@ defaultrender.merge=false; defaultrender.margin=0.02; defaultrender.tubegranularity=0.005; defaultrender.sphere=NURBSsphere; +defaultrender.labelfill=true; real defaultshininess=0.25; @@ -2127,8 +2131,7 @@ pair max(frame f, projection P) void draw(picture pic=currentpicture, Label L="", path3 g, align align=NoAlign, material p=currentpen, margin3 margin=NoMargin3, - light light=nolight, string name="", - render render=defaultrender) + light light=nolight, string name="", render render=defaultrender) { pen q=(pen) p; pic.add(new void(frame f, transform3 t, picture pic, projection P) { @@ -2167,13 +2170,13 @@ draw=new void(frame f, path3 g, material p=currentpen, void cylinder(transform3) {}; void sphere(transform3, bool half) {}; void disk(transform3) {}; - void tube(path3, path3); + void pipe(path3, path3); if(prc) { cylinder=new void(transform3 t) {drawPRCcylinder(f,t,p,light);}; sphere=new void(transform3 t, bool half) {drawPRCsphere(f,t,half,p,light,render);}; - disk=new void(transform3 t) {draw(f,t*unitdisk,p,light);}; - tube=new void(path3 center, path3 g) + disk=new void(transform3 t) {draw(f,t*unitdisk,p,light,render);}; + pipe=new void(path3 center, path3 g) {drawPRCtube(f,center,g,p,light);}; } real linecap; @@ -2193,7 +2196,7 @@ draw=new void(frame f, path3 g, material p=currentpen, L += 2; } } - tube T=tube(g,width,render,cylinder,sphere,tube); + tube T=tube(g,width,render,cylinder,sphere,pipe); path3 c=T.center; if(L >= 0) { if(open) { @@ -2300,10 +2303,11 @@ void draw(picture pic=currentpicture, Label L="", path3 g, begingroup3(pic,name,render); bool drawpath=arrow(pic,g,p,margin,light,arrowheadlight); if(bar(pic,g,p,margin,light,arrowheadlight) && drawpath) - draw(pic,L,g,align,p,margin,light); + draw(pic,L,g,align,p,margin,light,render); if(group) endgroup3(pic); - label(pic,L,g,align,(pen) p); + if(L.s != "") + label(pic,L,g,align,(pen) p); } void draw(frame f, path3 g, material p=currentpen, arrowbar3 arrow, @@ -2316,7 +2320,7 @@ void draw(frame f, path3 g, material p=currentpen, arrowbar3 arrow, if(group) begingroup3(f,name,render); if(arrow(pic,g,p,NoMargin3,light,arrowheadlight)) - draw(f,g,p,light,P); + draw(f,g,p,light,render,P); add(f,pic.fit()); if(group) endgroup3(f); @@ -2349,7 +2353,8 @@ void add(picture src, triple position, bool group=true, bool above=true) void arrow(picture pic=currentpicture, Label L="", triple b, triple dir, real length=arrowlength, align align=NoAlign, pen p=currentpen, arrowbar3 arrow=Arrow3, margin3 margin=EndMargin3, - light light=nolight, light arrowheadlight=currentlight) + light light=nolight, light arrowheadlight=currentlight, + string name="", render render=defaultrender) { Label L=L.copy(); if(L.defaultposition) L.position(0); @@ -2358,7 +2363,7 @@ void arrow(picture pic=currentpicture, Label L="", triple b, triple dir, picture opic; marginT3 margin=margin(b--b,p); // Extract margin.begin and margin.end triple a=(margin.begin+length+margin.end)*unit(dir); - draw(opic,L,a--O,align,p,arrow,margin,light,arrowheadlight); + draw(opic,L,a--O,align,p,arrow,margin,light,arrowheadlight,name,render); add(pic,opic,b); } @@ -2366,10 +2371,11 @@ void arrow(picture pic=currentpicture, Label L="", triple b, pair dir, real length=arrowlength, align align=NoAlign, pen p=currentpen, arrowbar3 arrow=Arrow3, margin3 margin=EndMargin3, light light=nolight, light arrowheadlight=currentlight, + string name="", render render=defaultrender, projection P=currentprojection) { arrow(pic,L,b,invert(dir,b,P),length,align,p,arrow,margin,light, - arrowheadlight); + arrowheadlight,name,render); } triple min3(picture pic, projection P=currentprojection) |