1. Technical Field
Embodiments of the present disclosure generally relate to curved surface processing, and more particularly to a data processing device and method for converting three-dimensional coordinates of a curved surface to two-dimensional coordinates.
2. Description of Related Art
In image measuring technology, editing and/or analyzing a curved surface often utilize a data processing device, such as a computer. Curved surfaces are three-dimensional surfaces. It is necessary to convert the recorded coordinates of a three-dimensional curved surface to two-dimensional plane surface coordinates. How to convert coordinates of points of the curved surface from three-dimensional coordinates to two-dimensional coordinates quickly and accurately is a priority.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.
In general, a word “module,” as used hereinafter, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, for example, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware. It will be appreciated that modules may comprised connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described hereinafter may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage device.
In one embodiment, one or more computerized codes of the functional modules of the coordinate conversion system 1 may be stored in the storage system 2. The functional modules include a parameter receiving module 10, a basic data computation module 11, a basic point determination module 12, and a coordinate conversion module 13. The processor 3 is operable to execute the one or more computerized codes of the modules 10-13 to convert coordinates of points of a curved surface from three-dimensional coordinates to two-dimensional coordinates.
The parameter receiving module 10 is operable to receive parameters of a curved surface to be converted. In one embodiment, the parameters may include control points of the curved surface, such as a knot vector, for example. It should be understood that the control points determine the shape of the curved surface. The knot vector is a sequence of parameter values that determines where and how the control points affect the curved surface. An example of a knot vector is (0, 0, 1, 2, 2, 3, 4, 5, 5, 6). In one example, the parameters of the curved surface may be derived from an image measuring machine 4.
The basic data computation module 11 is operable to compute basic data of the curved surface using a B-spline basis function according to the parameters, and formulate a data structure according to the basic data. In detail, the basic data computation module 11 determines a U value and a V value of a UV map corresponding to the curved surface according to the parameters. It should be understood that the UV map is a two-dimensional image, such as illustrated in
The basic point determination module 12 is operable to determine basic points of the curved surface according to the parameters, the UV map, and the data structure. The basic points can be used to convert the coordinates of the curved surface from three-dimensional coordinates to two-dimensional coordinates. In detail, the basic point determination module 12 computes dividing steps of the U value and the V value according the parameters. In one embodiment, the U value or the V value is computed by dividing the U value or the V value by the number of the parameter values of the knot vector. In the example of the knot vector being (0, 0, 1, 2, 2, 3, 4, 5, 5, 6), the number of the parameter values of the knot vector is 10. The U value and the V value are from 0˜6, thus the dividing steps of the U value and the V value are 0.6, which are computed by dividing 6 by 10. The basic point determination module 12 meshes the UV map again by dividing the U value and the V value using the dividing steps to generate a second mesh, and generates second (U, V) coordinates for each vertex in the second mesh. The basic point determination module 12 then computes basic data of each of the second (U, V) coordinates using the data structure. The basic point determination module 12 computes three-dimensional coordinates by substituting the basic data into the NURBS formula for determining the basic points. In addition, if any of angles between normal vectors of each two plane surfaces formed by the basic points exceeds a predetermined value, the basic points determination module 12 supplements the basic points by executing a point insertion operation. In one embodiment, if the angle between normal vectors of a plane surface ABCD and a plane surface CDED exceeds the predetermined value, the point insertion operation includes steps as follows. The basic points determination module 12 obtains the plane surfaces ABCD and CDEF, and converts the plane surfaces ABCD and CDED to a two-dimensional plane surface CDE′F′. The basic points determination module 12 determines a central point of the plane surface CDE′F′, and obtains the two-dimensional coordinates of the central point. The basic points determination module 12 finally converts the two-dimensional coordinates into corresponding three-dimensional coordinates for obtaining a three-dimensional insertion point. The three-dimensional insertion point is one of the supplemented basic points.
The coordinate conversion module 13 is operable to convert coordinates of the curved surface from three-dimensional coordinates to two-dimensional coordinates according to the basic points. In detail, the coordinate conversion module 13 selects a point P in the curved surface. In one embodiment, the selection of the point P can be random. The coordinate conversion module 13 then computes a distance between the point P and each of the plane surfaces formed by the basic points to locate a plane surface which is nearest to the point P. The coordinate conversion module 13 projects the point P onto the nearest plane surface to generate a projected point P′, and obtains a point P″ which corresponds to the point P′ in the UV map. The coordinate conversion module 13 finally obtains the (U, V) coordinates of the point P″. The (U, V) coordinates are the two-dimensional coordinates of the point P of the curved surface. These operations are repeated until coordinates of all points in the curved surface have been converted.
In block S10, the parameter receiving module 10 receives parameters of a curved surface to be converted. In one example, the parameters of the curved surface may be derived from an image measuring machine 4. The parameters may include control points of the curved surface, a knot vector. As mentioned above, The knot vector is a sequence of parameter values. An example of a knot vector is (0, 0, 1, 2, 2, 3, 4, 5, 5, 6).
In block S11, the basic data computation module 11 computes basic data of the curved surface using the B-spline basis function according to the parameters, and formulates a data structure according to the basic data. A detailed description of computing the basic data is given as follows, referring to
In block S12, the basic points determination module 12 determines basic points of the curved surface according to the parameters, the UV map and the data structure. The basic points can be used to convert the coordinates of the curved surface from three-dimensional coordinates to two-dimensional coordinates. A detailed description of determining the basic points is given as follows, referring to
In block S13, the coordinate conversion module 13 converts coordinates of the curved surface from three-dimensional coordinates to two-dimensional coordinates using the basic points. A detailed description of converting the coordinates is given as follows, referring to
In block S110, the basic data computation module 11 determines a U value and a V value of a UV map corresponding to the curved surface according to the parameters. As mentioned, the UV map is a two-dimensional image converted by a three-dimensional model. In contrast to (X, Y, Z), which are the coordinates for the three-dimensional model in the modeling space, (U, V) are the coordinates of the converted two-dimensional image. In one embodiment, the U value and the V value are determined according to a maximal parameter value and a minimal parameter value of the knot vector.
In block S111, the basic data computation module 11 meshes the UV map by dividing the U value and the V value using a predetermined step to generate a first mesh, and generates first (U, V) coordinates of each vertex in the first mesh.
In block S112, the basic data computation module 11 computes a plurality of basic data by substitution of each of the first (U, V) coordinates into the B-spline basis function.
In block S113, the basic data computation module 11 formulates a data structure according to the first (U, V) coordinates and the corresponding basic data.
In block S120, the basic points determination module 12 computes dividing steps of the U value and the V value according to the parameters. In one embodiment, the U value or the V value is computed by dividing the U value or the V value by the number of parameter values of the knot vector. In an example of the knot vector being (0, 0, 1, 2, 2, 3, 4, 5, 5, 6), the number of the parameter values of the knot vector is 10. The U value and the V value are from 0˜6, thus, the dividing steps of the U value and the V value is 0.6, which is computed by dividing 6 by 10.
In block S121, the basic points determination module 12 meshes the UV map again by dividing the U value and the V value using the dividing steps to generate a second mesh, and generates second (U, V) coordinates for each vertex in the second mesh.
In block S122, the basic points determination module 12 selects one of the second (U, V) coordinates.
In block S123, the basic points determination module 12 computes the basic data corresponding to the selected second (U, V) coordinates using the data structure.
In block S124, the basic points determination module 12 computes a three-dimensional coordinates by substituting the basic data into the NURBS formula for determining one of the basic points.
In block S125, the basic points determination module 12 stores the three-dimensional coordinates of the basic point into a linear queue of the storage system 2.
In block S126, the basic points determination module 12 determines whether all the second (U, V) coordinates have been selected. If at least one of the second (U, V) has not been selected, block S122 is repeated. Otherwise, if all the second (U, V) coordinates have been selected, block S127 is implemented.
In block S127, the basic points determination module 12 computes an angle between normal vectors of each two plane surfaces formed by the three-dimensional coordinates stored in the linear queue.
In block S128, the basic points determination module 12 determines whether any of the angles exceeds a predetermined value. If not, the process is complete. If so, block S129 is implemented.
In block S129, the basic points determination module 12 supplements the basic points by determining an insertion point for the plane surfaces corresponding to the angle that exceeds the predetermined value. A detailed description of determination of an insertion point is given as follows, referring to
In block S130, the basic points determination module 12 stores the three-dimensional coordinate(s) of the insertion point(s) into the linear queue.
In block S140, the basic points determination module 12 obtains the plane surfaces ABCD and CDEF.
In block S141, the basic points determination module 12 converts the plane surfaces ABCD and CDED to a two-dimensional plane surface CDE′F′.
In block S142, the basic points determination module 12 determines a central point of the plane surface CDE′F′.
In block S143, the basic points determination module 12 obtains the two-dimensional coordinates of the central point.
In block S144, the basic points determination module 12 converts the two-dimensional coordinates of the central point to three-dimensional coordinates.
In block S145, the basic points determination module 12 obtains the insertion point having the three-dimensional coordinates.
In block S131, the coordinate conversion module 13 selects a point P of the curved surface. In one embodiment, the selection of the point P can be random.
In block S132, the coordinate conversion module 13 computes a distance between the point P and each of the plane surfaces formed by the basic points.
In block S133, the coordinate conversion module 13 finds a plane surface which is nearest to the point P according to the computed distances.
In block S134, the coordinate conversion module 13 projects the point P onto the nearest plane surface to generate a projected point P′.
In block S135, the coordinate conversion module 13 obtains a point P″, which corresponds to the point P′, in the UV map.
In block S136, the coordinate conversion module 13 obtains the (U, V) coordinates of the point P″. It should be understood that the (U, V) coordinates are the two-dimensional coordinates of the point P of the curved surface.
In block S137, the coordinate conversion module 13 determines whether all the points of the curved surface have been selected. If at least one of the points of the curved surface has not been selected, block S131 is repeated. Otherwise, if all the points of the curved surface have been selected, the process is complete.
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 |
---|---|---|---|
200910301896.6 | Apr 2009 | CN | national |