Search code examples
nurbs

Nurbs trimmed surface


I am reading NURBS surfaces from a STEP file, as well as their boundary curves. Now I want to tessellate those surfaces.

Every algorithm I have read talks about boundary curves in parametric space, curve with a parameter t, that maps onto a 2D coordinate (u,v), the parametric coordinates of the surface.

The problem is that in STEP file I have the boundary curves defined in world space. My question is: There is an efficient way to transform a curve on a surface from world space to parametric space?

The only way I can think of is to generate lots of points from that curve, and then fit a new curve in parametric space, but I guess that there is a more efficient way to do this, knowing that the curve lies on the surface.

Thanks


Solution

  • If the 3D boundary curves are exactly the 3D mapping of the 2D boundary curves in the parametric domain (u, v), then perhaps there is a better way to compute these 2D boundary curves from the given 3D boundary curve. However, very often this is not the case. For a bi-cubic surface, the exact 3D boundary curve mapped from a 2D boundary curve of degree 3 is of degree 18. So, it is unlikely for any CAD software to represent these 3D boundary curves in exact format. Most of the times, they are just approximations and only lie close enough to the surface within a certain tolerance. So, if you do not have the information for the 2D boundary curves, in general you do need to do curve fitting in the parametric domain. The procedure would be to sample points from 3D curve, project them onto the surface to find corresponding (u,v) values, then do curve fitting from these (u,v) values. Of course, there would be some special cases where you can use simplified algorithms. For example, when the 3D curve matches the isoparametric curves of the surface.