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); |
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); |
Here is how the equation of the surface looks.
> | 'X'=Z[1](u,v); 'Y'=Z[2](u,v); 'Z'=Z[3](u,v); |