A House
Example from the PscFunctions package
Using routines of the PscFunctions package users can generate in an analytical form general parametric equations of polyhedrons or piecewise-bilinear
surfaces
.
The
SPscBilinear
routine generates
a sequence of three functions that represents parametric equation
of
a piecewise-bilinear surface spanned the point frame.
The frame is formed by the
list of lists of coordinates of the points
. The most of the following code will consist in build-up of the point frame
> | restart; with(PscFunctions): A1:=[0,0,10]: A2:=[5,0,6]: A3:=[4,0,6]: A4:=[4,0,2]: A5:=[4,0,0]: A6:=[-4,0,0]: A7:=[-4,0,2]: A8:=[-4,0,6]: A9:=[-5,0,6]: B1:=[0,10,10]: B2:=[5,10,6]: B3:=[4,10,6]: B4:=[4,10,2]: B5:=[4,10,0]: B51:=[2,10,0]: B52:=[-2,10,0]: B6:=[-4,10,0]: B7:=[-4,10,2]: B8:=[-4,10,6]: B9:=[-5,10,6]: C1:=[0,0,6]: C2:=[1,0,6]: C3:=[1,0,2]: C4:=[1,0,0]: C5:=[-1,0,0]: C6:=[-1,0,2]: C7:=[-1,0,6]: D1:=[0,10,6]: D2:=[2,10,6]: D3:=[2,10,2]: D4:=[-2,10,2]: D5:=[-2,10,6]: LLp:=[[C1,A1,B1,D1],[C2,A2,B2,D2],[C2,A3,B3,D2],[C3,A4,B4,D3],[C4,A5,B5,B51],[C4,C4,B51,B51],[C4,C4,B51,D3],[C5,C5,B52,D4],[C5,C5,B52,B52],[C5,A6,B6,B52],[C6,A7,B7,D4],[C7,A8,B8,D5],[C7,A9,B9,D5],[C1,A1,B1,D1]]: Lu:=[0,5,6,10,12,13,14,18,19,20,22,26,27,32]: Lv:=[0,3,13,16]: F:=SPscBilinear(LLp,Lu,Lv): plot3d([F(u,v)],u=0..32,v=0..16,axes=BOXED,scaling=CONSTRAINED,labels=["X","Y","Z"],grid=[33,17],orientation=[100,70]); |
Here is how the equation of the surface looks.
> | 'X'=F[1](u,v); 'Y'=F[2](u,v); 'Z'=F[3](u,v); |