Begtostudy(白途思)'s Professional Technology Blog

欢迎访问begtostudy的专业知识博客!主要是专业技术和算法为主。
  首页  :: 联系 :: 订阅 订阅  :: 管理

NURBS Toolbox by D.M. Spink (matlab)

Posted on 2010-08-02 13:25  白途思  阅读(3740)  评论(0编辑  收藏  举报

 

NURBS - Non Uniform Rational B-Splines.

image

Toolbox

The NURBS toolbox is collection of routines for the creation, and manipulation of Non-Uniform Rational B-Splines (NURBS). NURBS have to some extent become the de facto industry standard for representing complex geometric information in CAD, CAE and CAM, and are an integral part of many standard data exchange formats such as IGES, STEP and PHIGS.

The toolbox is available for either Matlab or Scilab, and contains both script files and c routines to increase the performance. The intention of these toolboxes is not to provide the worlds fastest NURBS manipulation packages, but that coupled with the matlab/scilab environments they provide a friendly means for interactive research and algorithm prototyping.

All the nurbs routines are prefix with 'nrb' to differentiate them from any other similar sounding matlab script files by other authors. The data structure used to represent the NURBS in Matlab is compatible with that used in the Spline Toolbox by C. de Boor and The MathWorks, Inc and can be manipulated as four dimensional univariate or multivariate B-Splines. Both packages also include demonstration scripts that show examples on how to use the toolbox, and also online help is available.

For a detailed explanation of NURBS and how to manipulate them, I can strongly recommend the book by Les Piegl and Wayne Tiller called 'The NURBS Book' ISBN 3-540-61545-8. Please note that the 'C' code algorithms is this library are modified versions of the pseudo-code within the book.

Functions

The functions currently available in the toolbox are:

Main functions

  • nrbmak - Construct a NURBS from control points and knots.
  • nrbtform - Applying scaling, translation or rotation operators.
  • nrbkntins - Knot insertion/refinement.
  • nrbdegelev - Degree elevation.
  • nrbderiv - NURBS representation of the derivative.
  • nrbdeval - Evaluation of the NURBS derivative.
  • nrbkntmult - Find the multiplicity of a knot vector.
  • nrbreverse - Reverse evaluation direction of the NURBS.
  • nrbtransp - Swap U and V for NURBS surface.
  • nrbline - Construct a straight line.
  • nrbcirc - Construct a circular arc.
  • nrbrect - Construct a rectangle.
  • nrb4surf - Surface defined by 4 corner points.
  • nrbeval - Evaluation of NURBS curve or surface.
  • nrbextrude - Extrude a NURBS curve along a vector.
  • nrbrevolve - Construct surface by revolving a profile.
  • nrbruled - Ruled surface between two NURBS curves.
  • nrbcoons - Construct Coons bilinearly blended surface patch.
  • nrbplot - Plot NURBS curve or surface.

Low level functions - c routines

  • bspeval - Evaluate a univariate B-Spline.
  • bspderiv - B-Spline representation of the derivative
  • bspkntins - Insert a knot or knots into a univariate B-Spline.
  • bspdegelev - Degree elevation of a univariate B-Spline.

Vector and Transformation Utilities

  • vecnorm - Normalisation of Vectors.
  • vecmag - Magnitude of Vectors.
  • vecmag2 - Squared Magnitude of the vectors.
  • vecangle - Alternative to atan2 (0 <= angle <= 2*pi).
  • vecdot - Dot product of two vectors.
  • veccross - Cross product of two vectors.
  • vecrotx - Rotation matrix around the x-axis.
  • vecroty - Rotation matrix around the y-axis.
  • vecrotz - Rotation matrix around the z-axis.
  • vecscale - Scaling matrix.
  • vectrans - Translation matrix.

Misc Utilities

  • deg2rad - Convert degrees to radians.
  • rad2deg - Convert radians to degrees.
Availability

The NURBS toolbox is provide free of any charges and has a GPL license. The source code is available for the Linux, Solaris and Windows, however should compile easily on other platforms.

Runar Tenfjord has ported the NURBS toolbox to Python. The module and further details can be found at http://runten.tripod.com/.

前往Begtostudy的编程知识博客(CSDN)