# Transform Multiple Asymptote Surfaces Simultaneously?

Is there a way with asymptote to combine two surfaces, so so that I can transform both simultaneously? E.g., below I would like to say surface r = cp+cm;, then do r=rotate(45,Y)*r; instead of separately rotating both surfaces.

% To run: pdflatex --shell-escape filename.tex
\documentclass{standalone}
\usepackage{asypictureB}

\begin{document}
\begin{asypicture}{name=RotateTwo}
settings.outformat="png";
settings.prc=false;
settings.render=10;

import three;
//Setup View
size(200);
currentprojection=orthographic(1,-3,2);

//Draw Axes
pen thickblack = black+0.75;
real axislength = 2.0;
draw(L=Label("$x$", position=Relative(1.1), align=SW), -axislength*X--axislength*X,thickblack, Arrow3);
draw(L=Label("$y$", position=Relative(1.1), align=E), -axislength*Y--axislength*Y,thickblack, Arrow3);
draw(L=Label("$z$", position=Relative(1.1), align=N), -2*axislength*Z--2*axislength*Z,thickblack, Arrow3);

//Define cube surfaces
surface c1 = shift(-0.5X-0.5Y-0.5Z)*unitcube;
c1 = zscale3(0.1)*c1;
surface cm = shift(-0.25Z)*c1;
surface cp = shift(+0.25Z)*c1;
surface rm = rotate(45,Y)*cm;
surface rp = rotate(45,Y)*cp;
//I'd like to just do rotate(45,Y)*(cp+cm)

//Draw cube surfaces
draw(rm,palegrey);
draw(rp,palegrey);
\end{asypicture}

\end{document}


## 1 Answer

The surface structure allows to concatenate surfaces, surface(s1,s2,s3,...). In your case

surface ccp=rotate(45,Y)*surface(cm,cp);


O.G.

• "You can try" doesn't convince me that you know it works. Do you think you could test it on the code provided by the OP, and if it works, include the working version as a complete example?
– yo'
Nov 23 '14 at 21:50
• OK. I changed my message. I tested, I read some pieces of three_surface.asy and it works.
– O.G.
Nov 23 '14 at 21:59