This application claims priority under 35 U.S.C. §119 from Chinese Patent Application No. 201010506180.2 filed Sep. 29, 2010, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The invention generally relates to field of information processing technology, and in particular, to a method and system for creating model data.
2. Description of Related Art
According to statistics, in applications for representing various shapes of object, the representation of “shell-like shapes” such as clothes, seashell, kneeling chair, vase, and 3D map is over 50%. Current methods for generating 3D model data include method based on conventional mesh model, continuous representation method based on parametric surface (such as Bezier surface, spline surface), subdivision surface, implicit function surface and so on, and method based on solid model. As for the representation method for the above “shell-like shapes”, such as the manner of using traditional triangular face, face with two layers (upper and lower) is required so as to represent the models that have thickness. Since there is no constraint between the two layers, shape manipulation is difficult. When one layer is manipulated, the other layer will not make corresponding change automatically. Thus, correct correspondence between these two layers must be recorded, and the two layers have to be modified respectively while shape of model needs to be modified. It is very inconvenient for an user, and on the other hand, it will occupy large amount of storage space. If solid model is adopted, it will bring significant computing complexity to modeling and visualizing procedure. Meanwhile, as for most applications, the representation of solid model contains a significant portion of redundant information (such as internal data of the model), which will bring heavy storage burden.
Thus, what is needed is a method and system for creating model data, which will facilitate user to create or store model data.
An aspect of the invention provides a method for creating model data, including: obtaining initial model data that is based on thickness model; adjusting thickness of at least one vertex of the initial model data in response to an user inputting thickness values for the at least one of the vertex; adjusting position of at least one vertex in response to the user inputting position values for the at least one vertex; and obtaining model data that is based on thickness model according to the initial model data and at least one adjusted vertex.
Another aspect of the invention provides a system for creating model data, including: vertex thickness adjusting means for, adjusting thickness of at least one vertex of the initial model data in response to an user inputting thickness values for the at least one of the vertex; vertex position adjusting means for, adjusting position of at least one vertex in response to the user inputting position values for the at least one vertex; and model data generating means for obtaining model data that is based on thickness model according to the initial model data and at least one adjusted vertex.
Another aspect of the invention provides a thickness model including 3D space coordinates of vertices and thickness of vertices, where thickness direction of the vertices are specified in model data file that is based on thickness model.
Another aspect of the invention provides a computer readable article of manufacture tangibly embodying non-transitory computer readable instructions which, when executed, cause a computer to carry out the steps of a method for creating model data, including: obtaining initial model data that is based on thickness model; adjusting thickness of at least one vertex of the initial model data in response to an user inputting thickness values for the at least one of the vertex; adjusting position of at least one vertex in response to the user inputting position values for the at least one vertex; and obtaining model data that is based on thickness model according to the initial model data and at least one adjusted vertex.
The method or system of the invention for generating model data that is based on thickness model makes it very easy to maintain and modify model data that is based on thickness model, user can edit a model by simply adjusting position and thickness of vertex of model data without taking into account correspondence between two layers of surfaces. This greatly facilitates modeling procedure and improves efficiency of modeling. Also, Storage of such model data significantly saves storage space.
In order to describe features and benefits of the embodiment of the invention in detail, the following drawings will be referred to. Where possible, same or similar reference number will be used in drawings and description to denote same or similar part, in which:
The detail description will be presented with reference to exemplary embodiments of the invention, examples of the embodiments are illustrated in the drawings, in which same reference number denote same element throughout the description. It should be appreciated that, the invention is not limited to the disclosed exemplary embodiments. It should also be appreciated that, not every feature of the method and device is necessary for implementing the invention claimed in any one of claims. Further, throughout the disclosure, when a process or method is shown or described, steps of the method can be performed in any order or simultaneously, unless it is obvious from context that one step depends on another step performed previously. Further, there can be significant time interval between steps.
There are many drawbacks in modeling method based on existing mesh model or modeling method based on solid model, and they can not satisfy the need of current or future application. The invention, however, finds a new way and provides a thickness model to overcome one or more drawbacks in the art. As shown in Table 1, a thickness model includes 3D space coordinates X, Y, Z of vertices of model data and thickness values T corresponding to the vertices. However, thickness direction can be arranged flexibly, for example, in model data file, it is uniformly prescribed that all thickness directions are along normal direction of vertex, or that thickness directions point to a same direction (such as a sphere with thickness, vertices thereon all point to centre of the sphere), a same axis (assume that the axis is represented as X=X0, Y=Y0, then thickness direction of any vertex ((Xi, Yi, Zi) on thickness model is ((Xi-X0), (Yi-Y0), 0), where i is a natural number)) and so on. A vertex V of model data based on thickness model can be represented as Vi(Xi, Yi, Zi, Ti). Those skilled in the art can appreciate that, thickness direction of each vertex of model data can also be defined separately, so that a vertex V of model data that is based on thickness model can be represented as Vi(Xi, Yi Zi Ti Dix, Diy, Diz). By connecting each adjacent vertex of model data that is based on thickness model with edges, face with thickness of model data that is based on thickness model can be formed, the detail of which is shown in Table 2. A model file contains vertex list (Table 1) and face list (Table 2). The following is a simple example of model data file that is based on thickness model:
total number of vertices;
total number of faces; thickness direction (such as normal direction, point to fixed point, or point to fixed axis);
vertex list (such as table 1);
face list (such as table 2).
Thickness model is a new way for representing basic model; it is especially suitable to represent object with thickness, and in fact, such object is ubiquitous. The function of thickness model is powerful in that it can flexibly represent model with different thickness at each part by merely maintaining a single-layer structure. It is very easy to maintain and modify model data of a thickness model, a user can edit the model by simply adjusting position of vertex of model data and its accompanying thickness without taking into account correspondence between two layers of surfaces (the two layers can automatically maintain correct correspondence). This significantly facilitates modeling procedure. Based on representation of thickness model, its feature can be further utilized so as to design a series of novel model creating and editing tools, which will greatly facilitate existing operations and provide stronger functions.
In step 203, in response to user inputting thickness values of at least part of vertices of the initial model data, thickness of the at least part of vertices are adjusted respectively. An user can use various input manners, for example, external input devices such as mouse or keyboard; an user can adjust the thickness of part of vertices of the initial model data by choosing part of vertices of the initial model data, stretching or dragging one or more vertices therein, and can also adjust the thickness of part of vertices of the initial model data by the user inputting height value of each vertex respectively. Thickness direction of vertices of initial model data can be directly defined by model data file. An user can also input thickness direction of part of vertices to achieve the required special shape. By adjusting thickness of part of vertices of the initial model data respectively, an user can relatively freely modify and edit model data and does not need to take much consideration in specific position of vertices in thickness direction; moreover, various free choices in thickness direction enhance shaping function. Unlike the present embodiment, existing shaping method can not perform shaping and modeling with respect to free-form surface as needed.
In step 205, in response to an user inputting position values of at least part of vertices of the initial model data, positions of the at least part of vertices are adjusted respectively. An user can also use various input manners, for example, external input devices such as a mouse or keyboard; an user can adjust positions of part of vertices of the initial model data by choosing part of vertices of the initial model data and dragging one or more vertices therein, and can also adjust positions of part of vertices of the initial model data by user inputting 3D coordinate value of each vertex respectively. It is worth noting that, there is no time sequential relationship between the above step 203 and step 205, that is, an user can first adjust positions of part of vertices as needed and then adjust thickness of part of vertices. An user can also only adjust positions of part of vertices, or adjust thickness of part of vertices.
In step 207, model data that is based on thickness model is obtained according to the initial model data and the adjusted at least part of vertices. Position and thickness data of the adjusted part of vertices is recorded; and in conjunction with position, thickness data of unadjusted vertices in initial model data form model data that is based on thickness model. The obtained model data that is based on thickness model saves much more storage space than existing model data that is based on other model and provides operational inconvenience for further modification by subsequent users.
Preferably, after thickness or positions of part of vertices are adjusted, part of vertices of the initial model data can at least be smoothed to obtain model data that is based on thickness model. In virtual world, some model needs rough surface (such as concavo-convex terrain), but some model needs smooth surface to obtain better visual effect. Technical details for smoothing a model can be found in Desbrun, M., Meyer, M., Schröder, P., and Barr, A. H. 1999, Implicit fairing of irregular meshes using diffusion and curvature flow, Proceedings of the 26th Annual Conference on Computer Graphics and interactive Techniques ACM Press/Addison-Wesley Publishing Co., New York, N.Y., 317-324, or Jones, T. R., Durand, F., and Desbrun, M. 2003, Non-iterative, feature-preserving mesh smoothing, ACM Trans. Graph. 22, 3 (July 2003), 943-949. Based on thickness model, various smoothing algorithms can be developed. The following is an exemplary smoothing process embodiment of the invention:
(1) computing adjacent vertex list of each vertex;
(2) updating position and thickness value of each vertex to weighted average of its adjacent vertices;
(3) if the user is satisfied with smooth degree of current model, the process ends; otherwise, computing in step (2) is executed again.
Sometimes, an user is not satisfied with local region of initial model data that is based on thickness model, and desires to further subdivide and modify the region so as to generate a more real shape.
In step 301, in response to the user choosing part of vertices of the initial model data, region formed by the part of vertices is determined. Similarly, the user can use various external input devices to choose part of vertices of the initial model data, for example, inputting region box through keyboard, or choosing a region by using mouse. Region of faces surrounded by edges connecting peripheral vertices in the part of vertices is used as the region formed by the part of vertices.
In step 303, the region formed by the part of vertices is further subdivided to form more vertices that are based on thickness model. If a region of model data that is based on thickness model is to be subdivided, a point can be automatically added at centre of each face of the region and a point is also added at centre of each edge. Then, a face is subdivided into a plurality of faces by connecting centre point in face to centre point in edge correspondingly. Initial position and thickness value of the newly added center vertex can be computed by interpolating surrounding vertices. The above subdividing action can be repeated until a user considers that number of local vertices of model is enough to describe shape of that local region. Also, there are various methods for subdividing a thickness model, such as, Loop subdivision method, the detail of which can be found in Charles Loop: Smooth Subdivision Surfaces Based on Triangles, M.S. Mathematics thesis, University of Utah, 1987, butterfly subdivision method, the detail of which can be found in Dyn, N., Levine, D., and Gregory, J. A. 1990. A butterfly subdivision scheme for surface interpolation with tension control. ACM Trans. Graph. 9, 2 (April 1990), 160-169. All these subdivision methods for triangular face can be extended to thickness model. All vertices can be further adjusted subsequently. When there are more vertices at local region which can be manipulated, more fine shape edit can be performed on the model. An user can also add vertices in corresponding region through, for example, a mouse, and compute thickness of the user added vertices by interpolating thickness of surrounding vertices. With the method for subdividing local region, the present embodiment provides an user with more flexibility in shaping.
An user can utilize modeling tool that is based on thickness model to construct model data that is based on thickness model from the very beginning.
In step 403, relevant geometrical size and thickness value of shape primitives inputted by user are received. First, the user determines relevant geometrical size and thickness value of shape primitives, for example, as for plane, user inputs its length size, width size, and inputs its thickness size at the same time; as for sphere, user inputs, for example, its radius size and thickness value of sphere. Then, according to different accuracy requirement, shaping tool can evenly sample on the plane and connect the sampled points into triangles with thickness one after another.
In step 405, basic faces of shape primitives are determined to obtain respective vertices of initial model data. Since shape is based on one shape primitive, all these shape primitives are single-layer structure with thickness, such as a plane with thickness. These faces with thickness can be regarded as basic face of model, and respective vertices obtained by sampling on basic face are used as respective vertices of initial model data. Preferably, by using the method for subdividing face as described above, more vertices of initial model data can be obtained.
In step 407, thickness values are assigned to respective vertices to form initial model data that is based on thickness model. Thickness values inputted by user are directly assigned to respective vertices of initial model data. As a result, respective vertices have thickness values. The thickness values can be identical, or be different depending on regions, or even all the thickness values of respective vertices are different. After respective vertices and corresponding thickness values and thickness directions are obtained, initial model data that is based on thickness model is obtained. The user can make further edition on the shape according to that initial model data.
Another application scenario is that an user already has model data that is based on existing mesh model (such as triangular mesh model). Due to limitation in editing tool that is based on existing model, the user can not obtain satisfying model data. It can be considered to convert model data that is based on existing model to initial model data that is based on thickness model.
In step 503, the unknown numbers are solved to obtain optimized initial model data, the optimized initial model data makes a sum of distance from each point in model data that is based on mesh model to initial model data be the smallest. Since positions and directions of vertices in thickness model are all unknown numbers, optimization object function needs to be established so as to solve the unknown numbers. Assume that original mesh model contains n vertices, n is a natural number, distance from each vertex P, to new thickness model is represented as function fi, about vertex on thickness model, then the optimization object function is F=fi+f2+ . . . -fn, fi is distance from each vertex Pi to new thickness model S. Where, fi=d(Pi,S)=minTjεS) d(Pi, Tj), d(Pi,S) represents distance from vertex Pi to new thickness model S, Tj is any triangular face with thickness in thickness model, d(Pi, Tj) represents distance from vertex Pi to new triangular face with thickness Tj, min( ) is a minimum value function, and d(Pi, Tj)=min(dj1, dj2), dj1, dj2 are distances from vertex Pi to two (upper and lower) triangular faces of triangular face with thickness, where detailed method for obtaining two (upper and lower) faces of one triangular face with thickness can be found in
In step 505, distances from each point in model data that is based on mesh model to initial model data are computed. Detailed algorithm for calculating distance from each point in model data that is based on mesh model to initial model data can be found in the above document.
In step 507, if all the distances are already smaller than or equal to preset threshold E (such as E is set as 0.5% of total model size), the initial model data is used as initial model data that is based on thickness model.
In step 509, if there is a vertex in model data of mesh model from which the distance to initial model data is larger than preset threshold, then the above subdivision method can be employed, that is, on a face of initial model data that is closest to the vertex, a new vertex that is based on thickness model is added, and the process returns to the above step 503 to perform further computation so as to finally obtain initial model data that is based on thickness model.
In step 603, each part is converted into initial model data that is based on thickness model respectively. Converting each part into initial model data that is based on thickness model respectively can be performed according to the method shown in
Based on the above-described method, an example of shaping kneeling chair by user will be exemplarily explained below. An user first chooses a plane with uniform thickness as shape primitive through an editing tool that is based on thickness model. The user sets size and thickness of the plane so as to construct a plane model, and adjusts angle of the entire plane and makes it slightly incline backwards. By changing positions of some vertices on the plane, shape of the plane is slightly bended, and then thicknesses of model vertices are adjusted so as to make gradual change in thicknesses from bottom to top. Now, details need to be added into the model: a local region into which details need to be added can be chose and is subdivided so that it will have more vertices. The user adjusts thickness of local vertices in this region to form a shape with protuberance in the centre, and the change in this part is reproduced to other parts of the model. The entire model is smoothed, such that modeling of chair's backboard is complete. Next, parts such as chair's plane, armrest, chair's leg can be modeled.
Since existing rendering technology and many shape editing tools mainly are based on existing mesh model, there is a need to convert model data that is based on thickness model to model data that is based on existing mesh model.
The invention also provides a system 900 for creating model data, and
Preferably, system 900 further includes means for, in response to user choosing part of vertices of the initial model data, determining region formed by the part of vertices; and means for further subdividing the region formed by the part of vertices to form more vertices that are based on thickness model.
Preferably, the initial model data obtaining means 901 further includes: means for obtaining shape primitives; means for receiving relevant geometrical size and thickness value of shape primitives inputted by user; means for determining basic faces of shape primitives to obtain respective vertices of initial model data; means for assigning thickness values to respective vertices to form initial model data that is based on thickness model.
Preferably, the initial model data obtaining means 901 includes: means for converting model data that is based on mesh model to initial model data that is based on thickness model.
Preferably, the means for converting model data that is based on mesh model to initial model data that is based on thickness model includes: means for constructing initial model data that is based on thickness model and based on shape primitives, specifying thickness direction of vertices of initial model data, and using position and thickness of vertices of initial model data as unknown numbers; means for solving the unknown numbers to obtain optimized initial model data, the optimized initial model data making a sum of distance from each point in model data that is based on mesh model to initial model data be the smallest; means for computing distance from each point in model data that is based on mesh model to initial model data; means for, if all the distances are smaller than or equal to preset threshold, using the initial model data as model data that is based on thickness model; means for, if there is a vertex in model data of mesh model from which the distance to initial model data is larger than preset threshold, then on a face of initial model data that is closest to the vertex, adding a new vertex that is based on thickness model.
Preferably, the system 900 further includes: means for dividing the model data that is based on mesh model into multiple parts according to semantics; means for converting each part into initial model data that is based on thickness model respectively; and means for combining initial model data that is based on thickness model corresponded to each part.
Preferably, the system 900 further includes: means for generating a new vertex along thickness direction of each vertex of model data that is based on thickness model respectively, the distance between the each vertex and the new vertex is thickness value of each original vertex; and means for connecting an edge between adjacent new vertices to form new model data that is based on mesh model.
Preferably, the system 900 further includes: means for, if a vertex is originally on boundary of the model data that is based on thickness model, connecting an edge between that vertex and new vertex corresponded to that vertex.
Preferably, the thickness model comprises 3D space coordinates of vertex and thickness of vertex.
Preferably, thickness directions of the vertices are specified in model data file that is based on thickness model.
Further, the method for the invention for creating model data can also be implemented by computer program product, the computer program product includes software code portions for implementing the simulation method for the invention when the computer program product is running on the computer.
The invention can also be implemented by recording a computer program in computer readable record medium, the computer program includes software code portions for implementing the simulation method for the invention when the computer program is running on the computer. That is, the procedure of simulation method according to the invention can be distributed in form of instructions within computer readable medium and various other forms regardless of particular type of signal bearing medium for actually performing the distribution. Examples of computer readable medium include media such as EPROM, ROM, magnetic tape, paper, floppy disk, hard drive, RAM and CD-ROM and transmission media such as digital and analog transmission link.
Although the invention has been particularly shown and described with reference to preferred embodiments of the invention, those skilled in the art will appreciate that, various modifications in forms and details thereof can be made without departing from the scope and spirit of the invention defined by appended claims.
Number | Date | Country | Kind |
---|---|---|---|
201010506180.2 | Sep 2010 | CN | national |