3.15 pvfit – Paraboloid fitting for polyhedral interface reconstruction

The pvfit routine fits a paraboloid to a set of \(\texttt{npol}\) polygons by constructing volumetric columns aligned with a local reference system (\(\texttt{u},\texttt{v},\texttt{f}\)). The interface of this paraboloid, defined within the local reference system, is given by Eq. (3.1), where the coefficient vector is \(\texttt{coef}=[c_1,c_2,c_3,c_4,c_5,c_6]\). Specifically, the routine projects the discrete polygons onto the local reference plane—defined by the orthonormal basis \(\texttt{vn0}\) and reference point \(\texttt{vp0}\)—thereby forming vertical columns bounded by the projected polygon edges. It then determines the paraboloid that best approximates the volume of these columns using a least-squares technique [4, 14].

Fortran:

call pvfit(coef,errfit,niv,npol,vn0,vp0,xn,xv,yn,yv,zn,zv)

C:

pvfit(coef,&errfit,niv,&npol,vn0,vp0,xn,xv,yn,yv,zn,zv);

Python:

(coef,errfit) = voft.pvfit(niv,npol,vn0,vp0,xn,xv,yn,yv,zn,zv)

Arguments:

coef

OUT

W_P

array of length \((6)\) storing the coefficients \([c_1,c_2,c_3,c_4,c_5,c_6]\) of the fitted paraboloid in the local orthonormal basis

errfit

OUT

W_P

scalar representing the sum of squared volumetric residuals over the input polygons, evaluated using the fitted coefficients; this quantity is not normalized

niv

IN

I_P

array of length (ns) storing the number of vertices of each polygon

npol

IN

I_P

total number of polygons

vn0

IN

W_P

array of dimensions \((3,3)\) whose rows contain the unit vectors of the local f-, u-, and v-axes, respectively, expressed in global coordinates

vp0

IN

W_P

array of length \((3)\) storing the origin of the local reference system in global coordinates

xn, yn, zn

IN

W_P

arrays of length (ns) storing \((x,y,z)\)-components of the unit-length normal vectors for each polygon

xv, yv, zv

IN

W_P

arrays of dimensions (\(\texttt{ns},\texttt{nv}\)) storing the \((x,y,z)\)-coordinates of every vertex of each polygon

Note: The polygon set must provide at least six independent volumetric constraints for the six fitted coefficients. The normal of each polygon must have a nonzero component along the local f-axis. Having six or more polygons alone does not guarantee a nonsingular fitting system.