Square Bent Pipe

Example from the PscFunctions package

With the help of routines of the PscFunctions package one can get general parametric equations of the piecewise linear surfaces.
In the following example a parametric equation of the bent square pipe surface is generated. The frame of the surface composed from four closed rectangles located on the different planes. At first with the help of CPolyline  routine we obtain equations of  rectangles of the surface frame.

>    restart;
with(PscFunctions):
Tr1:=CPolyline([[3,1,0],[3,1,1],[3,-1,1],[3,-1,-1],[3,1,-1],[3,1,0]],[0,1,3,5,7,8]):
Tr2:=CPolyline([[1,1,0],[1,1,1],[-1,-1,1],[-1,-1,-1],[1,1,-1],[1,1,0]],[0,1,3,5,7,8]):
Tr3:=CPolyline([[1,3,0],[1,2,1],[-1,2,1],[-1,4,-1],[1,4,-1],[1,3,0]],[0,1,3,5,7,8]):
Tr4:=CPolyline([[1,3,3],[1,2,3],[-1,2,3],[-1,4,3],[1,4,3],[1,3,3]],[0,1,3,5,7,8]):
TrspAll:=plots[spacecurve]({[Tr1(t)],[Tr2(t)],[Tr3(t)],[Tr4(t)]},t=0..8,thickness=2,axes=BOXED,color=black,numpoints=200,orientation=[30,60],labels=["X","Y","Z"]):
plots[display](TrspAll);

[Maple Plot]

Equation of the ruled surface spanned the frame occupies only 5 lines. It is generated by the SPscRuled   routine.

>    rl7:=SPscRuled([[Tr1[1],Tr1[2],Tr1[3]],[Tr2[1],Tr2[2],Tr2[3]],[Tr3[1],Tr3[2],Tr3[3]],[Tr4[1],Tr4[2],Tr4[3]]],[[0,8],[0,8],[0,8],[0,8]],psc=true):
plot3d([rl7(u,v)],u=0..1,v=0..3,axes=BOXED,labels=["X","Y","Z"],scaling=CONSTRAINED,orientation=[40,70]);
print('x'=rl7[1](u,v));
print('y'=rl7[2](u,v));
print('z'=rl7[3](u,v));

[Maple Plot]

x = 3+(-2-1/2*abs(8*u-1)+1/2*abs(8*u-3)+1/2*abs(8*u-5)-1/2*abs(8*u-7))*(1/2+1/2*abs(v)-1/2*abs(v-1))

y = 1-1/2*abs(8*u-1)+1/2*abs(8*u-3)+1/2*abs(8*u-5)-1/2*abs(8*u-7)+(2-1/2*abs(8*u)+abs(8*u-1)-abs(8*u-5)+1/2*abs(8*u-8))*(1/2+1/2*abs(v-1)-1/2*abs(v-2))
y = 1-1/2*abs(8*u-1)+1/2*abs(8*u-3)+1/2*abs(8*u-5)-1/2*abs(8*u-7)+(2-1/2*abs(8*u)+abs(8*u-1)-abs(8*u-5)+1/2*abs(8*u-8))*(1/2+1/2*abs(v-1)-1/2*abs(v-2))

z = 1/2*abs(8*u)-1/2*abs(8*u-1)-1/2*abs(8*u-3)+1/2*abs(8*u-5)+1/2*abs(8*u-7)-1/2*abs(8*u-8)+(3-1/2*abs(8*u)+1/2*abs(8*u-1)+1/2*abs(8*u-3)-1/2*abs(8*u-5)-1/2*abs(8*u-7)+1/2*abs(8*u-8))*(1/2+1/2*abs(v-2)...
z = 1/2*abs(8*u)-1/2*abs(8*u-1)-1/2*abs(8*u-3)+1/2*abs(8*u-5)+1/2*abs(8*u-7)-1/2*abs(8*u-8)+(3-1/2*abs(8*u)+1/2*abs(8*u-1)+1/2*abs(8*u-3)-1/2*abs(8*u-5)-1/2*abs(8*u-7)+1/2*abs(8*u-8))*(1/2+1/2*abs(v-2)...