cpts = { {1,-1}, {3,-1}, {3,1}, {1,1}, {1,3}, {-1,3}, {-1,1}, {-3,1}, {-3,-1}, {-1,-1}, {-1,-3} , { 1 , -3 } , { 1 , - 1 } } ;

(* Generates the graphics objects of the sequence of points *)
(* of a control polygon.                                    *)
listOfPoints[cpoly_] :=
Module [
{m, i, res},
(
m = Length[cpoly];
res = {RGBColor[1,0,0] , PointSize[0.02]};
Do [
res = Append[res, Point[cpoly[[i]]]],
{i, 1, m}
];

res
)
]

(* Generates the graphics objects of the sequence of edges *)
(* of a control polygon.                                    *)
listOfEdges[cpoly_] :=
Module [
{m, i, res},
(
m = Length[cpoly] - 1;
res = {RGBColor[1,1,0]};
Do [
res = Append[res, Line[{cpoly[[i]], cpoly[[i+1]]}]],
{i, 1, m}
];

res
)
]

g1 = listOfPoints[ cpts ] ;

g2 = listOfEdges[ cpts ] ;

Show[ Graphics[{ Thickness[0.008] ,g2 ,g1 } ], Axes -> None ]

(* Transition function from p-domain i to p-domain i+1 *)
tfunciip1[t_] := If[ ( t >  ( 3 / 5 ) ) && ( t < 1 ) , t - ( 3 / 5 ) , Throw[ invalid ] ] ;

(* Transition function from p-domain i+1 to p-domain i *)
tfuncip1i[t_] := If[ ( t > 0 ) && ( t < ( 2 / 5 ) ) , t + ( 3 / 5 ) , Throw[ invalid ] ] ;

(* Shape function associated with the p-domain 1 *)
sfunc1[t_] := 
Module [
{ p0 , p1 , p2 , p3 , p4 , p5 , res } ,
(
p0 = { 3 ,1 } ;
p1 = { 1 ,1 } ;
p2 = { 1 ,3 } ;
p3 = {-1 , 3 } ;
p4 = {-1 , 1 } ;
p5 = {-3 , 1 } ;
If[ 
( t >  0 ) && ( t < 1 ) , 
res =  ( 1 - t )^5 p0 + 5t(1 - t)^4 p1 + 10t^2(1 - t)^3 p2 + 10t^3( 1 - t)^2 p3 + 5t^4(1 - t)p4 + t^5 p5,
Throw[ invalid ]
] ;

res
)
] ;

(* Shape function associated with the p-domain 2 *)
sfunc2[t_] := 
Module [
{ p0 , p1 , p2 , p3 , p4 , p5 , res } ,
(
p0 = {-1 ,3 } ;
p1 = {-1 ,1 } ;
p2 = {-3 ,1 } ;
p3 = {-3 ,-1 } ;
p4 = {-1 ,-1 } ;
p5 = {-1 ,-3 } ;
If[ 
( t >  0 ) && ( t < 1 ) , 
res =  ( 1 - t )^5 p0 + 5t(1 - t)^4 p1 + 10t^2(1 - t)^3 p2 + 10t^3( 1 - t)^2 p3 + 5t^4(1 - t)p4 + t^5 p5,
Throw[ invalid ]
] ;

res
)
] ;

(* Shape function associated with the p-domain 3 *)
sfunc3[t_] := 
Module [
{ p0 , p1 , p2 , p3 , p4 , p5 , res } ,
(
p0 = { -3 ,-1 } ;
p1 = { -1 ,-1 } ;
p2 = { -1 ,-3 } ;
p3 = {   1 ,-3 } ;
p4 = {   1 ,-1 } ;
p5 = {   3 ,-1 } ;
If[ 
( t >  0 ) && ( t < 1 ) , 
res =  ( 1 - t )^5 p0 + 5t(1 - t)^4 p1 + 10t^2(1 - t)^3 p2 + 10t^3( 1 - t)^2 p3 + 5t^4(1 - t)p4 + t^5 p5,
Throw[ invalid ]
] ;

res
)
] ;

(* Shape function associated with the p-domain 4 *)
sfunc4[t_] := 
Module [
{ p0 , p1 , p2 , p3 , p4 , p5 , res } ,
(
p0 = { 1 ,-3 } ;
p1 = { 1 ,-1 } ;
p2 = { 3 ,-1 } ;
p3 = { 3 ,  1 } ;
p4 = { 1 ,  1 } ;
p5 = { 1 ,  3 } ;
If[ 
( t >  0 ) && ( t < 1 ) , 
res =  ( 1 - t )^5 p0 + 5t(1 - t)^4 p1 + 10t^2(1 - t)^3 p2 + 10t^3( 1 - t)^2 p3 + 5t^4(1 - t)p4 + t^5 p5,
Throw[ invalid ]
] ;

res
)
] ;

ParametricPlot[ { sfunc1[t] , sfunc2[t] , sfunc3[t] , sfunc4[t] }  , { t , 0.001 , 0.999 } , PlotStyle -> Thick  , Axes -> None ]

(* Function Xi of the partition of unity approach *)
xifunc[ t_,L1_ ,L2_ ] :=
Module [
{res, L, s },
(
If [ t ≤  L1,
res =  1,
If [ t < L2,
(
L = ( t - L1 ) / ( L2 - L1) ; 
t1 = 1 / (1 - L)^(1/2);
t2 = 1 / L^(1/2);
s =  ( Exp[ t1 - t2 ] )^2;
res = 1 / ( 1 +s  ) 
),
res = 0
]
];

res
)
]

Plot[ xifunc[ t ,0.2 ,0.8 ] ,{ t ,0 ,1 },PlotRange -> All , PlotStyle -> Thick ]

(* Weight function *)
wfunc[ t_ ] :=
Module [
{res, L , L1 , L2 , s},
(
If [ t ≤( 1 / 2 )  ,
res = xifunc[ 1 - 2t , 0.2 , 0.8 ] ,
res = xifunc[ 2t - 1 , 0.2 , 0.8 ] 
] ;

res
)
]

Plot[ wfunc[ t ] ,{ t ,0 ,1 },PlotRange -> All , PlotStyle -> Thick ]

(* Parametrization function associated with the p-domain 1 *)
pfunc1[t_] := 
Module [
{  s , v , w , res } ,
(
If[  ( t >  0 ) && ( t < ( 2 / 5 ) ) , 
(
s = tfuncip1i[ t ] ;
v= wfunc[ s ] ;
w= wfunc[ t ] ;
res = ( v sfunc4[ s ] + w sfunc1[ t ] ) / ( v + w )     
) ,
If [ ( t > ( 3 / 5 ) ) && ( t < 1 ) ,
(
 s = tfunciip1[ t ] ;
 v= wfunc[ s ] ;  
 w= wfunc[ t ] ;
 res = ( v sfunc2[ s ] + w sfunc1[ t ] ) / ( v + w )
),
If [ ( t >= ( 2 / 5 ) ) && ( t <= ( 3 / 5 ) ) ,
res = sfunc1[ t ] ,
Throw[ invalid ] 
]
]
] ;

res
)
] ;

(* Parametrization function associated with the p-domain 2 *)
pfunc2[t_] := 
Module [
{  s , v , w , res } ,
(
If[  ( t >  0 ) && ( t < ( 2 / 5 ) ) , 
(
s = tfuncip1i[ t ] ;
v= wfunc[ s ] ;
w= wfunc[ t ] ;
res = ( v sfunc1[ s ] + w sfunc2[ t ] ) / ( v + w )     
) ,
If [ ( t > ( 3 / 5 ) ) && ( t < 1 ) ,
(
 s = tfunciip1[ t ] ;
 v= wfunc[ s ] ;  
 w= wfunc[ t ] ;
 res = ( v sfunc3[ s ] + w sfunc2[ t ] ) / ( v + w )
),
If [ ( t >= ( 2 / 5 ) ) && ( t <= ( 3 / 5 ) ) ,
res = sfunc2[ t ] ,
Throw[ invalid ] 
]
]
] ;

res
)
] ;

(* Parametrization function associated with the p-domain 3 *)
pfunc3[t_] := 
Module [
{  s , v , w , res } ,
(
If[  ( t >  0 ) && ( t < ( 2 / 5 ) ) , 
(
s = tfuncip1i[ t ] ;
v= wfunc[ s ] ;
w= wfunc[ t ] ;
res = ( v sfunc2[ s ] + w sfunc3[ t ] ) / ( v + w )     
) ,
If [ ( t > ( 3 / 5 ) ) && ( t < 1 ) ,
(
 s = tfunciip1[ t ] ;
 v= wfunc[ s ] ;  
 w= wfunc[ t ] ;
 res = ( v sfunc4[ s ] + w sfunc3[ t ] ) / ( v + w )
),
If [ ( t >= ( 2 / 5 ) ) && ( t <= ( 3 / 5 ) ) ,
res = sfunc3[ t ] ,
Throw[ invalid ] 
]
]
] ;

res
)
] ;

(* Parametrization function associated with the p-domain 4 *)
pfunc4[t_] := 
Module [
{  s , v , w , res } ,
(
If[  ( t >  0 ) && ( t < ( 2 / 5 ) ) , 
(
s = tfuncip1i[ t ] ;
v= wfunc[ s ] ;
w= wfunc[ t ] ;
res = ( v sfunc3[ s ] + w sfunc4[ t ] ) / ( v + w )     
) ,
If [ ( t > ( 3 / 5 ) ) && ( t < 1 ) ,
(
 s = tfunciip1[ t ] ;
 v= wfunc[ s ] ;  
 w= wfunc[ t ] ;
 res = ( v sfunc1[ s ] + w sfunc4[ t ] ) / ( v + w )
),
If [ ( t >= ( 2 / 5 ) ) && ( t <= ( 3 / 5 ) ) ,
res = sfunc4[ t ] ,
Throw[ invalid ] 
]
]
] ;

res
)
] ;

ParametricPlot[ { pfunc1[ t ] , pfunc2[ t ] , pfunc3[ t ] , pfunc4[ t ] }  , { t , 0.001 , 0.999 } , PlotStyle -> Thick  , Axes -> None ]