The normals are computed by tak<strong>in</strong>g the cross product of thesurface derivatives∂ ∂n = Q( u,v)× Q(u,v)∂u∂vand normaliz<strong>in</strong>g the result<strong>in</strong>g vector.This evaluation scheme is referred to <strong>in</strong> the literature as uniformtessellation. This method is staightforward to implement, lessCPU-<strong>in</strong>tensive and suitable for parallel comput<strong>in</strong>g. For a fixedtessellation it is possible to precompute all the necessary basisfunctions B i (u) and B j (v). In addition, some properties of <strong>NURBS</strong>can be exploited. The control po<strong>in</strong>ts are <strong>in</strong>variant totransformations. Thus the small number of control po<strong>in</strong>ts can betransformed <strong>in</strong>stead of the huge number of output vertices. Thevertices are lighted <strong>in</strong> screen space afterwards. Furthermore, theconvex hull property of <strong>NURBS</strong> states that the surface or curvelies completely with<strong>in</strong> the convex hull formed by its controlpolygon. Hence the control polygon can be used as bound<strong>in</strong>g boxfor cull<strong>in</strong>g. It is also known that by repeatedly perform<strong>in</strong>gsubdividision via knot <strong>in</strong>sertion [Far96] the control polygonconverges quadratically to the surface [Dahmen86]. By exploit<strong>in</strong>gthis fact, we can compute very tight bound<strong>in</strong>g hulls.As a drawback of a fixed step size the surfaces can beoversampled or undersampled: a flat surface may be broken up<strong>in</strong>to a very f<strong>in</strong>e mesh, or a surface of high curvature may berepresented by a coarse mesh. This problem is adressed <strong>in</strong> theadaptive subdivision scheme as described <strong>in</strong> [Pet94]. Adaptivetessellation approximates the surface more accurately, especially<strong>in</strong> cases of highly vary<strong>in</strong>g curvature, but is more CPU-<strong>in</strong>tensive.In our approach, we use a uniform tessellation due to its lessercomputational requirements. If the <strong>NURBS</strong> surface isparametrized appropriately, then the placement of the knot l<strong>in</strong>esreflects the surface properties well. In areas of dense knot l<strong>in</strong>es thesurface will be more complex than <strong>in</strong> areas with sparse knotl<strong>in</strong>es.Hence a tessellation formed by divid<strong>in</strong>g knot <strong>in</strong>tervals <strong>in</strong>to a fixednumber of sub<strong>in</strong>tervals will sample the surface accurately.for <strong>in</strong>tersection to f<strong>in</strong>d out if they are identical [KML95].Especially when render<strong>in</strong>g trimmed <strong>NURBS</strong>, the trimm<strong>in</strong>g curveshave to be checked. Patches may have different trimm<strong>in</strong>g curves<strong>in</strong> terms of control po<strong>in</strong>ts represent<strong>in</strong>g the curve.Trimmed <strong>NURBS</strong>To describe arbitrary shapes, we have to <strong>in</strong>troduce trimmed<strong>NURBS</strong> patches. Here, so-called trimm<strong>in</strong>g loops which arespecified <strong>in</strong> parameter space of a surface mark <strong>in</strong>valid regions ofthe <strong>NURBS</strong> patch doma<strong>in</strong>. Especially <strong>in</strong> the CAD doma<strong>in</strong>,trimmed <strong>NURBS</strong> are used to design objects with fluid shapes likeship hulls and aircraft or car bodies. Also <strong>in</strong> solid modell<strong>in</strong>gpatches conta<strong>in</strong><strong>in</strong>g holes are represented <strong>in</strong> trimmed form.Trimm<strong>in</strong>g loops consist of one or more trimm<strong>in</strong>g curves, whichare 2D <strong>NURBS</strong> curves or piecewise l<strong>in</strong>ear curves, ly<strong>in</strong>g <strong>in</strong>parameter space of the surface and form<strong>in</strong>g a closed loop.Degeneracies like self<strong>in</strong>tersect<strong>in</strong>g trimm<strong>in</strong>g loops and <strong>in</strong>tersect<strong>in</strong>gloops need special attention, <strong>in</strong> that they have to be split up <strong>in</strong>tonon <strong>in</strong>tersect<strong>in</strong>g loops.Two different approaches of tessellat<strong>in</strong>g trimmed surfaces can befound <strong>in</strong> literature: In [Luk93] and [LC93] the B-Spl<strong>in</strong>erepresentation is used for render<strong>in</strong>g. The render<strong>in</strong>g algorithm<strong>in</strong>volves the computation of <strong>in</strong>tersections of trimm<strong>in</strong>g curves withthe iso-l<strong>in</strong>es and triangulation. S<strong>in</strong>ce these operations are simplerand faster to perform on Bezier-representations than on B-Spl<strong>in</strong>es,algorithms presented <strong>in</strong> [RHD89], [KML96] and [AES94] firstconvert <strong>NURBS</strong> surfaces to Bezier surfaces. The algorithm <strong>in</strong>[RHD89] partitions each trimm<strong>in</strong>g curve <strong>in</strong>to monotonic segmentsfollowed by a special triangulation at the patch boundaries. Weshare this approach <strong>in</strong> our implementation which is stable andstraightforward to implement. The monotonic subdivision and thetriangulation may become a bottleneck [RHD89]. More recentresults as [KML96] present more efficient algorithms for thetriangulation, the computation of tight bounds and the exploitationof frame coherence.Boundary computationThere is considerable literature on step size computation foruniform tessellation such as [RHD89], [FMM86], [AES91],[KML96]. There are two categories of algorithms, the sizecriterion and the deviation criterion. The size criterion determ<strong>in</strong>esthe bound based on the size of the result<strong>in</strong>g triangles <strong>in</strong> screenspace. Apply<strong>in</strong>g this step size to uniform tessellation still meansthat smooth areas are oversampled because the step size is relatedto the maximum curvature. The deviation criterion computes abound on the maximum deviation of the tessellated surface fromthe <strong>NURBS</strong> surface. The deviation criterion produces good resultsbut is computationally expensive.CracksS<strong>in</strong>ce adjacent surfaces need not necessarily be tessellated withthe same step size, cracks will appear at the patch boundaries. Ifthe boundary curve of two surfaces has an identical parametricrepresentation, a strip of cov<strong>in</strong>g triangles can be generated at theboundary as described <strong>in</strong> [FMM86, RHD89]. If the control po<strong>in</strong>tsof the boundary do not match, boundary curves have to be testedFigure 1: Trimmed <strong>NURBS</strong> patch rendered with the glutessellator.
2. PROPOSED NODESNurbsSurfaceNurbsSurface {field SFInt32 uDimension 0 # [0, ∞)field SFInt32 vDimension 0 # [0, ∞)field MFFloat uKnot [] # (-∞,∞)field MFFloat vKnot [] # (-∞,∞)field SFInt32 uOrder 3 # [2, ∞)field SFInt32 vOrder 3 # [2, ∞)exposedField MFVec3f controlPo<strong>in</strong>t [] # (-∞,∞)exposedField MFFloat weight [] # (0, ∞)exposedField SFInt32 uTessellation 0 # (-∞,∞)exposedField SFInt32 vTessellation 0 # (-∞,∞)exposedField SFNode texCoord []field SFBool ccw TRUEfield SFBool solid TRUE}uDimension and vDimension def<strong>in</strong>e the number of control po<strong>in</strong>ts<strong>in</strong> the u and v dimensions.uOrder and vOrder def<strong>in</strong>e the order of surface. From amathematical po<strong>in</strong>t of view, the surface is def<strong>in</strong>ed by polynomialsof the degree order-1. The order of the curves uOrder and vOrdermust be greater than or equal to 2. An implementation may limituOrder and vOrder to a certa<strong>in</strong> number. The most common ordersare 3 (quadratic polynomial) and 4 (cubic polynomial), which aresufficient to achieve the desired curvature <strong>in</strong> most cases.The number of control po<strong>in</strong>ts must be at least equal to the order ofthe curve. The order def<strong>in</strong>es the number of adjacent control po<strong>in</strong>tsthat <strong>in</strong>fluence a given control po<strong>in</strong>t.controlPo<strong>in</strong>t def<strong>in</strong>es a set of control po<strong>in</strong>ts of dimensionuDimension * vDimension. This set of po<strong>in</strong>ts def<strong>in</strong>es a meshsimilar to the grid of an ElevationGrid, whereas the po<strong>in</strong>ts do nothave a uniform spac<strong>in</strong>g. Depend<strong>in</strong>g on the weight values and theorder, this hull is approximated by the result<strong>in</strong>g surface. Thenumber of uDimension po<strong>in</strong>ts def<strong>in</strong>e a polyl<strong>in</strong>e <strong>in</strong> u-directionfollowed by further u-polyl<strong>in</strong>es with the v-parameter <strong>in</strong> ascend<strong>in</strong>gorder. The number of control po<strong>in</strong>ts must be equal to or greaterthan the order. A closed B-Spl<strong>in</strong>e surface can be specified byrepeat<strong>in</strong>g the limit<strong>in</strong>g control po<strong>in</strong>ts and by specify<strong>in</strong>g a periodicknot vectorThe control vertex correspond<strong>in</strong>g to the control po<strong>in</strong>t P[i, j] on thecontrol grid is:P[i,j].x = controlPo<strong>in</strong>ts[i + ( j × uDimension)].xP[i,j].y = controlPo<strong>in</strong>ts[i + ( j × uDimension)].yP[i,j].z = controlPo<strong>in</strong>ts[i + ( j × uDimension)].zP[i,j].w = weight[ i + (j × uDimension)]where 0