# Changing the orientation of 3d mesh

Hello Everyone,
I have generated a T-shaped domain (3D) using “buildlayer” command for 2d domain (T).

Now, the 2d domain extended along z direction [ 0 to 1] which changes the orientation of 3d domain.

I wish to rotate the 3D domain such that the z-axis comes up for an inverted T-shaped domain.

Kindly suggest doing so.

=========================================

my code for generating the 3D T-domain is

`````` load "medit"

func mesh3 Tshape (int[int] &NN, real[int, int] &BB, int[int, int] &L){
real x0 = BB(0,0), x1 = BB(0,1);
real y0 = BB(1,0), y1 = BB(1,1);
real z0 = BB(2,0), z1 = BB(2,1);

int nx = NN[0], ny = NN[1], nz = NN[2];

// 2D mesh

int hot =1, cold=2, ins =3;
// aspect ratio, horizontally, 0.50
border b1(t = 0, 1){x = t; y = 0.; label = hot; }
border b2(t = 0, 0.5){x = 1.; y = t; label = ins; }
border b3(t = 1., 0.75){x = t; y = 0.5; label = cold;}
border b4(t = 0.5, 1.0){x = 0.75; y = t; label = cold;}
border b5(t = 0.75, 0.25){x = t; y = 1.0; label = ins;}
border b6(t = 1.0, 0.5){x = 0.25; y = t; label = cold;}
border b7(t = 0.25, 0.0){x = t; y = 0.5; label = cold;}
border b8(t = 0.5, 0.0){x = 0.0; y = t; label = ins;}

////////////////////////// domain descritizations
int n1, n2, n3, n4;
n1 = 10;  n2 = 4*n1; n3 = 2*n1; n4 = 3*n1;
mesh Thx = buildmesh( b1(n2) + b2(n3) + b3(n1) + b4(n3) + b5(n3) + b6(n3) + b7(n1) + b8(n3));
//plot(Thx, wait = 0);

//mesh Thx = square(nx, ny, [x0+(x1-x0)*x, y0+(y1-y0)*y]);

// 3D mesh
int[int] rup = [0, L(2,1)], rdown=[0, L(2,0)];
int[int] rmid=[1, L(1,0), 2, L(0,1), 3, L(1,1), 4, L(0,0)];
mesh3 Th = buildlayers(Thx, nz, zbound=[z0,z1],
labelmid=rmid, labelup = rup, labeldown = rdown);

return Th;
}

//include "Cube.idp"

int[int] NN = [15,15, 15]; //the number of step in each direction
real [int, int] BB = [[0,1],[0,1],[0,1]]; //the bounding box
int [int, int] L = [[1,2],[3,4],[5,6]]; //the label of the 6 face left,right, front, back, down, right
mesh3 Th = Tshape(NN, BB, L);
medit("Th", Th);

``````