A method and apparatus for texture remapping of a three-dimensional model and a computing device
By performing topological segmentation and conformal mapping on the 3D model and optimizing texture coordinates using heuristic algorithms, the problem of low texture atlas utilization is solved, and the storage and rendering efficiency of the 3D model is improved.
Patent Information
- Application Number
- CN202610782347.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-02
- Publication Date
- 2026-07-03
AI Technical Summary
The texture atlases generated by existing 3D modeling software have low utilization rates, resulting in wasted storage space and low rendering efficiency, making it difficult to meet the usage requirements of 3D models.
By dividing the 3D model into topological blocks, and optimizing texture coordinates using conformal mapping and heuristic algorithms, an efficient texture atlas is generated.
It improves the utilization of texture atlases, reduces redundant blank spaces, and optimizes storage space utilization and rendering efficiency.
Smart Images

Figure CN122336103A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer graphics technology, and in particular to a method, apparatus, and computing device for texture remapping of a three-dimensional model. Background Technology
[0002] 3D modeling technology is now widely used in many fields such as game simulation, virtual reality, digital twins, and 3D visualization. Texture atlases, as a crucial component of 3D models, primarily carry the color, texture, and other textural information of the model's surface, and are a core resource for ensuring the visual quality of 3D model rendering. Currently, the texture atlases generated by mainstream 3D modeling and texture editing software generally suffer from low utilization rates, making it difficult to meet the needs of 3D model usage. Summary of the Invention
[0003] This application provides a method, apparatus, and computing device for remapping textures of a 3D model, which solves the problem of low utilization of texture atlases by remapping the texture atlas of the 3D model.
[0004] Firstly, this application provides a texture remapping method for three-dimensional models.
[0005] The method includes: acquiring a three-dimensional model; dividing the three-dimensional model into multiple three-dimensional blocks based on its topological structure information; performing conformal mapping on the multiple three-dimensional blocks to obtain two-dimensional tiles corresponding to each three-dimensional block and the first texture coordinates of the vertices corresponding to each two-dimensional tile; arranging the two-dimensional tiles to be arranged using a heuristic algorithm based on the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, to obtain the layout positions of the two-dimensional tiles to be arranged, wherein the two-dimensional tiles to be arranged are determined based on the two-dimensional tiles corresponding to each three-dimensional block; updating the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged based on their layout positions, to obtain the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged; and remapping the first texture set of the three-dimensional model based on the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, to obtain the second texture set.
[0006] In the above scheme, the 3D model is divided into blocks based on topological information. Conformal mapping is used to unfold the 3D surface into 2D tiles, generating initial texture coordinates. The topological information of the 3D blocks and a heuristic algorithm are used to optimize the arrangement of the 2D tiles, and the texture coordinates are adaptively updated to eliminate inefficient arrangement problems. A texture atlas is generated based on the updated texture coordinates, reducing redundant blanks while preserving the original texture mapping relationships and details, thereby improving the utilization rate of the texture atlas.
[0007] In one possible implementation, dividing the 3D model into multiple 3D blocks based on its topological information includes: for a first triangular facet in the 3D model, determining a second triangular facet adjacent to the first triangular facet in the 3D model using a region growing technique according to the topological information; adding the second triangular facet to the 3D block containing the first triangular facet based on local normal vector constraints and / or global normal vector constraints, wherein the local normal vector constraints are determined based on the angle between the normal vectors of the first and second triangular facets and a local normal vector angle threshold, and the global normal vector constraints are determined based on the angle between the normal vectors of the second and first triangular facets and the global normal vector angle threshold.
[0008] In one possible implementation, after conformally mapping the three-dimensional blocks to obtain the two-dimensional tiles and the first texture coordinates of the vertices corresponding to the two-dimensional tiles, the method further includes: for any triangular facet in the three-dimensional block, determining the directed area of the arbitrary triangular facet based on the first texture coordinates of the vertices in the arbitrary triangular facet, wherein the vertices corresponding to the two-dimensional tiles include the vertices in the arbitrary triangular facet; if the directed area of the arbitrary triangular facet is less than or equal to a directed area threshold, using the arbitrary triangular facet as a seed, dividing the three-dimensional block into multiple three-dimensional sub-blocks using a region growing technique; performing conformal mapping on the multiple three-dimensional sub-blocks to obtain the two-dimensional sub-blocks corresponding to each three-dimensional sub-block and the texture coordinates of the vertices corresponding to each two-dimensional sub-block; and obtaining the updated first texture coordinates of the vertices corresponding to the two-dimensional tiles based on the texture coordinates of the vertices corresponding to each two-dimensional sub-block.
[0009] In one possible implementation, before arranging using the heuristic algorithm, the method further includes: combining a portion of the two-dimensional tiles from the plurality of two-dimensional tiles into a two-dimensional tile group according to the block adjacency information, wherein the two-dimensional tile group belongs to the two-dimensional tiles to be arranged, and the block adjacency information is used to represent the adjacency relationship of the plurality of three-dimensional tiles.
[0010] In one possible implementation, when a hole exists in the two-dimensional tile group, the method further includes: determining a first tile pair, the first tile pair comprising a first two-dimensional tile in the two-dimensional tile group with the inner contour of the hole as its boundary and a second-order adjacent tile of the first two-dimensional tile; transforming the three-dimensional coordinates of the feature vertices corresponding to the first tile pair to a first local reference coordinate system to obtain the local three-dimensional coordinates of the feature vertices corresponding to the tile pair, wherein the feature vertices corresponding to the first tile pair are the pair of vertices closest to each other in three-dimensional space, and the first local reference coordinate system is determined based on the geometric midpoint of the feature vertices corresponding to the first tile pair and the normal vector of the three-dimensional block corresponding to the first tile pair; and correcting the first texture coordinates of the vertices corresponding to the first tile pair according to the local three-dimensional coordinates of the feature vertices corresponding to the first tile pair.
[0011] In one possible implementation, the method further includes: determining a second tile pair, the second tile pair comprising a second two-dimensional tile bounded by the outer contour of the two-dimensional tile group and a second-order adjacent tile of the second two-dimensional tile; transforming the three-dimensional coordinates of the feature vertices corresponding to the second tile pair to a second local reference coordinate system to obtain the local three-dimensional coordinates of the feature vertices corresponding to the tile pair, wherein the feature vertices corresponding to the second tile pair are the pair of vertices closest to each other in three-dimensional space, and the second local reference coordinate system is determined based on the geometric midpoints corresponding to the feature vertices of the second tile pair and the normal vectors of the three-dimensional blocks corresponding to the second tile pair; and correcting the first texture coordinates of the vertices corresponding to the second tile pair according to the local three-dimensional coordinates of the feature vertices corresponding to the second tile pair.
[0012] In one possible implementation, the normal angle of the three-dimensional block corresponding to the second patch is less than or equal to a normal angle filtering threshold, and / or, the projection overlap rate of the three-dimensional block corresponding to the second patch on the projection plane is less than or equal to a projection overlap rate threshold. The normal vector of the projection plane is obtained by weighted averaging the normal vector of the three-dimensional block corresponding to the second patch based on the geometric area of the three-dimensional block corresponding to the second patch. The projection overlap rate of the three-dimensional block corresponding to the second patch on the projection plane is determined based on the minimum value among the projection area of the projection overlap region of the second patch on the projection plane, the projection area of the projection region of the second two-dimensional block on the projection plane, and the projection area of the projection region of the second-order adjacent patch of the second two-dimensional block on the projection plane.
[0013] In one possible implementation, the method further includes: determining the convex hull utilization rate of the two-dimensional tile group based on the texture area of the two-dimensional tile group and the texture area of the convex hull region corresponding to the two-dimensional tile group; if the convex hull utilization rate of the two-dimensional tile group is less than or equal to the convex hull utilization rate threshold, the portion of the two-dimensional tiles are used as the two-dimensional tiles to be arranged; otherwise, the two-dimensional tile group is used as the two-dimensional tiles to be arranged.
[0014] Secondly, this application also provides a texture remapping device for a three-dimensional model. The device includes: an acquisition module, a segmentation module, a parameterization module, an arrangement module, and a remapping module.
[0015] The acquisition module is used to acquire the 3D model.
[0016] The segmentation module is used to divide the three-dimensional model into blocks based on the topological structure information of the three-dimensional model, thereby obtaining multiple three-dimensional blocks.
[0017] The parameterization module is used to perform conformal mapping on the multiple 3D blocks to obtain the 2D tile corresponding to each 3D block and the first texture coordinates of the vertex corresponding to each 2D tile.
[0018] The arrangement module is used to arrange the two-dimensional tiles to be arranged using a heuristic algorithm based on the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, thereby obtaining the layout position of the two-dimensional tiles to be arranged, and to update the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged based on the layout position of the two-dimensional tiles to be arranged, thereby obtaining the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged. The two-dimensional tiles to be arranged are determined based on the two-dimensional tiles corresponding to each three-dimensional block.
[0019] The remapping module is used to remap the first texture map of the three-dimensional model according to the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, so as to obtain the second texture map.
[0020] In one possible implementation, the segmentation module is further configured to: for a first triangular facet in the 3D model, determine a second triangular facet adjacent to the first triangular facet in the 3D model according to the topological information using a region growing technique; and add the second triangular facet to the 3D block containing the first triangular facet according to local normal vector constraints and / or global normal vector constraints, wherein the local normal vector constraints are determined based on the angle between the normal vectors of the first and second triangular facests and a local normal vector angle threshold, and the global normal vector constraints are determined based on the angle between the normal vectors of the second and first triangular facests and a global normal vector angle threshold.
[0021] In one possible implementation, after conformally mapping the 3D blocks to obtain the 2D tiles and the first texture coordinates of the vertices corresponding to the 2D tiles, the parameterization module is further configured to: for any triangular facet in the 3D block, determine the directed area of the arbitrary triangular facet based on the first texture coordinates of the vertices in the arbitrary triangular facet, wherein the vertices corresponding to the 2D tiles include the vertices in the arbitrary triangular facet; if the directed area of the arbitrary triangular facet is less than or equal to a directed area threshold, use the arbitrary triangular facet as a seed and employ region growing technology to divide the 3D block into multiple 3D sub-blocks; perform conformal mapping on the multiple 3D sub-blocks to obtain the 2D sub-blocks corresponding to each 3D sub-block and the texture coordinates of the vertices corresponding to each 2D sub-block; and obtain the updated first texture coordinates of the vertices corresponding to the 2D tiles based on the texture coordinates of the vertices corresponding to each 2D sub-block.
[0022] In one possible implementation, before arranging using the heuristic algorithm, the arranging module is further configured to: combine a portion of the two-dimensional tiles in the plurality of two-dimensional tiles into a two-dimensional tile group according to the block adjacency information, wherein the two-dimensional tile group belongs to the two-dimensional tiles to be arranged, and the block adjacency information is used to represent the adjacency relationship of the plurality of three-dimensional tiles.
[0023] In one possible implementation, when holes exist in the two-dimensional tile group, the arrangement module is further configured to: determine a first tile pair, the first tile pair including a first two-dimensional tile in the two-dimensional tile group with the inner contour of the hole as its boundary and a second-order adjacent tile of the first two-dimensional tile; transform the three-dimensional coordinates of the feature vertices corresponding to the first tile pair to a first local reference coordinate system to obtain the local three-dimensional coordinates of the feature vertices corresponding to the tile pair, wherein the feature vertices corresponding to the first tile pair are the pair of vertices closest to each other in three-dimensional space, and the first local reference coordinate system is determined based on the geometric midpoints corresponding to the feature vertices corresponding to the first tile pair and the normal vectors of the three-dimensional blocks corresponding to the first tile pair; and correct the first texture coordinates of the vertices corresponding to the first tile pair according to the local three-dimensional coordinates of the feature vertices corresponding to the first tile pair.
[0024] In one possible implementation, the arrangement module is further configured to: determine a second tile pair, the second tile pair including a second two-dimensional tile in the two-dimensional tile group whose boundary is the outer contour of the two-dimensional tile group and a second-order adjacent tile of the second two-dimensional tile; transform the three-dimensional coordinates of the feature vertices corresponding to the second tile pair to a second local reference coordinate system to obtain the local three-dimensional coordinates of the feature vertices corresponding to the tile pair, wherein the feature vertices corresponding to the second tile pair are the closest pair of vertices in three-dimensional space to the vertices corresponding to the second tile pair, and the second local reference coordinate system is determined based on the geometric midpoint corresponding to the feature vertices corresponding to the second tile pair and the normal vector of the three-dimensional block corresponding to the second tile pair; and correct the first texture coordinates of the vertices corresponding to the second tile pair according to the local three-dimensional coordinates of the feature vertices corresponding to the second tile pair.
[0025] In one possible implementation, the normal angle of the three-dimensional block corresponding to the second patch is less than or equal to a normal angle filtering threshold, and / or, the projection overlap rate of the three-dimensional block corresponding to the second patch on the projection plane is less than or equal to a projection overlap rate threshold. The normal vector of the projection plane is obtained by weighted averaging the normal vector of the three-dimensional block corresponding to the second patch based on the geometric area of the three-dimensional block corresponding to the second patch. The projection overlap rate of the three-dimensional block corresponding to the second patch on the projection plane is determined based on the minimum value among the projection area of the projection overlap region of the second patch on the projection plane, the projection area of the projection region of the second two-dimensional block on the projection plane, and the projection area of the projection region of the second-order adjacent patch of the second two-dimensional block on the projection plane.
[0026] In one possible implementation, the arrangement module is further configured to: determine the convex hull utilization rate of the two-dimensional tile group based on the texture area of the two-dimensional tile group and the texture area of the convex hull region corresponding to the two-dimensional tile group; if the convex hull utilization rate of the two-dimensional tile group is less than or equal to the convex hull utilization rate threshold, select the portion of the two-dimensional tiles as the two-dimensional tiles to be arranged; otherwise, select the two-dimensional tile group as the two-dimensional tiles to be arranged.
[0027] Thirdly, this application also provides a computing device. The computing device includes a processor and a memory. The processor is used to execute a computer program stored in the memory to implement the texture remapping method provided by the first aspect or any possible implementation thereof.
[0028] Fourthly, this application also provides a computer-readable storage medium. This computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the texture remapping method provided by the first aspect or any possible implementation thereof.
[0029] Fifthly, this application also provides a computer program product containing instructions. When the computer program product is run on a computer, it causes the computer to perform the texture remapping method provided by the first aspect or any possible implementation thereof.
[0030] Any of the devices, computing equipment, computer storage media, or computer program products provided above are used to perform the methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding solutions in the corresponding methods provided above, and will not be repeated here. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a flowchart of a texture remapping method based on the topology of a three-dimensional model provided in an embodiment of this application; Figure 2 This is a flowchart of a method for conformal mapping of three-dimensional blocks provided in an embodiment of this application; Figure 3a , Figure 3b and Figure 3c This is a flowchart of a method for combining two-dimensional blocks corresponding to three-dimensional blocks, provided in an embodiment of this application. Figure 4 The embodiments provided in this application are based on Figure 1 The diagram shows a system schematic for texture remapping of a 3D building model using the method shown. Figure 5a The embodiments provided in this application are based on Figure 1 The flowchart shown illustrates a method for texture remapping of a 3D architectural model. Figure 5b This is a schematic diagram of the three-dimensional building model and its related texture atlas provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of a texture remapping device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0033] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0034] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0035] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0036] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0037] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0038] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0039] Currently, 3D modeling technology is widely used in many fields such as game simulation, virtual reality, digital twins, and 3D visualization. Texture atlases, as a crucial component of 3D models, primarily carry the color, texture, and other textural information of the model's surface, serving as a core resource for ensuring the visual effects of 3D model rendering. During the storage and transmission of 3D models, texture atlases constitute a large portion of the data, typically occupying the majority of the model file's storage space. The quality of texture atlas generation directly impacts the storage cost, loading speed, and rendering performance of the 3D model. Currently, texture atlases generated by mainstream 3D modeling software (such as Blender, Maya, Meshlab, and Simplygon) and texture editing software (such as RizomUV) generally suffer from random tile arrangement and poor texture structure continuity, resulting in low texture atlas utilization. Furthermore, this not only wastes storage space but also further reduces the loading speed and rendering efficiency of 3D models, making it difficult to meet the demands of efficient 3D model processing.
[0040] Therefore, this application provides a texture remapping method for a 3D model. In this method, firstly, the 3D model is divided into multiple 3D blocks according to its topological structure information. Then, a consistent conformal mapping is performed on these multiple 3D blocks to obtain a 2D tile corresponding to each 3D block, and the first texture coordinates of the vertices corresponding to each 2D tile. Next, the 2D tiles to be arranged are determined. Based on the first texture coordinates of the vertices corresponding to the 2D tiles to be arranged, a heuristic algorithm is used to rearrange the 2D tiles to be arranged, obtaining the second texture coordinates of the vertices corresponding to the 2D tiles to be arranged. Subsequently, a remapping is performed based on the second texture coordinates of the vertices corresponding to the 2D tiles to be arranged and the original first texture set of the 3D model, thereby obtaining the second texture set of the 3D model.
[0041] The above method can improve the utilization rate of texture atlases by reducing redundancy and enhancing the structural continuity of texture atlases.
[0042] The following is combined Figure 1 The texture remapping method provided in the embodiments of this application will be described in detail.
[0043] Figure 1 This is a flowchart of a texture remapping method for a three-dimensional model provided in an embodiment of this application. Figure 1 As shown, the method may include steps S101 to S105. The following uses... Figure 1 The method shown is applied to a computing device as an example to introduce each step.
[0044] In S101, obtain the 3D model.
[0045] The computing device can respond to user requests, acquire the model file to be processed, parse the model file, and obtain the analysis results. This model file can be a file input by the user to the computing device, or a file generated by the user using 3D modeling software running on the computing device.
[0046] The analysis results include the 3D model and its topological structure information, the original first texture atlas, and the original texture coordinates of each vertex. The texture coordinates include u-coordinates and v-coordinates, which can be represented as (u, v).
[0047] The 3D model is represented by a triangular mesh M, where M = (V, F), V is the set of vertices of the triangular model, and F is the set of triangular faces.
[0048] The topological information of the 3D model includes the 3D coordinates of each vertex, the triangular face index, and the normal vector n and geometric area A of each triangular face. The triangular face index includes the vertices in V corresponding to each triangular face, which are used to determine the vertices that make up the triangular face.
[0049] The first texture atlas includes texels for each mapped region on the surface of the 3D model.
[0050] In S102, the 3D model is divided into blocks based on the topological information of the 3D model, resulting in multiple 3D blocks.
[0051] The computing device can use local and global normal constraints as segmentation strategies and employ region growing to divide the 3D model into multiple 3D blocks. For example, for a region growing method, taking the unvisited i-th triangle... ( Using a seed as a reference, three-dimensional blocks are gradually generated. During the generation of these blocks, local and global normal constraints ensure geometric consistency across different scales. Thus, the computing device can obtain locally continuous three-dimensional blocks, as well as the boundary lines of each block. The boundary lines of the three-dimensional blocks include the three-dimensional coordinates of the vertices on the block boundaries.
[0052] The aforementioned local normal constraints are as follows:
[0053] in, Represents the i-th triangle The normal vector, Indicates the relationship with the i-th triangle. Adjacent triangles to be added The j-th triangular face of the 3D block C The normal vector, for and The included angle, This is the threshold for the angle between local normal vectors.
[0054] The global normal constraints mentioned above are as follows:
[0055] in, This represents the threshold angle between the global normal vectors. Represents a triangular face The normal vector of the three-dimensional block C is located there. for and The included angle. The geometrically weighted average of the surface normals: , This represents the k-th triangular face in the 3D block C. and They are respectively The normal vector and area.
[0056] In S103, conformal mapping is performed on multiple 3D blocks to obtain the 2D tile corresponding to each 3D block and the first texture coordinates of the vertices corresponding to each 2D tile.
[0057] The computing device uses conformal mapping to perform two-dimensional parameter domain calculations on each obtained 3D block, resulting in two-dimensional tiles corresponding to each 3D block, and the first texture coordinates of the vertices corresponding to each two-dimensional tile. The vertices corresponding to the two-dimensional tiles are the vertices contained in the corresponding 3D block. The computing device performs global conformal mapping on each 3D block to ensure that the first texture coordinates of the vertices corresponding to each two-dimensional tile are generated within the same two-dimensional coordinate system.
[0058] To ensure the validity of conformal mapping results, the computing device can perform face flip detection on the triangular faces in the 3D blocks. Face flip refers to the situation where the orientation of a local triangular face is reversed or the front and back faces are reversed during the unfolding of the 3D blocks into a 2D plane. When face flip occurs, the conformal mapping results will be invalid.
[0059] For 3D blocks with face flipping, segmented conformal mapping can be performed on the 3D block to update the first texture coordinates of the corresponding 2D tiles and vertices of the 2D tiles, thereby reducing the risk of mapping failure caused by performing conformal mapping globally. The process described in this section can be referenced later. Figure 2 The details of that will not be repeated here.
[0060] In S104, based on the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, a heuristic algorithm is used to arrange the two-dimensional tiles to be arranged and obtain the layout position of the two-dimensional tiles to be arranged.
[0061] The 2D tiles to be arranged are determined based on the 2D tiles corresponding to each 3D block. To further improve the utilization rate of the texture atlas, the computing device can combine multiple 2D tiles according to the block adjacency information to obtain several 2D tile groups. The block adjacency information is used to represent the adjacency relationships between multiple 3D blocks. The block adjacency information can be determined based on the shared edges and shared vertices between multiple 3D blocks. The process of the computing device combining multiple 2D tiles can be referred to in the following section. Figure 3a The details of that will not be repeated here.
[0062] The two-dimensional blocks to be arranged include groups of two-dimensional blocks obtained by combining them. In some embodiments, the two-dimensional blocks to be arranged also include independent two-dimensional blocks that cannot be combined.
[0063] For the two-dimensional tiles to be arranged, a heuristic algorithm is used to arrange them and obtain their layout positions. Taking the Max Rectangles-Bottom Left (maxrects-BL) algorithm as an example, the two-dimensional tiles to be arranged are arranged in descending order of size. Within the layout space of the texture atlas, using the bottom left corner as the reference coordinate, the optimal positions that are higher and lower left are selected as the layout positions of the two-dimensional tiles to be arranged within the layout space of the texture atlas. The computing device can determine the layout positions of the two-dimensional tiles to be arranged according to the following formula. :
[0064] in, This represents the lower-left coordinate of a candidate position within the layout space, where W represents the set of all valid candidate positions. The computing device employs this selection strategy, prioritizing positions with smaller ordinate values. If ordinate values are the same, it further filters for positions with smaller abscissa values to complete the positioning. This packing arrangement method allows for a more compact tile layout, effectively improving the overall space utilization of the texture atlas. When there are no feasible areas within the existing layout space that meet the placement conditions, the layout space of the atlas is automatically and adaptively expanded, thereby adding new candidate positions for tiles.
[0065] In S105, the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged are updated according to the layout position of the two-dimensional tiles to be arranged, so as to obtain the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged.
[0066] Computing devices, for example, can display the corresponding two-dimensional tiles to be arranged. As offsets for the U and V coordinates, the first texture coordinates of each vertex of the two-dimensional tile to be arranged are updated, thus obtaining the second texture coordinates.
[0067] It should be noted that the embodiments of this application do not impose specific restrictions on the heuristic algorithms used by the computing devices; the maxrects-BL algorithm is merely an example.
[0068] In some embodiments, the two-dimensional tiles to be arranged may also include two-dimensional tiles corresponding to each three-dimensional block. The process of arranging the various two-dimensional tiles by the computing device can be referred to the above description, and will not be repeated here.
[0069] In S106, the first texture map of the three-dimensional model is remapped according to the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, so as to obtain the second texture map.
[0070] The computing device can determine the texels of the vertices corresponding to the two-dimensional tiles to be arranged based on the original texture coordinates of each vertex in the three-dimensional model and the first texture atlas, and then generate the second texture atlas based on the texels of the vertices corresponding to the two-dimensional tiles to be arranged and the second texture coordinates.
[0071] After generating the second texture atlas, the computing device can update the first texture atlas and the original texture coordinates of each vertex in the model file based on the second texture atlas and the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, thus obtaining the updated model file.
[0072] The above scheme first uses the topological structure of the 3D model to accurately divide the model into blocks. Then, conformal mapping is used to achieve a smooth unfolding of the 3D surface onto the 2D plane. While ensuring that the surface shape is not distorted and the texture mapping is distortion-free, the scheme obtains the 2D tiles and initial first texture coordinates corresponding to each block. Subsequently, a heuristic algorithm is used to rationally arrange the 2D tiles, completing the adaptive offset update of the texture coordinates. This effectively eliminates inefficient layout problems such as blank gaps, misaligned stitching, and internal holes in the original texture arrangement. Finally, the texture atlas is remapped based on the updated second texture coordinates. While fully preserving the original texture details and the correspondence between texture mapping, this significantly reduces redundant and idle space within the texture atlas, effectively improving the space utilization efficiency of the entire texture atlas. It also optimizes texture resource storage, thereby improving the efficiency of model texture loading and rendering.
[0073] Figure 2 This is a flowchart of a method for conformal mapping of three-dimensional blocks provided in an embodiment of this application. Figure 2 As shown, the method may include steps S201 to S204, which will be discussed below. Figure 2 The steps shown will be explained.
[0074] In S201, the two-dimensional parameterized mapping of the two-dimensional block is obtained by conformal mapping of the three-dimensional block C. (C) After that, the directed area of the triangular face in the corresponding 3D block is used to determine whether the triangular face has been flipped. Wherein, (C) is the set of the first texture coordinates of the vertices corresponding to the two-dimensional tile.
[0075] Using any triangular face in the 3D block C For example, in the triangle f, vertices e, g, and h correspond to... The first texture coordinates of (C) are respectively And satisfy When the triangle faces are satisfied Directed area At that time, the triangular face can be determined. A face flip occurs if the face is flipped, otherwise a face flip does not occur.
[0076] in, This is a directed area threshold, and its value can be a positive number close to 0 (e.g., This is used to improve numerical stability. The directed area of the aforementioned triangular face f... for:
[0077] In S202, for a 3D block C containing flipped triangles, local resegmentation can be performed within the 3D block to obtain multiple 3D sub-blocks. This process only occurs within the current 3D block and does not change the topological relationships between the 3D blocks. For example, using the flipped triangles as seeds, region growing is performed in conjunction with the triangle adjacency information of the 3D block to divide the 3D block into multiple 3D sub-blocks. The triangle adjacency information of the 3D block represents the adjacency relationships between the triangles within that 3D block. The triangle adjacency information of the 3D block can be determined based on the shared edges and / or shared vertices of the triangles within the 3D block.
[0078] In S203, conformal mapping is performed on multiple 3D sub-blocks to obtain the corresponding 2D sub-blocks and the texture coordinates of the vertices of each 2D sub-block. During the 3D block segmentation process, the final segmentation result should satisfy: ① All triangular faces in all sub-blocks satisfy the no-flip constraint: the directed area of the sub-blocks after conformal mapping. ② The geometric area of all sub-blocks is less than the threshold: .in, For example, it can be 1%-5% of the area of the three-dimensional block geometry.
[0079] In S204, the boundary lines of the original 3D block C are used as constraints, and the texture coordinates of the vertices corresponding to each 2D sub-block are used to redetermine the 2D tiles corresponding to the 3D block C and the first texture coordinates of the vertices corresponding to the 2D tiles.
[0080] After 3D block segmentation, there are often rigidity differences between the boundaries of the 3D sub-blocks. To restore the consistent parameter domain of the original 3D block, the conformal mapping results of the 3D sub-blocks are uniformly integrated. For example, for adjacent 3D sub-blocks within a 3D block, preliminary alignment is performed using an improved Singular Value Decomposition (SVD) based on a shared vertex set S. The texture coordinates of the corresponding vertices of each 3D sub-block are uniformly transformed to a global 2D coordinate system, resulting in the preliminary first texture coordinates of the corresponding vertices of the 2D tile. To ensure the continuous smoothness of the shared boundary and further reduce splicing deviations, a constrained optimization model is constructed based on the preliminary alignment using improved SVD. This model is tuned to minimize the energy E, thus obtaining the final first texture coordinates of the corresponding vertices of the 2D tile. The constructed constrained optimization model is as follows:
[0081] in, and Let p and q be the initial first texture coordinates of the p-th and q-th vertices, respectively. It is the set of vertices inside a 3D block. For the vertex neighborhood, the first term ensures parameter continuity between 3D sub-blocks, while the second term adjusts the internal vertices using Laplacian smoothing constraints, thus mitigating local stretching caused by splicing. Weight parameters. and The relative importance of splicing consistency and internal smoothness can be controlled separately. To prioritize ensuring parameter continuity between sub-blocks, it is possible to... Much larger This allows for the stable acquisition of continuous and low-distortion results.
[0082] Furthermore, the constrained optimization model can also impose hard constraints on the boundary vertices of the original 3D blocks: This ensures that the boundary shape of the parameter domain is consistent with the original 3D block. Among them, For the set of boundary vertices of the 3D block, Let be the initial first texture coordinates of the p-th vertex.
[0083] The above Figure 2 In the scheme shown, for the 3D blocks with surface flipping problems, a processing method of segmented conformal mapping, sub-block fusion and splicing combined with local fine-tuning optimization is adopted. This allows the 2D blocks generated by the 3D block mapping to completely retain various structural surface units, effectively reducing the generation of scattered texture fragments. While improving the regularity of the 2D block boundary, it also stably ensures the forming quality and deformation control effect of the overall conformal mapping.
[0084] Figure 3aThis is a flowchart illustrating the combination of multiple two-dimensional blocks provided in an embodiment of this application. For example... Figure 3a As shown, the method may include steps S301 to S304, which will be discussed below. Figure 3a The steps shown will be explained.
[0085] In S301, it is determined whether there are holes in the two-dimensional tile group.
[0086] The computing device can traverse the first texture coordinates of the corresponding internal vertices of the 2D tile group to determine whether the 2D tile group has an independent closed inner contour, i.e., a hole. For 2D tile groups with holes, S302 is executed; for 2D tile groups without holes, S303 is executed.
[0087] In S302, for a group of two-dimensional tiles containing holes, a two-dimensional to three-dimensional coordinate transformation system is established based on the second-order adjacency pairs corresponding to the two-dimensional tile group. The texture coordinate correction amount is determined based on the two-dimensional to three-dimensional coordinate transformation system, and the first texture coordinates of the corresponding vertices of the two-dimensional tile group are corrected. Then, S303 is executed. Specifically, S302 may include, for example... Figure 3b S3021~S3024 are shown.
[0088] S3021. Based on the internal adjacency information corresponding to the 2D tile group, traverse inwards from the inner contour to obtain the first-order adjacency tile pairs of the 2D tile group, and further expand to obtain second-order adjacency block pairs. The internal adjacency information corresponding to the 2D tile group is used to represent the adjacency relationship between each 3D block corresponding to the 2D tile group. Compared with first-order adjacency, tile contour consistency mainly exists in second-order adjacency. For the selected second-order adjacency block pair (i.e., two 2D tiles) and ).
[0089] S3022. Construct a local reference coordinate system based on the second-order adjacency block pairs.
[0090] Determine the closest pair of points in 3D space for the second-order adjacency block pair: The geometric midpoint of this point pair is used as the common origin of the local reference coordinate system. The geometric midpoint is determined by the following formula.
[0091]
[0092] With point Using the origin as the reference point, construct the normal planes (i.e., perpendicular to the origin) of each second-order adjacency block pair. and (The plane). Based on this, an auxiliary plane Y is introduced. The auxiliary plane Y is defined as: passing through the point... And simultaneously perpendicular to the plane of the second-order adjacent block pair normal plane, this condition is equivalent to the normal vector of the auxiliary plane Y being:
[0093] This uniquely determines the plane. Furthermore, for each tile, its local coordinate axes are defined as follows: components in the tangential direction: Quantities in the secondary tangential direction: Thus, an orthogonal normal basis is obtained. .
[0094] S3023. After obtaining the local reference coordinate system, transform the 3D coordinates of the vertices corresponding to the second-order adjacency block pairs from the original 3D coordinate system to the local reference coordinate system. For any vertex m, the transformation result is:
[0095] in, , Indicates along the tangential direction The components. Since the conformal mapping yields uv coordinates as a two-dimensional coordinate representation established on the local tangent plane, and the tangential direction... and The directions are the same, therefore In the In the viewpoint direction, the components of the three-dimensional coordinates along that direction are eliminated, thereby constraining the spatial relationships between different tiles to a unified reference plane.
[0096] The relative misalignment between different tiles is mainly reflected in the tangential direction. Therefore, we can only consider one-dimensional alignment along the u direction.
[0097] S3024. For tiles A and B, the uv coordinates of any vertex are uniformly corrected, that is: and , For | - |, For | - |, This represents the x-coordinate of the vertex corresponding to patch A in the original 3D coordinate system. This represents the x-coordinate of the vertex corresponding to patch A in the local reference coordinate system. This represents the x-coordinate of the vertex corresponding to tile B in the original 3D coordinate system. This represents the x-coordinate of the vertex corresponding to tile B in the local reference coordinate system.
[0098] In S303, for a group of two-dimensional tiles without holes, a common two-dimensional / three-dimensional coordinate transformation system is established based on the tiles' second-order adjacency relationship. Under the criteria of consistent normals, overlapping boundaries, and reasonable combination convex hulls, the group is aligned, and it is determined whether to retain the two-dimensional tile group. This step may include... Figure 3c S3031~S3035 are shown.
[0099] S3031. Determine the second-order adjacency block pairs based on the internal adjacency information corresponding to the two-dimensional block group.
[0100] S3032. For the second-order adjacency blocks obtained by traversal, perform normal vector filtering and projected area filtering in sequence.
[0101] The normal vector filtering process performed by the computing device may include: calculating the angle between the normals of the three-dimensional blocks Chart A and Chart B. ,in, According to the preset normal angle threshold, the selection threshold is... ( ) and screening criteria ( )filter.
[0102] For second-order adjacency blocks selected by normal vector filtering, the computing device performs normal vector filtering.
[0103] The normal vector selection process may include: First, the computing device constructs a geometrically area-weighted average normal vector. ,by Construct a projection plane for the normal vectors, and project the vertices on the outer contours of the two blocks onto this plane to obtain the two-dimensional region. and Then calculate the two-dimensional region according to the following formula. and Projection overlap rate .
[0104]
[0105] in, This indicates the projected area.
[0106] Then, the computing device calculates the projection overlap rate threshold according to the preset value. The filtering criteria are ( ) Filtering. For example, when or If it is considered that there is a large difference in the spatial direction between two tiles or there is a significant overlap or conflict in the projection space, although a tight combination can be achieved after alignment calculation, the structure of continuous combination will be destroyed from the perspective of aligning all second-order adjacent blocks. Therefore, the two-dimensional tiles corresponding to the second-order adjacent block pairs are removed from the current two-dimensional tile group and do not participate in the subsequent UV coordinate correction process.
[0107] S3033. For the second-order adjacent blocks that have passed the above screening, similar to the operation of aligning UV coordinates starting from the inner contour, a unified local coordinate transformation system is constructed in three-dimensional space to align the UV coordinates of the second-order adjacent blocks. This process can be referred to S3022~S3024 above, and will not be repeated here.
[0108] S3034. For the aligned 2D tile group, calculate the convex hull region in its joint parameter domain. Then, calculate the convex hull utilization rate according to the following formula.
[0109]
[0110] in, Indicates the UV area.
[0111] S3035. According to the preset convex hull utilization threshold. and filtering criteria ( Determine whether to retain the 2D tile group. If this occurs, it indicates that the 2D tile group has large gaps or is not arranged compactly. Therefore, it is determined that the alignment result is not conducive to the utilization rate of the final atlas, and the 2D tile group is decoupled and restored to independent tiles. If the following conditions are met... If so, the two-dimensional tile group is retained and participates in the above rearrangement process.
[0112] The above Figure 3a In the scheme shown, both the two-dimensional tile groups with holes and the two-dimensional tile groups without holes are aligned with the same local edge direction, which can achieve the close arrangement of irregular two-dimensional graphics and further provide a foundation for the subsequent generation of highly utilized texture atlases.
[0113] Based on the above method embodiments, this application provides a system for texture remapping of three-dimensional architectural models. For example... Figure 4 As shown, the system includes a surface segmentation module, a parameterization module, a relationship construction module, a merging module, and an arrangement and mapping module.
[0114] The surface segmentation module is used to divide the triangular faces of the 3D building model into blocks. Segmentation follows the topological structure information of the 3D building model, ensuring controllable deformation of each block while maintaining the original topological structure. During segmentation, based on the characteristics of the individual building model, triangular faces are clustered using local normal consistency and global normal constraint strategies to generate locally continuous 3D blocks. The surface of the 3D building model has a distinctive topological structure, characterized by sharp edges, prominent structural lines, and uniform geometric surface changes between structures. Segmentation according to the topological structure yields blocks based on structural lines; the boundary lines between these blocks constitute the structural lines of the 3D building model. This reduces distortion in subsequent processing, thereby improving atlas utilization and enhancing the continuity of texture distribution.
[0115] The parameterization module is used to parametrically unfold each 3D block, calculate its corresponding 2D tile and UV coordinates in the 2D parameter domain. Simultaneously, the parameterization module evaluates the directional area distortion index. If the distortion requirements are not met, the 3D block is cut into more detailed sub-blocks starting from the point of distortion. After parameterization, these sub-blocks are merged according to the initial structural surface boundary constraints to form the final 2D tile, providing an important data foundation for subsequent tile combination.
[0116] The relationship construction module is used to determine the structural topology between the boundaries of the 3D blocks based on the topological information, and to determine the block adjacency information based on the structural topology between the boundaries of the 3D blocks. This block adjacency information serves as the basis for combining 2D tiles, providing an important foundation for reasonable combination and boundary alignment, and improving the utilization of texture space.
[0117] The merging module is used to determine 2D tile groups. For 2D tile groups with inner contour boundaries, it traverses inward along the inner contour to find second-order adjacent block pairs and establishes a common 2D-3D coordinate transformation system to achieve error-free boundary alignment. For outer contour boundaries, a common 2D-3D coordinate transformation system is also established based on second-order adjacent block pairs. Under the criteria of consistent normals, overlapping boundaries, and reasonable combined convex hulls, the alignment is completed.
[0118] The arrangement and mapping module is used to pack the obtained 2D tile groups and the remaining individual 2D tiles as a package object, arrange them using a heuristic packing algorithm, and then map them according to the obtained layout positions to obtain a new texture atlas. The arrangement and mapping module is also responsible for outputting the final result, including the updated model file, completing the overall conversion process from the original model file to the optimized model file.
[0119] The following is combined Figure 5a right Figure 4 The functions of each module shown will be described in detail.
[0120] Figure 5a This application provides a flowchart of a method for texture remapping a 3D architectural model. This method can be performed by... Figure 4 The modules in the system shown are executed. For example... Figure 5a As shown, the method may include steps S501 to S511.
[0121] In S501, the surface segmentation module reads and parses the model data from the user-input model file to obtain the parsing results. The parsing results can be referenced above. Figure 1 The description of S101 in the method shown will not be repeated here.
[0122] In step S502, the surface segmentation module determines whether the original first texture atlas exists based on the parsing results. If it exists, proceed to step S503. If it does not exist, prompt the user to re-enter the model file containing the original texture atlas, and return to step S501.
[0123] In S503, based on the topological information of the 3D building model, the 3D building model is segmented using local and global normal constraints to obtain multiple 3D blocks. The specific process of this step can be referred to the description in S102 above, and will not be repeated here.
[0124] In S504, the parameterization module uses conformal mapping to perform two-dimensional parameter domain calculations on the obtained 3D blocks, resulting in the first texture coordinates of the 2D tiles and their corresponding vertices. The specific process of this step can be referred to the aforementioned S103 description, and will not be repeated here.
[0125] In S505, the parameterization module obtains the first texture coordinates of the 2D tile and its corresponding vertices by first segmenting the 3D block that cannot be successfully parameterized, then performing conformal mapping on each segment individually, and finally merging the parameterization results of each segment. The specific process of this step can be referred to the aforementioned steps. Figure 2 The steps of the method shown will not be repeated here.
[0126] In S506, the relationship building module constructs block adjacency information based on each 3D block. This block adjacency relationship represents the adjacency relationship between each 3D block. The block adjacency information can be determined based on the shared edges and shared vertices between multiple 3D blocks.
[0127] In S507, the merging module combines the various two-dimensional blocks according to the block adjacency information to obtain a two-dimensional block group.
[0128] In S508, the merging module detects whether there are holes in the 2D tile group. This process can be referred to the above. Figure 3aThe description of S301 of the method shown will not be repeated here; local edge alignment is performed on the first texture coordinates of the vertices corresponding to the two-dimensional tile group with holes. This process can be referred to the above. Figure 3a The description of S302 of the method shown will not be repeated here; normal filtering and projected area filtering are performed on the two-dimensional tile group without holes, and then local edge alignment is performed on the two-dimensional tile group that passes the filtering. This process can be referred to the above. Figure 3c The descriptions of S3031 to S3031 of the method shown will not be repeated here.
[0129] In S509, the merging module determines whether the low distortion requirement is met based on the convex hull utilization rate of the 2D tile group after local edge alignment. If the low distortion requirement is met, the 2D tile group is retained; otherwise, it is split. This process can be referred to the aforementioned... Figure 3c The descriptions of S3034~S3035 of the method shown will not be repeated here.
[0130] In S510, the arrangement and mapping module arranges each group of two-dimensional tiles and / or individual two-dimensional tiles using existing mature heuristic algorithms to obtain their respective layout positions. This process can be referred to the aforementioned... Figure 1 The description of S104 in the method shown will not be repeated here.
[0131] In S511, the arrangement and mapping module updates the first texture coordinates of each group of two-dimensional tiles and / or individual two-dimensional tiles to obtain the second texture coordinates. This process can be referred to the above. Figure 1 The method shown includes S105; then the original first texture atlas is mapped to the corresponding second texture coordinates to obtain a completely new second texture atlas. This process can be referred to the previous section. Figure 1 The method shown is described in section S106. Figure 5b This paper illustrates a 3D architectural model and its corresponding first texture atlas, as well as a second texture atlas obtained by remapping the 3D architectural model. Comparison is then performed. Figure 5b The first and second texture atlases shown demonstrate that the second texture atlas reduces white space compared to the first, resulting in higher atlas utilization. Furthermore, comparing the five structures outlined in the 3D architectural model and the second texture atlas reveals that the structures in the second texture atlas are arranged continuously, exhibiting better structural continuity and further enhancing the atlas's utilization.
[0132] Then, the arrangement and mapping module can update the original texture coordinates recorded in the model file according to the one-to-one correspondence between the new second texture coordinates and the model vertices, and update the first texture atlas recorded in the model file according to the second texture atlas, so as to obtain the updated model file and output it.
[0133] Based on the above description, this application also provides a texture remapping device for a three-dimensional model.
[0134] Figure 6 This is a schematic diagram of the structure of a texture remapping device 600 for a three-dimensional model provided in an embodiment of this application. The texture remapping device 600 includes: an acquisition module 601, a segmentation module 602, a conversion module 603, an arrangement module 604, and a remapping module 605.
[0135] The acquisition module 601 is used to acquire the three-dimensional model.
[0136] The segmentation module 602 is used to divide the three-dimensional model into blocks according to the topological structure information of the three-dimensional model, thereby obtaining multiple three-dimensional blocks.
[0137] The conversion module 603 is used to perform conformal mapping on the multiple three-dimensional blocks to obtain the two-dimensional tile corresponding to each three-dimensional block and the first texture coordinates of the vertex corresponding to each two-dimensional tile.
[0138] The arrangement module 604 is used to arrange the two-dimensional tiles to be arranged using a heuristic algorithm based on the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, thereby obtaining the layout position of the two-dimensional tiles to be arranged, and to update the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged based on the layout position of the two-dimensional tiles to be arranged, thereby obtaining the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged. The two-dimensional tiles to be arranged are determined based on the two-dimensional tiles corresponding to each three-dimensional block.
[0139] The remapping module 605 is used to remap the first texture map of the three-dimensional model according to the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, so as to obtain the second texture map.
[0140] It should be noted that, Figure 6 The texture remapping device 600 provided in the illustrated embodiment, when executing the texture remapping method, is only illustrated by the division of the above-described functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the computing device provided in the above embodiment and... Figure 1 The texture remapping method embodiments shown belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0141] Figure 7 This is a schematic diagram of the structure of a computing device 700 provided in an embodiment of this application.
[0142] The computing device 700 can be either the aforementioned computing device or the aforementioned terminal device. See also Figure 7 The computing device 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704. The processor 701, memory 702, and communication interface 703 are connected to each other via the bus 704. The processor 701, memory 702, and communication interface 703 may also be connected using other methods besides the bus 704.
[0143] The memory 702 can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, hard disk, etc.
[0144] The processor 701 can be a general-purpose processor, which can be a processor that performs specific steps and / or operations by reading and executing contents stored in memory (e.g., memory 702). For example, the general-purpose processor can be a central processing unit (CPU). The processor 701 may include at least one circuit to perform... Figure 1 All or part of the steps of the texture remapping method provided in the illustrated embodiment.
[0145] The communication interface 703 includes input / output (I / O) interfaces, physical interfaces, and logical interfaces for interconnecting devices within the computing device 700, as well as interfaces for interconnecting the computing device 700 with other devices (such as other computing devices or user equipment). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.
[0146] The bus 704 can be any type of communication bus used to interconnect the processor 701, memory 702 and communication interface 703, such as a system bus.
[0147] The aforementioned devices can be disposed on separate chips, or at least partially or entirely on the same chip. Whether to dispose of the devices independently on different chips or integrate them on one or more chips often depends on the needs of the product design. This application does not limit the specific implementation of the aforementioned devices.
[0148] Figure 7 The computing device 700 shown is merely exemplary. In the implementation process, the computing device 700 may also include other components, which will not be listed one by one in this article.
[0149] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0150] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application. It should be understood that in the embodiments of this application, the order of the process numbers does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0151] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.
Claims
1. A texture remapping method for a three-dimensional model, characterized in that, The method includes: Obtain the 3D model; Based on the topological information of the three-dimensional model, the three-dimensional model is divided into blocks to obtain multiple three-dimensional blocks; Conformal mapping is performed on the multiple three-dimensional blocks to obtain the two-dimensional tiles corresponding to each three-dimensional block and the first texture coordinates of the vertices corresponding to each two-dimensional tile; Based on the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, a heuristic algorithm is used to arrange the two-dimensional tiles to be arranged to obtain the layout position of the two-dimensional tiles to be arranged. The two-dimensional tiles to be arranged are determined based on the two-dimensional tiles corresponding to each three-dimensional block. Based on the layout position of the two-dimensional tiles to be arranged, update the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, and obtain the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged. Based on the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, the first texture map of the three-dimensional model is remapped to obtain the second texture map; The step of dividing the 3D model into multiple 3D blocks based on its topological structure information includes: For the first triangular facet in the three-dimensional model, the second triangular facet adjacent to the first triangular facet in the three-dimensional model is determined using the region growing technique according to the topological structure information. Based on local and / or global normal vector constraints, the second triangular face is added to the 3D block containing the first triangular face. The local normal vector constraint is determined based on the angle between the normal vectors of the first and second triangular faces and a local normal vector angle threshold. The global normal vector constraint is determined based on the angle between the normal vectors of the second and first triangular faces and the 3D block containing the first triangular face and a global normal vector angle threshold.
2. The method according to claim 1, characterized in that, After performing conformal mapping on the three-dimensional blocks to obtain the two-dimensional tiles and the first texture coordinates of the vertices corresponding to the two-dimensional tiles, the method further includes: For any triangular face in the three-dimensional block, the directed area of the triangular face is determined according to the first texture coordinates of the vertices in the triangular face, and the vertices corresponding to the two-dimensional block include the vertices in the triangular face. If the directed area of any triangular face is less than or equal to the directed area threshold, the three-dimensional block is divided into multiple three-dimensional sub-blocks using the arbitrary triangular face as a seed and the region growing technique is used. Conformal mapping is performed on the plurality of three-dimensional sub-blocks to obtain the two-dimensional sub-blocks corresponding to each three-dimensional sub-block and the texture coordinates of the vertices corresponding to each two-dimensional sub-block; Based on the texture coordinates of the vertices corresponding to each two-dimensional sub-block, the updated first texture coordinates of the vertices corresponding to the two-dimensional block are obtained.
3. The method according to claim 1, characterized in that, Before performing the permutation using the heuristic algorithm, the method further includes: According to the block adjacency information, some two-dimensional blocks from multiple two-dimensional blocks are combined into a two-dimensional block group. The two-dimensional block group belongs to the two-dimensional blocks to be arranged. The block adjacency information is used to represent the adjacency relationship of the multiple three-dimensional blocks.
4. The method according to claim 3, characterized in that, In the case where holes exist in the two-dimensional tile group, the method further includes: A first tile pair is determined, which includes a first two-dimensional tile in the two-dimensional tile group with the inner contour of the hole as the boundary and a second-order adjacent tile of the first two-dimensional tile; The three-dimensional coordinates of the feature vertices corresponding to the first tile pair are transformed to the first local reference coordinate system to obtain the local three-dimensional coordinates of the feature vertices corresponding to the tile pair. The feature vertices corresponding to the first tile pair are the pair of vertices that are closest to each other in three-dimensional space. The first local reference coordinate system is determined based on the geometric midpoints corresponding to the feature vertices corresponding to the first tile pair and the normal vectors of the three-dimensional blocks corresponding to the first tile pair. Based on the local 3D coordinates of the feature vertices corresponding to the first tile pair, the first texture coordinates of the corresponding vertices of the first tile pair are corrected.
5. The method according to claim 3, characterized in that, The method further includes: Determine a second tile pair, which includes a second two-dimensional tile in the two-dimensional tile group whose boundary is the outer contour of the two-dimensional tile group and a second-order adjacent tile of the second two-dimensional tile; The three-dimensional coordinates of the feature vertices corresponding to the second tile pair are transformed to the second local reference coordinate system to obtain the local three-dimensional coordinates of the feature vertices corresponding to the tile pair. The feature vertices corresponding to the second tile pair are the pair of vertices that are closest to each other in three-dimensional space. The second local reference coordinate system is determined based on the geometric midpoints corresponding to the feature vertices corresponding to the second tile pair and the normal vectors of the three-dimensional blocks corresponding to the second tile pair. Based on the local 3D coordinates of the feature vertices corresponding to the second tile pair, the first texture coordinates of the corresponding vertices of the second tile pair are corrected.
6. The method according to claim 5, characterized in that, The second tile has a normal angle to the corresponding 3D block that is less than or equal to the normal angle filtering threshold, and / or The projection overlap rate of the three-dimensional block corresponding to the second patch on the projection plane is less than or equal to the projection overlap rate threshold. The normal vector of the projection plane is obtained by weighted averaging the normal vector of the three-dimensional block corresponding to the second patch based on the geometric area of the three-dimensional block corresponding to the second patch. The projection overlap rate of the three-dimensional block corresponding to the second patch on the projection plane is determined by the minimum value among the projection area of the projection overlap region of the second patch on the projection plane, the projection area of the projection region of the second two-dimensional block on the projection plane, and the projection area of the projection region of the second-order adjacent patch of the second two-dimensional block on the projection plane.
7. The method according to any one of claims 3-6, characterized in that, The method further includes: The convex hull utilization rate of the two-dimensional tile group is determined based on the texture area of the two-dimensional tile group and the texture area of the corresponding convex hull region of the two-dimensional tile group. If the convex hull utilization rate of the two-dimensional tile group is less than or equal to the convex hull utilization rate threshold, the portion of the two-dimensional tiles is used as the two-dimensional tiles to be arranged; otherwise, the two-dimensional tile group is used as the two-dimensional tiles to be arranged.
8. A texture remapping device for a three-dimensional model, characterized in that, The device includes: The acquisition module is used to acquire 3D models; The segmentation module is used to divide the three-dimensional model into blocks based on the topological structure information of the three-dimensional model, thereby obtaining multiple three-dimensional blocks; The parameterization module is used to perform conformal mapping on the multiple three-dimensional blocks to obtain the two-dimensional tile corresponding to each three-dimensional block and the first texture coordinates of the vertex corresponding to each two-dimensional tile; The arrangement module is used to arrange the two-dimensional tiles to be arranged using a heuristic algorithm based on the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, thereby obtaining the layout position of the two-dimensional tiles to be arranged, and to update the first texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged based on the layout position of the two-dimensional tiles to be arranged, thereby obtaining the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged. The two-dimensional tiles to be arranged are determined based on the two-dimensional tiles corresponding to each three-dimensional block. The mapping module is used to remap the first texture map of the three-dimensional model according to the second texture coordinates of the vertices corresponding to the two-dimensional tiles to be arranged, so as to obtain the second texture map. The segmentation module divides the 3D model into blocks based on its topological structure information, resulting in multiple 3D blocks, including: For the first triangular facet in the three-dimensional model, the second triangular facet adjacent to the first triangular facet in the three-dimensional model is determined using the region growing technique according to the topological structure information. Based on local and / or global normal vector constraints, the second triangular face is added to the 3D block containing the first triangular face. The local normal vector constraint is determined based on the angle between the normal vectors of the first and second triangular faces and a local normal vector angle threshold. The global normal vector constraint is determined based on the angle between the normal vectors of the second and first triangular faces and the 3D block containing the first triangular face and a global normal vector angle threshold.
9. A computing device, characterized in that, The computing device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 7.