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:
|
|
|
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 |
|
|
|
scalar representing the sum of squared volumetric residuals over the input polygons, evaluated using the fitted coefficients; this quantity is not normalized |
|
|
|
array of length ( |
|
|
|
total number of polygons |
|
|
|
array of dimensions \((3,3)\) whose rows contain the unit vectors of the local |
|
|
|
array of length \((3)\) storing the origin of the local reference system in global coordinates |
|
|
|
arrays of length ( |
|
|
|
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.