Surface sheet generation method and apparatus

By generating an initial patch and splitting it into target patches based on texture direction and topology, the problem of low accuracy in patch creation in existing technologies is solved, and patch generation is simplified and its accuracy is improved.

CN115512004BActive Publication Date: 2026-06-19NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2022-08-26
Publication Date
2026-06-19

Smart Images

  • Figure CN115512004B_ABST
    Figure CN115512004B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for generating facets. The method includes: acquiring a texture map, wherein the texture map includes at least a drawing pattern; generating an initial facet corresponding to the drawing pattern based on the color values ​​in the texture map; splitting the initial facet based on the texture direction and topology of the initial facet to generate multiple line segments, wherein the multiple line segments are generated based on the first vertex located at the edge of the initial facet, and the topological flow of the multiple line segments has the same orientation; and generating a target facet corresponding to the drawing pattern based on the multiple line segments. This invention solves the technical problem of low accuracy in facet creation in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically, to a method and apparatus for generating facets. Background Technology

[0002] Currently, in the development of various games and films, when specific requirements arise, users need to generate corresponding entity patches based on the texture of a texture map. However, in existing technologies, users need to manually create patches based on nodes each time, which is a cumbersome process and results in low accuracy of patch creation.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] At least some embodiments of the present invention provide a method and apparatus for generating face patches, so as to at least solve the technical problem of low accuracy in creating face patches in related technologies.

[0005] According to one embodiment of the present invention, a method for generating a patch is provided, comprising: acquiring a texture map, wherein the texture map includes at least a drawing pattern; generating an initial patch corresponding to the drawing pattern based on color values ​​in the texture map; splitting the initial patch based on the texture direction and topology of the initial patch to generate multiple line segments, wherein the multiple line segments are generated based on a first vertex located on the edge of the initial patch, and the topological flow of the multiple line segments has the same orientation; and generating a target patch corresponding to the drawing pattern based on the multiple line segments.

[0006] According to one embodiment of the present invention, a patch generation apparatus is also provided, comprising: a texture acquisition module for acquiring a texture map, wherein the texture map includes at least a drawing pattern; a first patch generation module for generating an initial patch corresponding to the drawing pattern based on color values ​​in the texture map; a line segment generation module for splitting the initial patch based on the texture direction and topology of the initial patch to generate multiple line segments, wherein the multiple line segments are generated based on a first vertex located on the edge of the initial patch, and the topological flow of the multiple line segments has the same orientation; and a second patch generation module for generating a target patch corresponding to the drawing pattern based on the multiple line segments.

[0007] According to one embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to execute the patch generation method of any of the above claims at runtime.

[0008] According to one embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the patch generation method of any of the above claims.

[0009] In at least some embodiments of the present invention, after obtaining the texture map, an initial patch corresponding to the drawing pattern is generated based on the color values ​​in the texture map. The initial patch is then split into multiple line segments based on its texture direction and topology. Finally, a target patch corresponding to the drawing pattern is generated based on these multiple line segments. It is noteworthy that the multiple line segments are obtained by splitting the initial patch based on its texture direction and topology, and the target patch is generated from these multiple line segments. This achieves the goal of accurately obtaining the patch required by the user, thereby improving the accuracy of patch creation and solving the technical problem of low accuracy in patch creation in related technologies. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0011] Figure 1 This is a hardware structure block diagram of a mobile terminal according to an embodiment of the present invention, which describes a method for generating a patch.

[0012] Figure 2 This is a flowchart of a method for generating a facet according to an embodiment of the present invention;

[0013] Figure 3 This is an optional texture mapping schematic diagram according to an embodiment of the present invention;

[0014] Figure 4 This is an optional layered structure formed by gathering initial facets according to a preset scaling ratio, according to an embodiment of the present invention.

[0015] Figure 5 This is a schematic diagram of an optional multi-strip structure according to an embodiment of the present invention;

[0016] Figure 6 This is a schematic diagram of an optional retopological re-formation of an initial patch into a closed patch according to an embodiment of the present invention;

[0017] Figure 7 This is a schematic diagram of an optional process for obtaining a target line segment according to an embodiment of the present invention;

[0018] Figure 8 This is a schematic diagram of an optional reference point on the center line as an initial facet according to an embodiment of the present invention;

[0019] Figure 9 This is an optional schematic diagram for determining positional relationships according to an embodiment of the present invention;

[0020] Figure 10 This is a schematic diagram of an optional method for obtaining an annular closed surface according to an embodiment of the present invention;

[0021] Figure 11 This is a schematic diagram illustrating the splitting of a closed surface according to an embodiment of the present invention;

[0022] Figure 12 This is a schematic diagram of an optional pair-face unhooking operation according to an embodiment of the present invention;

[0023] Figure 13 This is a schematic diagram of an optional operation to unfasten the rings on other sub-panels according to an embodiment of the present invention;

[0024] Figure 14 This is a schematic diagram illustrating the flipping of a line segment according to an embodiment of the present invention;

[0025] Figure 15 This is a schematic diagram of an optional automated data splitting method according to an embodiment of the present invention;

[0026] Figure 16 This is a schematic diagram of an optional method for generating topological patches based on line segments according to an embodiment of the present invention;

[0027] Figure 17 This is a structural block diagram of a sheet-forming apparatus according to an embodiment of the present invention;

[0028] Figure 18 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] According to one embodiment of the present invention, an embodiment of a patch generation method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0032] This method embodiment can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smartphone (such as an Android phone, iOS phone, etc.), tablet computer, PDA, mobile Internet Device (MID), PAD, game console, and other terminal devices. Figure 1 This is a hardware structure block diagram of a mobile terminal for a patch generation method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data are also shown. Optionally, the mobile terminal may further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0033] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the patch generation method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the aforementioned patch generation method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0035] The inputs in input / output device 108 can come from multiple human interface devices (HIDs). Examples include keyboards and mice, gamepads, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, and remote controls). Some HIDs, in addition to providing input functions, can also provide output functions, such as force feedback and vibration from gamepads, and audio output from controllers.

[0036] Display device 110 may be, for example, a head-up display (HUD), a touchscreen liquid crystal display (LCD), and a touch display (also referred to as a "touchscreen" or "touch display"). The LCD allows a user to interact with the user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), which allows the user to interact with the GUI by touching and / or gesturing on a touch-sensitive surface. Optional human-computer interaction functions include: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, a call interface, playing digital video, playing digital music, and / or web browsing, etc. Executable instructions for performing the above human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0037] In one possible implementation, embodiments of the present invention provide a method for generating facets. Figure 2 This is a flowchart of a patch generation method according to one embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:

[0038] Step S202: Obtain a texture map, wherein the texture map includes at least: drawing a pattern.

[0039] The aforementioned drawing patterns can be manually drawn by art users and require the generation of corresponding models. For example, in the case of a game scene, the drawing pattern can be a flower pattern that requires the generation of models, but it is not limited to this.

[0040] The texture maps mentioned above can be the texture maps corresponding to the drawn patterns obtained by the user through modeling software. Figure 3 This is a schematic diagram of an optional texture mapping according to an embodiment of the present invention, such as... Figure 3 As shown, texture maps in digital imaging are maps that are stitched together from pixels and presented on the display with differences in black, white, and gray.

[0041] In one alternative embodiment, the user-drawn pattern can first be used to obtain a texture map corresponding to the drawn pattern through modeling software. After obtaining the texture map, software tools can process the texture map to obtain the virtual model required by the user.

[0042] Step S204: Generate the initial patch corresponding to the drawing pattern based on the color values ​​in the texture map.

[0043] The color values ​​mentioned above can be the black and white values ​​of each pixel in the texture map.

[0044] In one alternative embodiment, the texture map can first be transmitted using PNG 8-bit floating-point format based on the black and white values ​​in the texture map. Then, the texture map can be picked up through the Houdini_traceNode_Sop node to form an instance of the entire base map model. Based on the idea of ​​iterative processing, the entire piece of drawing pattern is processed to form the initial patch corresponding to the drawing pattern.

[0045] It should be noted that texture maps can be transferred not only via PNG 8-bit floating-point format, but also via formats such as JPG / EXR. Iterative thinking refers to repeatedly picking up texture maps using the Houdini_traceNode_Sop node to form patches.

[0046] Step S206: The initial face is split based on the texture direction and topology of the initial face to generate multiple line segments. The multiple line segments are generated based on the first vertex located on the edge of the initial face, and the topological flow of the multiple line segments has the same orientation.

[0047] The aforementioned texture direction can be the direction in which the black, white, and gray levels of the initial patch change in various directions.

[0048] The aforementioned topology can be the point, line, and surface layout, structure, and connection of the initial patch model, reflecting the structural characteristics of the drawn pattern. It can be determined based on the skeleton pattern lines of the initial patch and the first vertex on the edge of the initial patch. For example, it can be a structure that starts from a vertex on the skeleton pattern line and connects to the vertex on the edge of the initial patch.

[0049] The aforementioned topological flow orientation can be obtained by numbering the first vertex located at the edge of the initial patch and then connecting them sequentially in ascending order of their numbers.

[0050] In one alternative implementation, the initial facet can be split based on its texture orientation and topology using the Houdini_Delete_Sop node, resulting in multiple line segments. These multiple line segments are formed by connecting the first vertices located at the edges of the initial facet. The topological flow of these multiple line segments is the same, meaning they are connected sequentially according to the ascending numbering of the first vertices.

[0051] It should be noted that the multiple line segments in the above steps are still considered as primitive structures and will not be perceived as an independent geometric structure. It is just that this primitive structure is a topological model shaped like a line segment.

[0052] In this embodiment of the invention, splitting the initial facet based on its texture direction and topology to generate multiple line segments includes: converging the edges of the initial facet to generate a skeleton pattern line of the initial facet; grouping the first vertices on the initial facet based on the skeleton pattern line to obtain multiple vertex sets; and splitting the initial facet based on the multiple vertex sets to generate multiple line segments, wherein the multiple vertex sets and the multiple line segments have a one-to-one correspondence.

[0053] The aforementioned skeleton-style spline can refer to the center line of the initial facet. Optionally, the skeleton-style spline of the initial facet can be generated by the following steps: gathering the edges of the initial facet according to a preset scaling ratio to obtain a layered structure; generating multiple splines based on the second vertex of the ring edge of each layer in the layered structure; and accumulating the lengths of the multiple splines to obtain the skeleton-style spline.

[0054] The preset ratio mentioned above can be the minimum scaling ratio. According to the preset scaling ratio, the initial patch can be scaled to the minimum structure. Figure 4 This is an optional layered structure formed by gathering initial facets according to a preset scaling ratio, as described in an embodiment of the present invention. Figure 4 As shown, after the initial facets are gathered together, multiple layered structures are obtained.

[0055] The second vertex mentioned above can be a vertex on the ring edge of each layer in the clustered layered structure.

[0056] The aforementioned multiple template lines can be obtained by connecting the corresponding vertices on each layer of the ring edge level by level, resembling the beams or ridges of a building's framework. It should be noted that the template edges of the desired pattern can be drawn by connecting the center points of the edge pixel grid. Furthermore, the interconnected template lines can form operable patches in the software.

[0057] The aforementioned skeleton-like spline can be obtained by iteratively integrating and summing the lengths of multiple splines, with the longest distance corresponding to the spline. It should be noted that by using the skeleton-like spline as the central axis of the irregular plane, it can be distinguished that the current irregular plane is composed of multiple regions of different shapes pieced together.

[0058] Figure 5 This is a schematic diagram of an optional multi-slot structure according to an embodiment of the present invention, such as... Figure 5 As shown, connecting the vertices of each layered structure step by step yields multiple splines. Then, by summing the lengths of these multiple splines, a skeleton-type spline can be obtained.

[0059] In one optional embodiment, the initial facets are first gathered according to a preset ratio to obtain a layered structure and second vertices. The second vertices are the vertices on the ring edges of each layer in the layered structure. Next, each second vertices can be connected level by level to obtain multiple splines. Finally, the lengths of the multiple splines are summed, and the spline with the longest distance is selected to obtain the skeleton spline.

[0060] The aforementioned multiple vertex sets can be obtained by polarizing the vertices located at the edges (i.e., the first vertex mentioned above) based on the skeleton template. Since the skeleton template is the center line of the initial patch, the vertices located at the edges can be divided into two sets, representing the vertices located on both sides of the skeleton template, and the vertices in different sets can be assigned the value 1 or -1. Optionally, the first vertex can be grouped to obtain multiple vertex sets through the following steps: retopologically remodeling the initial patch to generate a closed patch; merging the reference vertex on the skeleton template with the second vertex on the closed patch to generate the target line segment of the closed patch, wherein the second vertex is located at the center of the closed patch; determining the positional relationship between the first vertex in the closed patch and the target line segment; and grouping the first vertex based on the positional relationship to obtain multiple vertex sets.

[0061] The aforementioned closed surface can be a surface obtained by connecting the edges and center vertices of the surface in sequence.

[0062] The aforementioned reference vertex can be a vertex on the skeleton pattern line, and the second vertex can be a point located at the center of the closed patch.

[0063] The target line segment mentioned above can be the center line of a closed surface, which is consistent with the skeleton pattern line.

[0064] The above positional relationships can be left-right or up-down, but are not limited to these.

[0065] In one alternative embodiment, Figure 6 This is a schematic diagram of an optional topological retopology of an initial patch to form a closed patch according to an embodiment of the present invention, as shown below. Figure 6 As shown, firstly, the initial facet can be retopologically regenerated using the Houdini_PolyExpand_2d_Sop node to generate a closed facet. Secondly, the reference vertex on the skeleton pattern line can be merged with the vertex at the center of the closed facet. By merging the positions of this vertex and the reference vertex, the centerline of the closed facet can be obtained, allowing the centerline to fit the skeleton pattern line. Then, the positional relationship between the first vertex located at the edge of the closed facet and the centerline can be determined. For example, the first vertex could be located to the left of the centerline, or it could be located to the right of the centerline, but it is not limited to these two possibilities. Finally, the first vertices can be grouped based on their positional relationships to obtain multiple vertex sets. For example, the first vertices located to the left of the centerline can be grouped into one set, and the first vertices located to the right of the centerline can be grouped into another set, but it is not limited to these two possibilities.

[0066] Optionally, the target line segment of the closed face can be generated by merging the reference vertex on the skeleton pattern line with the second vertex on the closed face through the following steps: determine the vertex that is closest to the second vertex among the reference vertices to obtain the first target vertex corresponding to the second vertex; and converge the position of the second vertex to the position of the target vertex to generate the target line segment.

[0067] In one alternative embodiment, Figure 7 This is a schematic diagram of an optional process for obtaining a target line segment according to an embodiment of the present invention, such as... Figure 7 As shown, the `nearpoint()` function can be used to traverse all target points (i.e., the second vertex mentioned above) with a reference point as the baseline. Each target point will find the nearest reference point and record its number, assigning it to the integer variable `nearpts` (i.e., the first target vertex). Then, the `point()` function uses the `nearpts` variable as a parameter to converge the absolute position of the target point to the position of the found reference point. The returned new position is then stored in the vector variable `nearpts_pos`, thus obtaining the target line segment.

[0068] Optionally, the positional relationship between the first vertex in the closed face and the target line segment can be determined by the following steps: determining the vertex on the target line segment that is closest to the first vertex, and obtaining the second target vertex corresponding to the first vertex; determining the third target vertex on the target line segment that is connected to the second target vertex; and obtaining the positional relationship based on the coordinates of the third target vertex and the coordinates of the first vertex.

[0069] In one optional embodiment, the point closest to the centerline can first be searched, and the vertex numbers found are stored in the integer variable `op0_nearPts`. Using these vertex numbers, the absolute positions of each vertex on the centerline can be determined. Subtracting the absolute positions of all the vertices from the absolute positions of the centerline points yields a vector value. This vector value is then assigned to the vector variable `outSideDir`. It's important to note that this variable stores a vector value with a scaling factor, but as a reference marker, the scaling factor is not considered; only a standardized unit of measurement is needed. The vector value obtained above is then standardized using the `normalize()` function.

[0070] It's important to note that in practice, users don't treat lines as surfaces. However, in the tool, due to the concept of primitives, line segments include the outline of the current surface. Therefore, users can abstractly understand that the outline has the concept of a surface. To merge multiple separate outlines back together to form a new surface, it's necessary to ensure that the vertex order, vertex orientation, and vertex count of all outlines are consistent to generate the correct new topological surface. Based on the new surface, a velocity direction can be obtained by subtracting vectors from the positions of the same vertices.

[0071] Figure 8 This is a schematic diagram illustrating an optional reference point on the center line as a reference volume for the initial patch according to an embodiment of the present invention, such as... Figure 8 As shown, the function feeds back the vertex numbers on the center line to the vertices of the initial face, then iterates through each vertex on the face, searching for interconnecting factors with reference to the vertex numbers on the center line, and storing the results in the `op1_neighbours` array variable. The purpose of this step is to determine the directional relationship between points on the edge of an initial face and points on the center line. For example, if the vertex number on the center line closest to points 4, 5, and 6 on the initial face is 1, then the vertex number on the center line closest to the face is 1. Furthermore, using the center line vertex numbers as parameters in the function for searching adjacent vertices, returning the points on the center line also returns the number of adjacent points and their corresponding numbers, i.e., [2,0]. Here, [2,0] represents two adjacent points, 2 represents one adjacent point with number 2, and 0 represents one adjacent point with number 0.

[0072] It should be noted that the `neighbourcount()` function can return the number of values ​​in an array. If the `op1_neigCount` value stored for a vertex on the edge is 2, it indicates that the edge vertex is located on either side of the center line, but it cannot determine which side of the center line segment the point on the edge is located on (i.e., the left-right relationship is unclear). For the value with array index zero, the corresponding vertex number is looked up, and the absolute coordinates of vertex p0 are returned. For the value with array index one, the corresponding vertex number is looked up, and the absolute coordinates of vertex p1 are returned. If the `op1_neigCount` value stored for a vertex on the edge is 1, it means that the vertex is located at the top of the center line, in a vertical orientation.

[0073] Figure 9 This is an optional schematic diagram of determining positional relationships according to an embodiment of the present invention, such as... Figure 9As shown, if a vector line segment ->p0p1 exists in space, and assuming points A and B exist in space respectively, if point A is to the left of the line segment, then cond_1 is positive; conversely, if point B is to the right of the line segment, then cond_1 is negative. Combining this with the vertices on the edge line, which already store array data for searching connected vertex numbers with reference to the center line vertex, this data is then substituted into... Figure 8 In the initial face, vertex numbered 6 is located on the edge of the face, and the vertex on the center line closest to vertex number 6 is numbered 1. Then, for vertex numbered 1 on the center line, the two vertices connected to it on the center lines are searched and numbered 0 and 2 respectively. These numbers are stored in the array [0,2] and returned to the initial face. The edge point numbered 6 is then treated as... Figure 9 The vertex orientation of v@P is determined, while the two endpoints p0 and p1 are simulated by the positions of vertices numbered 0 and 2. The entire code block in this section describes how to detect which side of the center line an edge point is located in the same spatial coordinates. If the length of the array returned by the point on the edge line is 1, it means that the currently sampled edge point is located at the top of the center line, in an up-down orientation, and is planned to one side using constants.

[0074] Optionally, the initial face can be split into multiple line segments by the following steps: determining a preset vertex in multiple vertex sets, wherein the number of vertices adjacent to the preset vertex in the multiple vertex sets is less than a preset value; obtaining the first number of the preset vertex in the initial face; splitting the initial face based on the first number to obtain multiple sub-faces; and performing a de-looping operation on the multiple sub-faces to generate multiple line segments.

[0075] The aforementioned preset vertices can be non-vertical endpoints, where non-vertical endpoints can be points located at both ends of the center line, and the values ​​assigned to adjacent vertices of non-vertical endpoints differ.

[0076] The aforementioned preset value can be a value that reflects the number of vertices adjacent to the opposite endpoint. Since the opposite endpoint is located at both ends of the center line, there is only one vertex connected to the opposite endpoint, so the preset value can be 2.

[0077] The first number mentioned above can be the number of the opposite endpoint in the initial facet, and it can be 0, but it is not limited to this.

[0078] In one alternative embodiment, firstly, the different endpoints in multiple sets of vertices can be identified, wherein the number of vertices adjacent to the different endpoints is less than 2; secondly, the first number of the different endpoint in the initial face can be obtained, and the initial face can be split based on the first number to obtain multiple sub-faces; finally, the closed sub-faces can be unlinked through the Houdini_Add_Sop node, and all vertices can be retained.

[0079] Figure 10This is a schematic diagram of an optional method for obtaining an annular closed surface according to an embodiment of the present invention, such as... Figure 10 As shown, the `neighbours()` function can be used to traverse each vertex, allowing each vertex to query itself and inform it of its adjacent points. The resulting vertex numbers are stored in the `neighbours` array variable. Two new integer variables, `p0Side` and `p1Side`, are added to traverse all vertices again, referencing the stored adjacent vertex numbers. Once a specific number is obtained, the `i@side` value of the corresponding number is queried, and the result is placed in the previously mentioned integer variables. The integer array variable `diffPts` is set; currently, its internal value is empty. If the stored values ​​of `p0Side` and `p1Side` of the connected points are different, it proves that there are at least two vertices that differ in the current closed-loop structure. All the numbers of the opposite endpoints are then included in the `diffPts` array. That is, after determining the orientation of the edge vertices distributed on both sides of the center line, the topology of the initial facet can be cleared using `Houdini_Divide_Sop`, retaining only the basic shape of the closed loop. Based on the different stored values ​​of the vertices `i@side` on the edge lines, polarized grouping of the edge vertices is achieved. The i@side value can be a value that stores information about whether a vertex is located on either side of or above the center line. For example, when the i@side value is 1, it can indicate that the corresponding vertex is above the center line, but it is not limited to this.

[0080] It should be noted that the Houdini_Embroidery_integrate_integrate_Sop node can be used to perform multi-segment extraction of the skeleton spline using a nested approach. Then, the two endpoints closest to the skeleton spline will be located on the outline of the patch. By assigning two different values, a polarization distinction is made, and the sum of all the results is the complete differentiation of the outline of the irregular patch.

[0081] In an optional embodiment, a new integer array variable `breakpts` can be created, with an empty array value. The `npoints()` function is used to determine the limiting value of the condition statement in the `for` loop expression. The function returns the total number of vertices of the current closed face. Since the number of the outlier endpoint is always less than the total number of vertices of the face, it is used as the limiting condition. When the traversal requirements are met, a local array variable `getData[]` is created in the `for` loop code block, and the upstream provided `diffPts` integer array data is accessed. The specific length of the `getData` array is returned. If the current vertex has a difference value, its array length is not empty. Then the code will reference the vertex numbers that meet the conditions and expand them all into the `breakpts` integer array.

[0082] Figure 11This is a schematic diagram illustrating the splitting of a closed panel according to an embodiment of the present invention, as shown below. Figure 11 As shown, after obtaining the vertex numbers at all outliers, the current closed-loop structure can be split. This can be done through the Houdini_Delete_Sop node, based on the differences in the existing i@side values ​​on the vertices, splitting it into two different closed-loop patches. Because Houdini software processes a closed-loop patch by default, without performing any ring opening operations, it will still consider the newly split part to be a closed-loop structure.

[0083] In another optional embodiment, a global variable `trigger` can be set first, with a default value of 0. This iterates through all vertices at the off-ends, feeding back the absolute position data of the off-ends in the original closed-loop patch (without splitting) to the vertices of the split closed-loop structure. Since the numbers are mutually corresponding, they can be directly referenced. The queried value is then assigned to the `op1_pos` vector variable. Using the `nearpoint()` function, since the positions of the off-ends in the original closed-loop structure are known, and the split structure is only structurally split (the initial positions of each vertex have no displacement changes), under the premise of unified absolute positions, it essentially references the off-end numbers of the original closed-loop structure to search for the split closed-loop structure. The final return value is actually the vertex number of the new split structure at the original off-end position. If the split closed-loop structure is in the area with vertex number 0, it proves that it is the beginning of a broken part of the original structure. Figure 11 The analysis shows that the point numbered 0 searches for the other two vertices 1 and 33 that are connected to it, and stores them in the array variable adjtPts as an integer array of [1,33]. It then queries the absolute positions corresponding to the two parts 1 and 33 and stores them in the variables s0 and s1 respectively. Finally, it uses the length() function to calculate the displacement of point 0 with respect to points 1 and 33 and stores it in dist0 and dist1 respectively. If the length of the connection points on both sides of the top is greater than that on the other side, the global variable trigger, which was previously stored at this endpoint, is automatically incremented by 1, but this is only recorded once before the loop terminates.

[0084] Optionally, multiple sub-faces can be de-looped to generate multiple line segments by performing the following steps: de-looping on multiple sub-faces to obtain multiple sets of sub-vertexes, wherein the multiple sets of sub-vertexes have a one-to-one correspondence with the multiple sub-faces; and generate multiple line segments based on the second number of each sub-vertex in the multiple sets of sub-vertexes.

[0085] The second number mentioned above can be the number of each sub-vertex in the set of sub-vertexes in the initial face.

[0086] In one optional embodiment, the loop-unlocking operation can first be performed on multiple sub-faces to obtain multiple sets of sub-vertices, wherein each set of sub-vertices corresponds one-to-one with a set of sub-faces. Finally, a second number can be obtained by numbering each vertex in the multiple unlocked sub-faces based on the multiple sets of sub-vertices, thus obtaining multiple line segments.

[0087] Figure 12 This is a schematic diagram of an optional pair-face unhooking operation according to an embodiment of the present invention, as shown below. Figure 12 As shown, firstly, the Houdini_Add_Sop node can be used to remove loops from sub-faces while retaining the vertices in the regular sorting. Because the correct numbering and sorting of the line segments are done in advance, when this node is referenced, the new line segment required by the user will be generated based on the consecutive numbering behavior between each vertex. Secondly, the Houdini_Resample_Sop node can be used to resample the total number of vertices of the two line segments to ensure that the total number of vertices of each segment is the same.

[0088] Figure 13 This is a schematic diagram of an optional operation to release the rings from other sub-facets according to an embodiment of the present invention. The operation principle is the same as... Figure 12 The principle is the same as that in the previous section, so I will not go into details here.

[0089] Optionally, multiple line segments can be generated by the following steps: connecting the child vertices based on the second number of each child vertex to obtain multiple sub-line segments; and flipping the target coordinates of the target child nodes in the target sub-line segment to obtain multiple line segments.

[0090] The target sub-segment can be any one or more sub-segments; the target sub-node can be a vertex in the target sub-segment; the target coordinates can be U-coordinates.

[0091] In one alternative embodiment, the child vertices can first be connected based on the second number to obtain multiple sub-segments. Figure 14 This is a schematic diagram illustrating the flipping of a line segment according to an embodiment of the present invention, as shown below. Figure 14 As shown, because the user needs to ensure that the starting direction of the topology flow of multiple line segments is consistent, it is necessary to reverse the U direction of the target line segment through the Houdini_Reverse_Sop node. Since the newly generated multiple line segments are derived from the original closed-loop structure, the newly generated multiple line segments still have not broken away from the clockwise direction of the original structure. Therefore, it is necessary to flip the line segments in the opposite direction so that the topology flow of all line segments is consistent.

[0092] In this embodiment of the invention, after splitting the initial face based on a preset vertex to obtain multiple sub-faces, the method further includes: determining a third number corresponding to the preset vertex in the multiple sub-faces; in response to the third number not being a preset number, the numbers of the multiple sub-faces are offset so that the third number corresponding to the preset vertex in the multiple sub-faces is a preset number.

[0093] The third number mentioned above can be the number of the opposite endpoint in the initial facet, and the preset number mentioned above can be a number that can reflect the opposite endpoint as the starting point. For example, the preset number mentioned above can be 0.

[0094] In one alternative embodiment, the starting point number corresponding to the different endpoints in the multiple sub-patches can first be determined. In response to the starting point number not being 0, the numbers of the multiple sub-patches can be offset so that the starting point number corresponding to the different endpoints in the multiple sub-patches is 0.

[0095] Optionally, if the segmentation of a primitive facet is asymmetrical, the numbering of its structural endpoints may not begin with the value zero. To address this issue, the tool employs a protection mechanism, referencing the Houdini_Switch_Sop node. By differentiating the upstream data i@trigger values, it performs automatic data splitting. If the vertex at the off-end of the closed-loop structure starts with a zero value, the data flows directly downstream. If the vertex at the off-end of the closed-loop structure starts with a non-zero value, the Houdini_Sort_Sop node is used to shift the vertex at the current zero position to the off-end structure, ensuring that a "clean and complete" line segment is obtained, guaranteeing that the starting number at the off-end is zero.

[0096] Optionally, regarding the division of UV values ​​and the calculation of tangent values, when generating different groups of contour lines, two different arrays of vector data (0,@uv.y.0) and (1,@uv.y.0) can be assigned. The tangent value is obtained by offsetting the point index of the current patch using Houdini_sortNode_Sop after generating a new patch, and then performing a calculation between the former as the offset point index position and the latter point position. The resulting scalarized value is the tangent value.

[0097] Figure 15 This is a schematic diagram of an optional automated data splitting method according to an embodiment of the present invention, such as... Figure 15As shown, the data of diffPts is generated by the difference in the value of i@side. Under normal circumstances, the new interface after splitting will always have one end starting with position zero. However, if the zero position is not at the original end, the length value of diffPts will be 0. Although automation may not always obtain a perfect split structure when dealing with different primitive shapes, the tool can at least detect the end position of the closed loop structure itself after splitting. However, compared with the normal split that starts with zero as the end position, the end position number of this type of closed loop structure is a dynamic value. As long as there is an end position, they will have a difference in the integer value of i@trig. Now, using the findattribval() function, a reverse relationship is used to traverse the vertices on the entire closed loop face. First, it detects which vertex has the value of i@trig as 1. All points that meet the condition are retrieved and stored in the integer array variable index[].

[0098] Step S208: Based on multiple line segments, generate the target surface corresponding to the drawn pattern.

[0099] In one alternative embodiment, Figure 16 This is a schematic diagram of an optional topological patch generation method based on line segments according to an embodiment of the present invention, such as... Figure 16 As shown, if the topological flow of multiple line segments is consistent, the topological patches required by the art can be formed through the Houdini_Skin_Sop node. If the Houdini_Reverse_Sop node is not involved to break the non-uniform flow process, an "erroneous" topological structure that is not needed for production will be formed.

[0100] In another optional embodiment, after obtaining the target patch, the target patch can be rendered using preset texture information to obtain a virtual model corresponding to the rendered pattern.

[0101] The aforementioned preset texture information can be pre-set; further, it can be pre-set by the user; and even further, it can be texture information pre-set by the user that can obtain the desired virtual model. The virtual model is displayed in a graphical user interface provided through the terminal device.

[0102] It should be noted that the terminal device may include, but is not limited to, mobile phones, computers and tablets, but is not specifically limited in this embodiment.

[0103] It should be noted that the topological structure of the target patch follows the direction of the texture of the drawn pattern, making it convenient to render this model using a continuous four-sided texture to obtain the aforementioned virtual model, which is then displayed in the graphical user interface. Here, the continuous four-sided texture can refer to an image divided into a nine-square grid, with the central square as a template, and each side corresponding to one of the remaining squares. On a two-dimensional screen, the user can select any area as the display center; therefore, it can be understood as a continuous four-sided texture control.

[0104] In at least some embodiments of the present invention, after obtaining the texture map, an initial patch corresponding to the drawing pattern is generated based on the color values ​​in the texture map. The initial patch is then split into multiple line segments based on its texture direction and topology. Finally, a target patch corresponding to the drawing pattern is generated based on these multiple line segments. It is noteworthy that the multiple line segments are obtained by splitting the initial patch based on its texture direction and topology, and the target patch is generated from these multiple line segments. This achieves the goal of accurately obtaining the patch required by the user, thereby improving the accuracy of patch creation and solving the technical problem of low accuracy in patch creation in related technologies.

[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0106] This embodiment also provides a sheet-forming apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "unit" and "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0107] Figure 17This is a structural block diagram of a patch generation apparatus according to one embodiment of the present invention. The apparatus includes: a texture acquisition module 1702 for acquiring a texture map, wherein the texture map includes at least a drawing pattern; a first patch generation module 1704 for generating an initial patch corresponding to the drawing pattern based on color values ​​in the texture map; a line segment generation module 1706 for splitting the initial patch based on its texture direction and topology to generate multiple line segments, wherein the multiple line segments are generated based on first vertices located at the edges of the initial patch, and the topological flow of the multiple line segments has the same orientation; and a second patch generation module 1708 for generating a target patch corresponding to the drawing pattern based on the multiple line segments.

[0108] Optionally, the line segment generation module includes: a clustering unit for clustering the edges of the initial face to generate a skeleton pattern line of the initial face; a grouping unit for grouping the first vertices on the initial face based on the skeleton pattern line to obtain multiple sets of vertices; and a splitting unit for splitting the initial face based on the multiple sets of vertices to generate multiple line segments, wherein the multiple sets of vertices and the multiple line segments have a one-to-one correspondence.

[0109] Optionally, the gathering unit includes: a gathering subunit, used to gather the edges of the initial facet according to a preset scaling ratio to obtain a layered structure; a generation subunit, used to generate multiple templates based on the second vertex of each layer of the ring edge in the layered structure; and an accumulation subunit, used to accumulate the lengths of the multiple templates to obtain a skeleton template.

[0110] Optionally, the grouping unit includes: a topology subunit for retopologically resolving the initial patch to generate a closed patch; a fusion subunit for fusion of the reference vertex on the skeleton template line with the second vertex on the closed patch to generate the target line segment of the closed patch, wherein the second vertex is located at the center of the closed patch; a determination subunit for determining the positional relationship between the first vertex in the closed patch and the target line segment; and a grouping subunit for grouping the first vertex based on the positional relationship to obtain multiple sets of vertices.

[0111] Optionally, the fusion sub-unit is also used to: determine the vertex that is closest to the second vertex among the reference vertices, and obtain the first target vertex corresponding to the second vertex; and converge the position of the second vertex to the position of the target vertex to generate the target line segment.

[0112] Optionally, the determination sub-unit is also used to: determine the vertex on the target line segment that is closest to the first vertex, and obtain the second target vertex corresponding to the first vertex; determine the third target vertex on the target line segment that is connected to the second target vertex; and obtain the positional relationship based on the coordinates of the third target vertex and the coordinates of the first vertex.

[0113] Optionally, the splitting unit includes: a determining sub-unit, used to determine a preset vertex in multiple sets of vertexes, wherein the number of vertices adjacent to the preset vertex in the multiple sets of vertexes is less than a preset value; an obtaining sub-unit, used to obtain the first number of the preset vertex in the initial face; a splitting sub-unit, used to split the initial face based on the first number to obtain multiple sub-faces; and a ring-removing sub-unit, used to remove the rings from the multiple sub-faces to generate multiple line segments.

[0114] Optionally, the loop release subunit is also used to: perform a loop release operation on multiple sub-faces to obtain multiple sets of sub-vertex sets, wherein the multiple sets of sub-vertex sets have a one-to-one correspondence with multiple sub-faces; and generate multiple line segments based on the second number of each sub-vertex in the multiple sets of sub-vertex sets.

[0115] Optionally, the buckle release sub-unit is also used to: connect the sub-vertices based on the second number of each sub-vertice to obtain multiple sub-segments; and flip the target coordinates of the target sub-nodes in the target sub-segment among the multiple sub-segments to obtain multiple line segments.

[0116] Optionally, the splitting of sub-units is also used to: determine the third number corresponding to the preset vertex in the multiple sub-faces; in response to the third number not being the preset number, the numbers of the multiple sub-faces are offset so that the third number corresponding to the preset vertex in the multiple sub-faces is the preset number.

[0117] Optionally, the second patch generation module includes a rendering unit, used to render the target patch using preset texture information to obtain a virtual model corresponding to the rendered pattern.

[0118] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but not limited to these: all the above-mentioned units and modules are located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.

[0119] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.

[0120] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0121] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0122] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0123] S1, Obtain a texture map, wherein the texture map includes at least: a drawn pattern;

[0124] S2, based on the color values ​​in the texture map, generates the initial patch corresponding to the drawn pattern;

[0125] S3, the initial face is split based on the texture direction and topology of the initial face to generate multiple line segments. The multiple line segments are generated based on the first vertex located on the edge of the initial face, and the topological flow of the multiple line segments has the same orientation.

[0126] S4 generates the target surface corresponding to the drawn pattern based on multiple line segments.

[0127] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: converging the edges of the initial facet to generate a skeleton pattern of the initial facet; grouping the first vertices on the initial facet based on the skeleton pattern to obtain multiple sets of vertices; and splitting the initial facet based on the multiple sets of vertices to generate multiple line segments, wherein the multiple sets of vertices and the multiple line segments have a one-to-one correspondence.

[0128] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: converging the edges of the initial patch according to a preset scaling ratio to obtain a layered structure; generating multiple splines based on the second vertex of the ring edge of each layer in the layered structure; and summing the lengths of the multiple splines to obtain a skeleton spline.

[0129] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: retopologically re-topologically resolving the initial facet to generate a closed facet; merging a reference vertex on the skeleton spline with a second vertex on the closed facet to generate a target line segment of the closed facet, wherein the second vertex is located at the center of the closed facet; determining the positional relationship between a first vertex in the closed facet and the target line segment; and grouping the first vertex based on the positional relationship to obtain multiple sets of vertices.

[0130] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the vertex among the reference vertices that is closest to the second vertex, obtaining the first target vertex corresponding to the second vertex; converging the position of the second vertex toward the position of the target vertex to generate a target line segment.

[0131] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the vertex on the target line segment that is closest to the first vertex, and obtaining the second target vertex corresponding to the first vertex; determining the third target vertex on the target line segment that is connected to the second target vertex; and obtaining the positional relationship based on the coordinates of the third target vertex and the coordinates of the first vertex.

[0132] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining a preset vertex in a plurality of vertex sets, wherein the number of vertices adjacent to the preset vertex in the plurality of vertex sets is less than a preset value; obtaining the first number of the preset vertex in the initial face; splitting the initial face based on the first number to obtain multiple sub-faces; and performing a de-looping operation on the multiple sub-faces to generate multiple line segments.

[0133] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: performing a de-looping operation on multiple sub-faces to obtain multiple sets of sub-vertexes, wherein the multiple sets of sub-vertexes have a one-to-one correspondence with the multiple sub-faces; generating multiple line segments based on the second number of each sub-vertex in the multiple sets of sub-vertexes.

[0134] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: connecting sub-vertices based on the second number of each sub-vertice to obtain multiple sub-segments; flipping the target coordinates of the target child node in the target sub-segment among the multiple sub-segments to obtain multiple line segments.

[0135] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining a third number corresponding to a preset vertex among a plurality of sub-faces; and, in response to the third number not being a preset number, offsetting the numbers of the plurality of sub-faces so that the third number corresponding to the preset vertex among the plurality of sub-faces is a preset number.

[0136] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: rendering a target patch using preset texture information to obtain a virtual model corresponding to the rendered pattern.

[0137] In at least some embodiments of the present invention, after obtaining the texture map, an initial patch corresponding to the drawing pattern is generated based on the color values ​​in the texture map. The initial patch is then split into multiple line segments based on its texture direction and topology. Finally, a target patch corresponding to the drawing pattern is generated based on these multiple line segments. It is noteworthy that the multiple line segments are obtained by splitting the initial patch based on its texture direction and topology, and the target patch is generated from these multiple line segments. This achieves the goal of accurately obtaining the patch required by the user, thereby improving the accuracy of patch creation and solving the technical problem of low accuracy in patch creation in related technologies.

[0138] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of the present invention.

[0139] In exemplary embodiments of this application, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of the present invention can also be implemented as a program product comprising program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of the present invention.

[0140] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0141] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0142] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0143] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0144] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0145] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0146] S1, Obtain a texture map, wherein the texture map includes at least: a drawn pattern;

[0147] S2, based on the color values ​​in the texture map, generates the initial patch corresponding to the drawn pattern;

[0148] S3, the initial face is split based on the texture direction and topology of the initial face to generate multiple line segments. The multiple line segments are generated based on the first vertex located on the edge of the initial face, and the topological flow of the multiple line segments has the same orientation.

[0149] S4 generates the target surface corresponding to the drawn pattern based on multiple line segments.

[0150] Optionally, the processor may also be configured to perform the following steps via a computer program: gather the edges of the initial facet to generate a skeleton pattern of the initial facet; group the first vertices on the initial facet based on the skeleton pattern to obtain multiple sets of vertices; and split the initial facet based on the multiple sets of vertices to generate multiple line segments, wherein the multiple sets of vertices and the multiple line segments have a one-to-one correspondence.

[0151] Optionally, the processor can also be configured to perform the following steps via a computer program: gather the edges of the initial patch according to a preset scaling ratio to obtain a layered structure; generate multiple splines based on the second vertex of the ring edge of each layer in the layered structure; and accumulate the lengths of the multiple splines to obtain a skeleton spline.

[0152] Optionally, the processor described above can also be configured to perform the following steps via a computer program: retopologically reconstruct the initial facet to generate a closed facet; merge the reference vertex on the skeleton spline with the second vertex on the closed facet to generate the target line segment of the closed facet, wherein the second vertex is located at the center of the closed facet; determine the positional relationship between the first vertex in the closed facet and the target line segment; and group the first vertex based on the positional relationship to obtain multiple sets of vertices.

[0153] Optionally, the processor may also be configured to perform the following steps via a computer program: determine the vertex closest to the second vertex among the reference vertices to obtain the first target vertex corresponding to the second vertex; and converge the position of the second vertex to the position of the target vertex to generate the target line segment.

[0154] Optionally, the processor may also be configured to perform the following steps via a computer program: determine the vertex on the target line segment that is closest to the first vertex, and obtain the second target vertex corresponding to the first vertex; determine the third target vertex on the target line segment that is connected to the second target vertex; and obtain the positional relationship based on the coordinates of the third target vertex and the coordinates of the first vertex.

[0155] Optionally, the processor may also be configured to perform the following steps via a computer program: determining a preset vertex in a set of multiple vertex sets, wherein the number of vertices adjacent to the preset vertex in the set of multiple vertex sets is less than a preset value; obtaining the first number of the preset vertex in the initial face; splitting the initial face based on the first number to obtain multiple sub-faces; and performing a de-looping operation on the multiple sub-faces to generate multiple line segments.

[0156] Optionally, the processor described above can also be configured to perform the following steps via a computer program: perform a de-looping operation on multiple sub-faces to obtain multiple sets of sub-vertexes, wherein the multiple sets of sub-vertexes have a one-to-one correspondence with the multiple sub-faces; and generate multiple line segments based on the second number of each sub-vertex in the multiple sets of sub-vertexes.

[0157] Optionally, the processor described above can also be configured to perform the following steps via a computer program: connecting the sub-vertex based on the second number of each sub-vertex to obtain multiple sub-segments; flipping the target coordinates of the target sub-nodes in the target sub-segment among the multiple sub-segments to obtain multiple line segments.

[0158] Optionally, the processor may also be configured to perform the following steps via a computer program: determining a third number corresponding to a preset vertex among a plurality of sub-faces; and, in response to the third number not being a preset number, offsetting the numbers of the plurality of sub-faces so that the third number corresponding to the preset vertex among the plurality of sub-faces is a preset number.

[0159] Optionally, the processor can also be configured to perform the following steps via a computer program: rendering the target patch using preset texture information to obtain a virtual model corresponding to the rendered pattern.

[0160] In at least some embodiments of the present invention, after obtaining the texture map, an initial patch corresponding to the drawing pattern is generated based on the color values ​​in the texture map. The initial patch is then split into multiple line segments based on its texture direction and topology. Finally, a target patch corresponding to the drawing pattern is generated based on these multiple line segments. It is noteworthy that the multiple line segments are obtained by splitting the initial patch based on its texture direction and topology, and the target patch is generated from these multiple line segments. This achieves the goal of accurately obtaining the patch required by the user, thereby improving the accuracy of patch creation and solving the technical problem of low accuracy in patch creation in related technologies.

[0161] Figure 18 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 18 As shown, the electronic device 1800 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0162] like Figure 18 As shown, the electronic device 1800 is presented in the form of a general-purpose computing device. The components of the electronic device 1800 may include, but are not limited to: at least one processor 1810, at least one memory 1820, a bus 1830 connecting different system components (including memory 1820 and processor 1810), and a display 1840.

[0163] The memory 1820 stores program code that can be executed by the processor 1810, causing the processor 1810 to perform the steps described in the method section of the embodiments of this application according to various exemplary implementations of the present invention.

[0164] The memory 1820 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 18201 and / or cache memory 18202, and may further include read-only memory (ROM) 18203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0165] In some instances, memory 1820 may also include a program / utility 18204 having a set (at least one) of program modules 18205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 1820 may further include memory remotely located relative to processor 1810, which can be connected to electronic device 1800 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0166] Bus 1830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 1810, or a local bus using any of the various bus structures.

[0167] The display 1840 may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 1800.

[0168] Optionally, the electronic device 1800 can also communicate with one or more external devices 1900 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1800, and / or any device that enables the electronic device 1800 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 1850. Furthermore, the electronic device 1800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 1860. Figure 18 As shown, network adapter 1860 communicates with other modules of electronic device 1800 via bus 1830. It should be understood that, although... Figure 18 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 1800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0169] The aforementioned electronic device 1800 may also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0170] Those skilled in the art will understand that Figure 18 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 1800 may also include components that are more... Figure 18 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 1820 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the patch generation method in this embodiment of the invention. The processor 1810 executes various functional applications and data processing by running the computer program stored in the memory 1820, thereby implementing the aforementioned patch generation method.

[0171] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0172] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0173] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0175] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0176] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0177] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A face sheet generation method characterized by, include: Obtain a texture map, wherein the texture map includes at least: a drawn pattern; Based on the color values ​​in the texture map, an initial patch corresponding to the drawn pattern is generated; The initial facet is split based on its texture direction and topology to generate multiple line segments. Each line segment is generated based on a first vertex located at the edge of the initial facet. The multiple line segments have the same orientation in their topological flow. The orientation of the topological flow is used to indicate the orientation obtained by numbering the first vertex and then connecting them sequentially in ascending order of their numbers. Based on the multiple line segments, generate the target surface corresponding to the drawn pattern; The process of splitting the initial facet based on its texture direction and topology to generate the multiple line segments includes: converging the edges of the initial facet to generate a skeleton pattern line representing the center line of the initial facet; grouping the first vertices on the initial facet based on the skeleton pattern line to obtain multiple vertex sets; and splitting the initial facet based on the multiple vertex sets to generate the multiple line segments, wherein the multiple vertex sets and the multiple line segments have a one-to-one correspondence.

2. The method according to claim 1, characterized in that, The process of converging the edges of the initial patch to generate the skeleton pattern line of the initial patch includes: The edges of the initial facet are brought together according to a preset scaling ratio to obtain a layered structure; Multiple sample lines are generated based on the second vertex of the ring edge of each layer in the layered structure. The lengths of the multiple templates are summed to obtain the skeleton template.

3. The method according to claim 1, characterized in that, Based on the skeleton-style spline, the first vertices on the initial patch are grouped to obtain the multiple sets of vertices, including: The initial patch is retopologically redesigned to generate a closed patch; The reference vertex on the skeleton pattern line is merged with the second vertex on the closed face to generate the target line segment of the closed face, wherein the second vertex is located at the center of the closed face; Determine the positional relationship between the first vertex in the closed facet and the target line segment; Based on the positional relationship, the first vertex is grouped to obtain the multiple sets of vertices.

4. The method of claim 3, wherein, The process of fusing the reference vertex on the skeleton template with the second vertex on the closed facet to generate the target line segment of the closed facet includes: Determine the vertex among the reference vertices that is closest to the second vertex, and obtain the first target vertex corresponding to the second vertex; The position of the second vertex is converged towards the position of the target vertex to generate the target line segment.

5. The method of claim 3, wherein, Determining the positional relationship between the first vertex in the closed face and the target line segment includes: Determine the vertex on the target line segment that is closest to the first vertex, and obtain the second target vertex corresponding to the first vertex; Determine the third target vertex on the target line segment that is connected to the second target vertex; The positional relationship is obtained based on the coordinates of the third target vertex and the coordinates of the first vertex.

6. The method of claim 1, wherein, Based on the multiple sets of vertices, the initial face is split to generate the multiple line segments, including: Determine a preset vertex in the multiple sets of vertexes, wherein the number of vertices adjacent to the preset vertex in the multiple sets of vertexes is less than a preset value; Obtain the first number of the preset vertex in the initial facet; The initial facet is split based on the first number to obtain multiple sub-facets; The multiple sub-surfaces are unhooked to generate the multiple line segments.

7. The method of claim 6, wherein, Performing a loop release operation on the multiple sub-surfaces to generate the multiple line segments includes: The multiple sub-faces are unhooked to obtain multiple sets of sub-vertexes, wherein the multiple sets of sub-vertexes have a one-to-one correspondence with the multiple sub-faces; The multiple line segments are generated based on the second number of each sub-vertex in the multiple sets of sub-vertexes.

8. The method of claim 7, wherein, Generating the multiple line segments based on the second number of each sub-vertex in the multiple sets of sub-vertexes includes: Connect the sub-vertices based on the second number of each sub-vertices to obtain multiple sub-line segments; The target coordinates of the target sub-nodes in the target sub-segment of the multiple sub-segments are flipped to obtain the multiple sub-segments.

9. The method according to claim 6, characterized in that, After splitting the initial facet based on the preset vertices to obtain multiple sub-facets, the method further includes: Determine the third number corresponding to the preset vertex among the plurality of sub-faces; In response to the fact that the third number is not the preset number, the numbers of the plurality of sub-faces are offset so that the third number corresponding to the preset vertex in the plurality of sub-faces is the preset number.

10. The method of claim 1, wherein, After generating the target patch corresponding to the drawn pattern based on the multiple line segments, the method further includes: The target surface is rendered using preset texture information to obtain a virtual model corresponding to the rendered pattern.

11. A face sheet generating apparatus characterized by comprising: include: A texture acquisition module is used to acquire texture maps, wherein the texture map includes at least: a drawn pattern; The first patch generation module is used to generate an initial patch corresponding to the drawing pattern based on the color values ​​in the texture map; A line segment generation module is used to split the initial face based on the texture direction and topology of the initial face and generate multiple line segments. The multiple line segments are generated based on the first vertex located on the edge of the initial face. The multiple line segments have the same orientation of topological flow. The orientation of topological flow is used to indicate the orientation obtained by numbering the first vertex and then connecting them in ascending order of number. The second patch generation module is used to generate target patches corresponding to the drawn pattern based on the multiple line segments; The line segment generation module is further configured to converge the edges of the initial face to generate a skeleton pattern line of the initial face, wherein the skeleton pattern line represents the center line of the initial face; group the first vertices on the initial face based on the skeleton pattern line to obtain multiple vertex sets; and split the initial face based on the multiple vertex sets to generate the multiple line segments, wherein the multiple vertex sets and the multiple line segments have a one-to-one correspondence.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the patch generation method according to any one of claims 1 to 10 when run by a processor. 13.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to run the computer program to perform the patch generation method according to any one of claims 1 to 10.