Curvilinear Pipe

Example from the PscFunctions package

With the help of routines of the PscFunctions package one can get general parametric equation of the  surfaces formed by cubic splines spanned the curves of the given frame.  
In the following example parametric equation of the surface of the curvilinear square pipe is generated. The frame composed from four closed rectangles located on the different planes. At first with the help of CPolyline  routine we create equations of the rectangles of the 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]):
Trsp:=plots[spacecurve]({[Tr1(t)],[Tr2(t)],[Tr3(t)],[Tr4(t)]},t=0..8,thickness=3,axes=BOXED,color=black,numpoints=200,orientation=[30,60],labels=["X","Y","Z"]):
plots[display](Trsp);

[Maple Plot]

Now it is possible to generate equation of the surface stretched on these curves as on a frame. The   SPscSpline  routine knows how to make it.

>    Z:=SPscSpline([[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]],endpoints=natural):
ps:=plot3d([Z(u,v)],u=0..1,v=0..3,axes=BOXED,labels=["X","Y","Z"],scaling=CONSTRAINED):
plots[display](Trsp,ps);

[Maple Plot]

Here is how the equation of the surface looks.

>    'X'=Z[1](u,v);
'Y'=Z[2](u,v);
'Z'=Z[3](u,v);

X = 2/5-13/20*abs(8*u-7)-13/20*abs(8*u-1)+13/20*abs(8*u-3)+13/20*abs(8*u-5)+(7/15+7/60*abs(8*u-7)+7/60*abs(8*u-1)-7/60*abs(8*u-3)-7/60*abs(8*u-5))*v+(-3/5-3/20*abs(8*u-7)-3/20*abs(8*u-1)+3/20*abs(8*u-3...
X = 2/5-13/20*abs(8*u-7)-13/20*abs(8*u-1)+13/20*abs(8*u-3)+13/20*abs(8*u-5)+(7/15+7/60*abs(8*u-7)+7/60*abs(8*u-1)-7/60*abs(8*u-3)-7/60*abs(8*u-5))*v+(-3/5-3/20*abs(8*u-7)-3/20*abs(8*u-1)+3/20*abs(8*u-3...
X = 2/5-13/20*abs(8*u-7)-13/20*abs(8*u-1)+13/20*abs(8*u-3)+13/20*abs(8*u-5)+(7/15+7/60*abs(8*u-7)+7/60*abs(8*u-1)-7/60*abs(8*u-3)-7/60*abs(8*u-5))*v+(-3/5-3/20*abs(8*u-7)-3/20*abs(8*u-1)+3/20*abs(8*u-3...
X = 2/5-13/20*abs(8*u-7)-13/20*abs(8*u-1)+13/20*abs(8*u-3)+13/20*abs(8*u-5)+(7/15+7/60*abs(8*u-7)+7/60*abs(8*u-1)-7/60*abs(8*u-3)-7/60*abs(8*u-5))*v+(-3/5-3/20*abs(8*u-7)-3/20*abs(8*u-1)+3/20*abs(8*u-3...
X = 2/5-13/20*abs(8*u-7)-13/20*abs(8*u-1)+13/20*abs(8*u-3)+13/20*abs(8*u-5)+(7/15+7/60*abs(8*u-7)+7/60*abs(8*u-1)-7/60*abs(8*u-3)-7/60*abs(8*u-5))*v+(-3/5-3/20*abs(8*u-7)-3/20*abs(8*u-1)+3/20*abs(8*u-3...
X = 2/5-13/20*abs(8*u-7)-13/20*abs(8*u-1)+13/20*abs(8*u-3)+13/20*abs(8*u-5)+(7/15+7/60*abs(8*u-7)+7/60*abs(8*u-1)-7/60*abs(8*u-3)-7/60*abs(8*u-5))*v+(-3/5-3/20*abs(8*u-7)-3/20*abs(8*u-1)+3/20*abs(8*u-3...

Y = -6-7/4*abs(8*u-8)-4*abs(8*u-1)+4*abs(8*u-5)+14*abs(u)+1/2*abs(8*u-3)-1/2*abs(8*u-7)+(25/3+25/12*abs(8*u-8)+25/6*abs(8*u-1)-25/6*abs(8*u-5)-50/3*abs(u))*v+(-3-3/4*abs(8*u-8)-3/2*abs(8*u-1)+3/2*abs(8...
Y = -6-7/4*abs(8*u-8)-4*abs(8*u-1)+4*abs(8*u-5)+14*abs(u)+1/2*abs(8*u-3)-1/2*abs(8*u-7)+(25/3+25/12*abs(8*u-8)+25/6*abs(8*u-1)-25/6*abs(8*u-5)-50/3*abs(u))*v+(-3-3/4*abs(8*u-8)-3/2*abs(8*u-1)+3/2*abs(8...
Y = -6-7/4*abs(8*u-8)-4*abs(8*u-1)+4*abs(8*u-5)+14*abs(u)+1/2*abs(8*u-3)-1/2*abs(8*u-7)+(25/3+25/12*abs(8*u-8)+25/6*abs(8*u-1)-25/6*abs(8*u-5)-50/3*abs(u))*v+(-3-3/4*abs(8*u-8)-3/2*abs(8*u-1)+3/2*abs(8...
Y = -6-7/4*abs(8*u-8)-4*abs(8*u-1)+4*abs(8*u-5)+14*abs(u)+1/2*abs(8*u-3)-1/2*abs(8*u-7)+(25/3+25/12*abs(8*u-8)+25/6*abs(8*u-1)-25/6*abs(8*u-5)-50/3*abs(u))*v+(-3-3/4*abs(8*u-8)-3/2*abs(8*u-1)+3/2*abs(8...
Y = -6-7/4*abs(8*u-8)-4*abs(8*u-1)+4*abs(8*u-5)+14*abs(u)+1/2*abs(8*u-3)-1/2*abs(8*u-7)+(25/3+25/12*abs(8*u-8)+25/6*abs(8*u-1)-25/6*abs(8*u-5)-50/3*abs(u))*v+(-3-3/4*abs(8*u-8)-3/2*abs(8*u-1)+3/2*abs(8...

Z = 33/5-3/5*abs(8*u-5)-24/5*abs(u)+3/5*abs(8*u-1)+3/5*abs(8*u-3)-3/5*abs(8*u-7)+3/5*abs(8*u-8)+(-44/5+22/15*abs(8*u-5)+176/15*abs(u)-22/15*abs(8*u-1)-22/15*abs(8*u-3)+22/15*abs(8*u-7)-22/15*abs(8*u-8)...
Z = 33/5-3/5*abs(8*u-5)-24/5*abs(u)+3/5*abs(8*u-1)+3/5*abs(8*u-3)-3/5*abs(8*u-7)+3/5*abs(8*u-8)+(-44/5+22/15*abs(8*u-5)+176/15*abs(u)-22/15*abs(8*u-1)-22/15*abs(8*u-3)+22/15*abs(8*u-7)-22/15*abs(8*u-8)...
Z = 33/5-3/5*abs(8*u-5)-24/5*abs(u)+3/5*abs(8*u-1)+3/5*abs(8*u-3)-3/5*abs(8*u-7)+3/5*abs(8*u-8)+(-44/5+22/15*abs(8*u-5)+176/15*abs(u)-22/15*abs(8*u-1)-22/15*abs(8*u-3)+22/15*abs(8*u-7)-22/15*abs(8*u-8)...
Z = 33/5-3/5*abs(8*u-5)-24/5*abs(u)+3/5*abs(8*u-1)+3/5*abs(8*u-3)-3/5*abs(8*u-7)+3/5*abs(8*u-8)+(-44/5+22/15*abs(8*u-5)+176/15*abs(u)-22/15*abs(8*u-1)-22/15*abs(8*u-3)+22/15*abs(8*u-7)-22/15*abs(8*u-8)...
Z = 33/5-3/5*abs(8*u-5)-24/5*abs(u)+3/5*abs(8*u-1)+3/5*abs(8*u-3)-3/5*abs(8*u-7)+3/5*abs(8*u-8)+(-44/5+22/15*abs(8*u-5)+176/15*abs(u)-22/15*abs(8*u-1)-22/15*abs(8*u-3)+22/15*abs(8*u-7)-22/15*abs(8*u-8)...
Z = 33/5-3/5*abs(8*u-5)-24/5*abs(u)+3/5*abs(8*u-1)+3/5*abs(8*u-3)-3/5*abs(8*u-7)+3/5*abs(8*u-8)+(-44/5+22/15*abs(8*u-5)+176/15*abs(u)-22/15*abs(8*u-1)-22/15*abs(8*u-3)+22/15*abs(8*u-7)-22/15*abs(8*u-8)...