1. Technical Field
Embodiments of the present disclosure relate to computer aided design (CAD) methods, and more particularly to a system and method for converting a conventional surface into a non-uniform rational basis spline (NURBS) surface.
2. Description of Related Art
A NURBS surface can offer great flexibility and precision for handling both analytic and freeform shapes. The NURBS surface can be efficiently handled by computer programs and be allowed for easy human interaction. However, it costs much time to convert a conventional surface (e.g., a ruled surface) into a NURBS surface.
What is needed, therefore, is a system and method for converting a conventional surface into a NURBS surface.
All of the processes described below may be embodied in, and fully automated via, function modules executed by one or more general purpose computers or processors. The code modules may be stored in any type of computer-readable medium or other computer storage device. Some or all of the methods may alternatively be embodied in specialized computer hardware.
The computer 10 may be a personal computer (PC), a network server, or any other appropriate data-processing equipment. The computer 10 includes a storage system 230 and a processor 214. The storage system 230 stores a plurality of parameters of the ruled, cylindrical, and rotating surface. For example, the parameters of the ruled surface can comprise two boundary curves and a value range for each boundary curve. As shown in
The computer 10 is connected to a display device 30. The display device 30 may display the NURBS surface. It should be understood that the NURBS surface has become an industry standard for the representation, design, and data exchange of geometric information processed by computers. In one embodiment, the mathematical expression of the NURBS surface is expressed as the equation of:
In above equation, S(u,v) is a vectorial expression of parametric equations; {P1,k } are control points; {wi,k} are weights of the control points; N1,m (u) and Nk,n (v) are two B-Spline basic functions.
It is understood that the NURBS surface is constructed by two NURBS curves {right arrow over (C)}(u) and {right arrow over (C)}(v). In one embodiment, the mathematical expression of the NURBS curve {right arrow over (C)}(u) is expressed as the equation of:
In the above equation, {right arrow over (C)}(u) is a vectorial expression of parametric equations; Ni,p(u) are B-Spline basic functions; {right arrow over (P)}1 are vectors of control points; u is a parameter; Wi is a weight for the control point i; p is a basic function degree; and n+1 is a number of the control points. The control points form what is called the ‘control polygon’. There are two parametric equations in two dimensional (2D) space and one for each coordinate. The equations are a function of the parameter u. Each of the control points has a weighting factor associated with it. The weighting factor has the effect of pulling the curve closer to the control points. In one embodiment, if the NURBS curve {right arrow over (C)}(u) has four control points, and the NURBS curve knots are {0,0,0,0,1,1,1,1}, then the head control points and the tail control points are superposed on the endpoints of the NURBS curve {right arrow over (C)}(u).
In one embodiment, the surface conversion system 20 comprises a reading module 210, a generation module 211, a conversion module 212, and a construction module 213. One or more computerized codes of the modules 210-213 are stored in the storage system 230. One or more general purpose or specialized processors, such as a processor 214 executes the computerized codes of the modules 210-213 to provide one or more operations of the surface conversion system 20. Further details of these modules 210-213 will be explained below.
The reading module 210 reads a first NURBS curve of the conventional surface from the storage system 230. In one embodiment, if the conventional surface is the ruled surface, the reading module 210 reads the boundary curve A-B and C-D (as shown in
The generation module 211 generates a constructed curve according to the first NURBS curve of the conventional surface. In one embodiment, if the conventional surface is the ruled surface, as shown in
The conversion module 213 converts the constructed curve into a second NURBS curve. In one embodiment, the conversion module 213 converts the constructed curve into the second NURBS curves, so that the constructed curve is expressed by the mathematical expression of the NURBS curve as mentioned above.
The construction module 214 constructs the NURBS surface based on the first NURBS curve and the second NURBS curve. Specifically, the construction module 214 constructs control points of the NURBS surface. For example, the control points of the first NURBS curve and the second NURBS curve is represented as {U1, U2} and {V1, V2} and the control points of the NURBS surface are constructed into {(U1, V1), (U1, V2), (U2,V1), (U2,V2)}. The construction module 214 constructs weights of the control points of the NURBS surface. For example, the weights for the control points of the first NURBS curves is represented as {W1,W2} and the weights for the control points of the second NURBS curves is represented as {L1, L2}. Then the weights for the control points of the NURBS surface are constructed into {(W1*L1),(W1*L1),(W2*L2)}. The construction module 214 constructs B-Spline basic functions of the NURBS surface. For example, the B-Spline basic functions of the first NURBS curve are {M1,M2} and the B-Spline basic functions of the second NURBS curve are {N1,N2}. Then the B-Spline basic functions of the NURBS surface are constructed into {(M1,N1),(M1, N2), (M2, N1), (M2, N2)}. The construction module 214 substitutes {(U1, V1), W1, V2), (U2, V1), (U2, V2)}, {(W1*L1), (W1*L2), (W2*L1), (W2*L2)} and {(M1,N1),(M1,N2),(M2,N1),(M2,N2)} into the mathematical expression of the NURBS surface as mentioned above. Then the NURBS surface is constructed.
In block S210, the reading module 210 reads two boundary curves of a ruled surface from the storage system 230, one of the two boundary curves is regarded as a first NURBS curve. As mentioned above, the reading module 210 reads the boundary curve A-B and the boundary curve C-D, the boundary curve A-B or the boundary curve C-D is regarded as the first NURBS curve.
In block S211, the generation module 211 generates a line-segment which is vertical to the two boundary curve. In one embodiment, the line-segment A-D is vertical to the boundary curve A-B and C-D. The generation module 211 generates the line-segment A-D according to the boundary curve A-B and C-D. For example, if (x0,y0) are coordinates of the head point A of the boundary curve A-B, and (x1, y1) are coordinates of the head point D of the boundary curve C-D, the mathematical expression of the line-segment A-D is expressed as the equation: L={A,D}, l(u)={(x0+(x1−x0)*u,y0+(y1−y0)*u|uε[0,1]}.
In block S212, the conversion module 212 converts the generated line-segment into a second NURBS curve. As mentioned above, the conversion module 212 converts the line-segment A-D into NURBS curves, so that the line-segment A-D is expressed from the mathematical expression L={A,D}, l(u)={x0+(x1−x0)*u, y0+(y1−y0)*u|u ε[0,1]} into the mathematical expression of the NURBS curve as mentioned above.
In block S213, the construction module 213 constructs the NURBS surface based on the first NURBS curve and the second NURBS curve. As mentioned above, the method of construction is followed: (1) the first NURBS curve A-B is represented as {U1,U2} and the second NURBS curve A-D is represented as {V1, V2}, then the control points of the NURBS surface are constructed into {(U1,V1), (U1, V2), (U2,V1), (U2,V2)}; (2) the weights for the first NURBS curve A-B is represented as {W1, W2} and the weights for second NURBS curve A-D is represented as {L1,L2}; then the weights for the control points of the NURBS surface are constructed into {(W1*L1), (W1*L2), (W2*L1); (W2*L2)}; (3) the B-Spline basic functions of the first NURBS curve A-B is represented as {M1 ,M2} and the B-Spline basic functions of the second NURBS curve A-D is represented as {N1, N2}, then the B-Spline basic functions of the NURBS surface are constructed into {(M1, N1), (M1, N2); (M2; N1); (M2; N2)}; (4) substituting {(U1, V1),(U1, V2); (U2; V1); (U2; V2)}, {(W1*L1), (W1*L2); (W72*L1); (W2*L2)} and {(M1, N1), (M1, N2), (M2, N1), (M2, N2)} into the mathematical expression of the NURBS surface mentioned above, then the NURBS surface is constructed.
In block S310, the reading module 210 reads a boundary curve and a boundary point of the cylindrical surface from the storage system 230, the boundary curve is regarded as a first NURBS curve. As mentioned above, the reading module 210 reads the boundary curve E-F and the coordinates of the boundary point G, the boundary curve E-F is regarded as the first NURBS curve.
In block S311, the generation module 211 generates a line-segment which is vertical to the boundary curve. In one embodiment, the generation module 211 generates the line G-E according to the boundary curve G-E and coordinates of the boundary point G, for example, assumption that E0(x0,y0) are coordinates of the head point E of the boundary curve E-F, and G1(x1,y1) are coordinates of the head boundary point G, then the mathematical expression of the line-segment G-E is expressed as the equation: L={E0,G1}, l(u)={x0+x0)*u,y0+(y1−y0)*u u [0,1]}.
In block S312, the conversion module 212 converts the line-segment into a second NURBS curve. As mentioned above, the conversion module 213 converts the line-segment G-E into the NURBS curves, so that the line-segment G-E is expressed from the mathematical expression L={E0, G1} l(u)={x0+(x1−x0)*u, y0+(y1−y0)*u|u E [0,1]} into the mathematical expression of the NURBS curve mentioned above.
In block S313, the construction module 213 constructs the NURBS surface based on the first NURBS curve and the second NURBS curve. As mentioned above, the method of construction is followed: (1) the control points of the first NURBS curve E-F is represented as {U1,U2 } and the control points of the second NURBS curve G-E is represented as {V1, V2 }; then the control points of the NURBS surface are constructed into {(U1,V1), (U1, V2), (U2,V1), (U2,V2)}; (2) the weights for the first NURBS curves E-F is represented as {W1, W2} and the weights for the second NURBS curves G-E is represented as {L1,L2}, then the weights for the control points of the NURBS surface are constructed into {(W1*L1), (W1*L2), (W2*L1), (W2*L2)}; (3) the B-Spline basic functions of the first NURBS curves E-F is represented as {M1, M2} and the B-Spline basic functions of the first NURBS curves G-E is represented as {N1, N2 }, then the B-Spline basic functions of the NURBS surface are constructed into {(M1,N1),(M1,N2),(M2,N1),(M2,N2)}(4) substituting {(U1, V1), (U1, V2), (U2, V1), (U2, V2)}, {(W1*L1),(W*L2),(W2*L1),(W2*L2)} and {(M1,N1),(M1, N2),(M2,N1),(M2N2)} into the mathematical expression of the NURBS surface mentioned above, then the NURBS surface is constructed.
In block S410, the reading module 210 reads a generatrix, a shaft and a rotating angle of a rotating surface from the storage system 230, the generatrix is regarded as a first NURBS curve. As mentioned above, the reading module 210 reads the generatrix H−J, the shaft O-P and the rotating angle ∠HOI, the generatrix H-J is regarded as the first NURBS curve.
In block 5411, the generation module 211 generates an arc which is vertical to the generatrix. As mentioned above, the generation module 211 generates the arc H-I according to the generatrix H-J, the shaft O-P and the rotating angle ∠HOI, for example, assumption that H (xstart,ystart) are coordinates of the head point H of the generatrix H-J, and O1(xcenter,ycenter) are coordinates of the head point O of the shaft O-P, θ is the angle degree of the rotating angle ∠HOI, then the mathematical expression of the arc H-I is expressed as the equation: Arc(θ)=(Xcenter+R*cos θ, ycenter+R*sinθ), θε[θstart,θend],R=√{square root over ((xstart−xcenter)2+(ystart−ycenter)2)}{square root over ((xstart−xcenter)2+(ystart−ycenter)2)}.
In block S412, the conversion module 212 converts the arc into the NURBS curves. As mentioned above, the conversion module 213 converts the arc H-I into the NURBS curves, so that the arc H-I is expressed from the mathematical expression Arc(θ)=(xcenter+R*cosθ,ycenter+R*sin θ, θε8 θstart,θend, R=√{square root over ((Xstart−Xcenter)2 (ystart−ycenter)2)}{square root over ((Xstart−Xcenter)2 (ystart−ycenter)2)} to the mathematical expression of the NURBS curve mentioned above.
In block 5413, the construction module 213 constructs the NURBS surface based on the first NURBS curve and the second NURBS curve. As mentioned above, the method of construction is followed: (1) the control points of the first NURBS curve H-J is represented as {U1,U2}, the control points of the second NURBS curve H-J is represented as {V1, V2}, then the control points of the NURBS surface are constructed into {(U1, V1), (U1,V2), (U2,V1),(U2,V2)}; (2) the weights for the first NURBS curve H-J is represented as {W1, W2}, the weights for the second NURBS curve H-I is represented as {L1,L2}, then the weights for the control points of the NURBS surface are constructed into {(W1*L1),(W1*L2), (W2*L1), (W2*L2)}; (3) the B-Spline basic functions of the first NURBS curve H-J are {M1, M2}, and the B-Spline basic functions of the first NURBS curve H-I are {N1,N2}, then the B-Spline basic functions of the NURBS surface are constructed into {(M1, N1), (M1, N2), (M2, N1), (M2, N2)}; (4) substituting {(U1, V1),(U1, V2),(U2, V1),(U2,V2)},{(W1*L1),(W1*L2),(W2*L1),(W2*L2)} and {(M1,N1),(M1, N2),(M2,N1),(M2,N2)} into the mathematical expression of the NURBS surface mentioned above, then the NURBS surface is constructed.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
200910302363.X | May 2009 | CN | national |