knots={0,0,0,1/4, 1/4, 1/2, 1/2, 3/4, 3/4, 1,1,1}

BSplineBasis[{2, knots},8, t]

Plot[BSplineBasis[{2, knots},4, t], {t,0,1}, PlotRange->All]

w={1, Sqrt[2]/2, 1, Sqrt[2]/2, 1, Sqrt[2]/2, 1, Sqrt[2]/2,1}

V={{1, -1},{1, 1},{-1, 1}, {-1, -1}}
P={(V[[1]]+V[[4]])/2, V[[1]],(V[[1]]+V[[2]])/2, V[[2]], (V[[3]]+V[[2]])/2, V[[3]], (V[[3]]+V[[4]])/2, V[[4]], (V[[1]]+V[[4]])/2}

Pw=Table[w[[i]]*{P[[i]][[1]], P[[i]][[2]], 1},{i,1,9}]

Cw=Sum[BSplineBasis[{2, knots},i, t]*Pw[[i+1]],{i, 0,8}];

Simplify[Cw[[1;;2]]/Cw[[3]]-c]

c=Sum[BSplineBasis[{2, knots},i, t]*w[[i+1]]*P[[i+1]],{i, 0,8}]/Sum[BSplineBasis[{2, knots},i, t]*w[[i+1]],{i, 0,8}];

Show[ParametricPlot[c, {t,0,1}],Graphics[{Black, Line[P]}],Graphics[{Red, Point[P]}]]

Show[ParametricPlot3D[Cw, {t,0,1}],Graphics3D[{Black, Line[Pw]}],Graphics3D[{Red, Point[Pw]}], AxesOrigin->{0,0,0}]

Q={{1,0,-1}, {1,0,2},{-1, 1,1},{-2, -3,-1}}

T=(Q[[1]]*(1-u)+Q[[2]]*(u))*(1-v)+(Q[[3]]*(1-u)+Q[[4]]*(u))*v

pl1=ParametricPlot3D[T, {u,0,1},{v,0,1}, PlotStyle->Blue]

T

rov={x,y,z}-T

HP=Resultant[Resultant[rov[[1]],rov[[2]],u],Resultant[rov[[3]],rov[[2]],u],v]/(3y)

pl2=ContourPlot3D[HP==0, {x, -10,10},{y, -10,10},{z, -10,10}]

Show[pl2,pl1]

pHP=Factor[(HP/.{x->X1/X4, y->X2/X4, z->X3/X4})*X4^2]/12

Factor[pHP/.{X4->0}]