Bézier Surface Fitting and Evaluation

版本 1.0.3 (5.1 KB) 作者: Moreno, M.
Fast Bézier surface fitting and evaluation via linear and non-linear least squares.
123.0 次下载
更新时间 2022/6/14

查看许可证

Syntax
Fitting
y = bsfit(x,n)
y = bsfit(x,n,u,v)
[y,res,u,v,val] = bsfit(x,n,u,v,varargin)
Evaluation
[x,y,z] = bsval(x,u,v)
Description
Fitting
[y,res,u,v,val] = bsfit(x,n,u,v,varargin) Returns the control points 'y' of the best-fitting Bézier surface of order 'n' by 'n' to a data set 'x' of scattered points. A vector of 'u' and 'v' knots can be parsed as an input, as well as the following pairs of parameter-vales:
'nlls' Specifies a non-linear least squares calculation
'tol' Specifies a fit tolerance for the non-linear iterations
'iter' Specifies a maximum number of non-linear iterations
'bico' Specifies the binomial coefficients of order 'n+1'
'coef' Specifies a relaxation factor for the knot correction
'plot' Generates a figure with the residual convergence
The average residual 'res', knot vectors 'u' and 'v' and the surface evaluation 'val' in the previous knots can be queried as output. The unstructured point cloud 'x' must be a three-dimensional column matrix.
The research paper of reference for this function is:
Lifton, J., Liu, T. and McBride, J., 'Non-Linear Least Squares Fitting of Bézier Surfaces to Unstructured Point Clouds'. AIMS Mathematics, 6(4), 3142-3159.
The help of the research paper author Joseph Lifton has ben of paramount importance.
Evaluation
[x,y,z] = bsval(x,u,v) Evaluates the Bézier surface of order n+1, n+1 that results from the [n*n, 3] control point matrix 'x' with knots 'u' and 'v'. If the knot vectors are not parsed, a grid of 100 by 100 knots is used.
The function returns the scattered surface points if only one output is specified, and the gridded surface points otherwise. The nomenclature of this function is as per bsfit and the aforementioned research paper.

引用格式

Moreno, M. (2024). Bézier Surface Fitting and Evaluation (https://www.mathworks.com/matlabcentral/fileexchange/112470-bezier-surface-fitting-and-evaluation), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2022a
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.3

Function optimisation, significant speed boost. Change of files and description text.

1.0.2

Correction of the reshaping index in bsurfeval for the case where no knot vectors are parsed as inputs

1.0.1

Typo parsing input arguments in bsurfit. Enhancement of bsurfeval input argument checks.

1.0.0