Plane Region of the M Letter

Example from the PscFunctions package

With the help of routines of the PscFunctions package it is possible to get parametric equations of plain regions with boundaries .
The following example shows how to find parametric equation of a plane region of the M letter. At the beginning we generate a parametric equation of the lower and upper boundary curves.

>    with(PscFunctions):
fd1:=CPolyline([[0,0],[1,0],[1,2],[2,1],[3,2],[3,0],[4,0]]):
fu1:=CPolyline([[0,3],[1,3],[1,3],[2,2],[3,3],[3,3],[4,3]]):
plot({[fd1(t),t=0..6],[fu1(t),t=-1..7]},-1..5,-0.1..3.1,thickness=3,scaling=CONSTRAINED,color=[BLACK,BLUE]);
'xd'=fd1[1](t);
'yd'=fd1[2](t);
'xu'=fu1[1](t);
'yu'=fu1[2](t);

[Maple Plot]

xd = 2+1/2*abs(t)-1/2*abs(t-1)+1/2*abs(t-2)-1/2*abs(t-4)+1/2*abs(t-5)-1/2*abs(t-6)
yd = abs(t-1)-3/2*abs(t-2)+abs(t-3)-3/2*abs(t-4)+abs(t-5)
xu = 2+1/2*abs(t)-1/2*abs(t-1)+1/2*abs(t-2)-1/2*abs(t-4)+1/2*abs(t-5)-1/2*abs(t-6)
yu = 3-1/2*abs(t-2)+abs(t-3)-1/2*abs(t-4)

Then with the help of DRectDomain  routine we generate parametric equation of a plane region in the shape of the letter M.

>    x:=t->fd1[1](t): f1:=t->fd1[2](t): f2:=t->fu1[2](t):
Mletter:=DRectDomain(x,f1,f2):
plot3d([Mletter(u,v),0],u=0..6,v=0..3,axes=BOXED,grid=[31,16],scaling=CONSTRAINED,orientation=[-120,30]);
'x'=Mletter[1](u,v);
'y'=Mletter[2](u,v);

[Maple Plot]

x = 2+1/2*abs(u)-1/2*abs(u-1)+1/2*abs(u-2)-1/2*abs(u-4)+1/2*abs(u-5)-1/2*abs(u-6)

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