WO2023197779A9 - 三维模型的展开方法、装置、设备及存储介质 - Google Patents

三维模型的展开方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023197779A9
WO2023197779A9 PCT/CN2023/079872 CN2023079872W WO2023197779A9 WO 2023197779 A9 WO2023197779 A9 WO 2023197779A9 CN 2023079872 W CN2023079872 W CN 2023079872W WO 2023197779 A9 WO2023197779 A9 WO 2023197779A9
Authority
WO
WIPO (PCT)
Prior art keywords
splicing
combination
basic
sequence
dimensional model
Prior art date
Application number
PCT/CN2023/079872
Other languages
English (en)
French (fr)
Other versions
WO2023197779A1 (zh
Inventor
曹哲
黄舒怀
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2023197779A1 publication Critical patent/WO2023197779A1/zh
Publication of WO2023197779A9 publication Critical patent/WO2023197779A9/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/32Indexing scheme for image data processing or generation, in general involving image mosaicing

Definitions

  • Embodiments of the present application relate to the field of virtual scene technology, and in particular to a three-dimensional model expansion method, device, equipment and storage medium.
  • UV expansion is an important link in the production of art resources.
  • the 2D plane is also called a UV plane
  • the expanded 3D mesh is mapped and shaded on a 2D plane, and the 3D model is rendered based on the map shading results in the 2D plane.
  • Embodiments of the present application provide a three-dimensional model expansion method, device, equipment and storage medium.
  • the technical solution includes the following aspects.
  • a three-dimensional model expansion method is provided, the method is executed by a computer device, and the method includes:
  • the basic splicing unit set includes each basic splicing unit obtained based on the UV island of the three-dimensional model;
  • a three-dimensional model expansion device is provided, and the device includes:
  • a unit set acquisition module used to expand the three-dimensional model and obtain a basic splicing unit set of the three-dimensional model;
  • the basic splicing unit set includes each basic splicing unit obtained based on the UV island of the three-dimensional model;
  • a sequence construction module used to construct a splicing combination sequence based on the basic splicing unit set; the splicing combination sequence includes each splicing combination obtained by combining each of the basic splicing units based on the model expansion requirements; the model expansion requirements include At least one optimization energy formulated based on model design requirements; the optimization energy is used to indicate the geometric properties of the splicing combination;
  • a combination verification module used to verify each of the splicing combinations in the splicing combination sequence and obtain the splicing result of the basic splicing unit;
  • a result generation module is configured to generate an expansion result of the three-dimensional model based on the splicing result of the basic splicing unit.
  • a computer device includes a processor and a memory.
  • the memory stores at least one computer program.
  • the at least one computer program is loaded and executed by the processor to implement the above three-dimensional process. How to unfold the model.
  • a computer-readable storage medium is provided, and at least one computer program is stored in the computer-readable storage medium.
  • the computer program is loaded and executed by a processor to implement the above-mentioned three-dimensional model expansion method.
  • the computer program product includes at least one computer program.
  • the computer program is loaded and executed by a processor to implement the three-dimensional model expansion method provided in the above various optional implementations. .
  • the basic splicing unit set of the three-dimensional model is obtained; the basic splicing units in the basic splicing unit set are combined to obtain multiple splicing combinations, and at least one optimization energy formulated according to the model design requirements is constructed based on each splicing combination.
  • Splicing combination sequence by verifying the splicing combinations in the splicing combination sequence, the splicing result of the basic splicing unit is obtained, and then the expansion result of the three-dimensional model is generated based on the splicing result of the basic splicing unit.
  • Figure 1 shows a schematic architectural diagram of a model expansion system provided by an exemplary embodiment of the present application
  • Figure 2 shows a flow chart of a three-dimensional model expansion method provided by an exemplary embodiment of the present application
  • Figure 3 shows a flow chart of another three-dimensional model expansion method provided by an exemplary embodiment of the present application
  • Figure 4 shows a schematic diagram of the process of obtaining a second polygon set according to an exemplary embodiment of the present application
  • Figure 5 shows a schematic diagram of the process of obtaining a fourth polygon set according to an exemplary embodiment of the present application
  • Figure 6 shows a schematic diagram of planar pre-splicing according to an exemplary embodiment of the present application
  • Figure 7 shows a schematic diagram of the pre-stitching process of a three-dimensional model according to an exemplary embodiment of the present application
  • Figure 8 shows a schematic diagram of the color bleeding phenomenon according to an exemplary embodiment of the present application.
  • Figure 9 shows a schematic diagram of the process of splicing combination verification based on the proposal-review mechanism according to an exemplary embodiment of the present application
  • Figure 10 shows a schematic diagram comparing the automatic 2UV final result after baking with the manual 2UV baking result
  • Figure 11 shows a block diagram of a three-dimensional model expansion device according to an exemplary embodiment of the present application
  • Figure 12 shows a structural block diagram of a computer device according to an exemplary embodiment of the present application.
  • Three-dimensional mesh It is a form of discrete representation of a three-dimensional model by combining polygons.
  • the main data includes vertices, edges and faces.
  • the three-dimensional mesh includes: countless patches in three-dimensional space used to represent the surface of the three-dimensional model.
  • the minimum component of a three-dimensional mesh is a triangular patch.
  • the surface of the three-dimensional model can be divided into countless triangular patches.
  • the countless triangular patches constitute the three-dimensional mesh of the three-dimensional model. For example, there are multiple points on the three-dimensional model, and the interconnections between the multiple points form a three-dimensional grid.
  • UV Unwrapping refers to the process of cutting the three-dimensional mesh of the three-dimensional model and flattening it to a two-dimensional plane.
  • the two-dimensional plane space is also called UV space or texture space, where U is the two-dimensional plane.
  • the horizontal axis (or vertical axis) of the plane, V is the vertical axis (or horizontal axis) of the two-dimensional plane.
  • the space where u and v have values between 0 and 1 is the unit UV space, so the process of flattening the three-dimensional model into UV space is also called UV expansion.
  • UV Island After the three-dimensional grid is cut, it will be divided into many grid blocks (equivalent to cutting the three-dimensional model into many models). Each grid block is flattened into the UV space to form the UV space.
  • Each independent two-dimensional grid in The model (two-dimensional polygon) is like an island floating in the UV space, so the two-dimensional grid is called a UV island.
  • a UV island is an independent two-dimensional polygon obtained by cutting and flattening the three-dimensional mesh of the three-dimensional model into the UV space, where independent means that one UV island is not connected to other UV islands in the UV space.
  • the three-dimensional mesh of the three-dimensional model is cut into independent mesh blocks, and a mesh block is flattened into the UV space to obtain a UV island.
  • UV texture Artists will draw pictures in UV space.
  • the drawn pictures are called textures.
  • the drawn textures can be mapped back to the three-dimensional grid surface to achieve three-dimensional representation. The purpose of model color, material, light and shadow and other effects.
  • 1UV, 2UV Most game art resources use two sets of UV, generally called 1UV and 2UV. 1UV is used to draw color textures, normal textures, etc., while 2UV is used to draw lighting textures, shadow textures, etc.
  • NPC problem Non-deterministic Polynomial Complete Problem: a non-deterministic problem of completely polynomial complexity.
  • P-type problems refer to problems that can be solved in polynomial time
  • NP problems refer to problems that are not sure whether they can be solved in polynomial time but the correctness of the solution can be determined.
  • the NPC problem is a NP problem, and all NP problems can be reduced to this problem in polynomial time.
  • Soft and Hard Edge A definition and classification of the three-dimensional mesh edges of the three-dimensional model that artists use when making three-dimensional models.
  • the light and shadow on both sides of the hard edge change drastically, forming an obvious contrast between light and dark; while the light and shadow on both sides of the soft edge are excessively smooth, and the light and dark are blurred.
  • Ray Casting Starting from a certain point, constructing a view cone in a set direction, and then casting discretely sampled rays within the view cone. The point is determined by counting the collision results of all projected rays. Directional visibility. This method is commonly used for collision detection and graphics rendering.
  • Normal Curvature A quantity that describes the degree of curvature of a surface in a certain direction.
  • Principal Curvature There are infinitely many orthogonal curvatures at a certain point on the surface. There is a curve among which the curvature of the curve is maximum. This curvature is the maximum value k_max, which is perpendicular to the surface of maximum curvature. The curvature is the minimum value k_min. These two curvatures are called principal curvatures, and they represent the extreme values of normal curvature.
  • Gaussian Curvature The Gaussian curvature at a point on the surface is the product of the main curvatures k_max and k_min at the point, and is an intrinsic measure of curvature.
  • UV Packing/UV Nesting refers to the process of arranging UV islands into unit UV space at fixed intervals. Generally, it is required to fill the space as much as possible.
  • Figure 1 shows a schematic diagram of a computer device provided by an exemplary embodiment of the present application.
  • the computer device can be used to execute the three-dimensional model expansion method provided by the present application.
  • the computer device may be: a server 110 or a terminal 120.
  • the above-mentioned server 110 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, and cloud communications. , middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • cloud services cloud databases, cloud computing, cloud functions, cloud storage, network services, and cloud communications.
  • middleware services domain name services, security services
  • CDN Content Delivery Network, content distribution network
  • cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • the above-mentioned terminal 120 may be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart TV, a vehicle-mounted terminal, etc. with a display function, but is not limited thereto.
  • the terminal 120 can be used to display the three-dimensional model and the expansion results of the three-dimensional model at various stages.
  • the number of servers 110 may be one or more, and the number of terminals 120 may be one or more. This embodiment of the present application does not limit the number of servers 110 and terminals 120.
  • the server 110 can execute the three-dimensional model expansion method provided in this application to generate a three-dimensional model expansion result.
  • the server 110 can map and color the three-dimensional model based on the expansion result of the three-dimensional model to obtain a rendering result, and send the rendering result to the terminal 120 for display.
  • the terminal 120 can execute the expansion method of the three-dimensional model provided by this application to generate The unfolded results of the 3D model.
  • the terminal 120 may map, color and display the three-dimensional model based on the expansion result of the three-dimensional model.
  • the terminal and the server are connected through the communication network.
  • the communication network is a wired network or a wireless network.
  • the above-mentioned wireless network or wired network uses standard communication technologies and/or protocols.
  • the network is usually the Internet, but can also be any network, including but not limited to Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (Wide Area Network, WAN), mobile, wired or wireless Any combination of networks, private networks, or virtual private networks.
  • data exchanged over the network is represented using technologies and/or formats including HyperText Mark-up Language (HTML), Extensible Markup Language (XML), etc.
  • SSL Secure Socket Layer
  • TLS Transport Layer Security
  • VPN Virtual Private Network
  • IPsec Internet Protocol Security
  • customized and/or dedicated data communication technologies may also be used in place of or in addition to the above-described data communication technologies. This application is not limited here.
  • Figure 2 shows a flow chart of a three-dimensional model expansion method provided by an exemplary embodiment of the present application.
  • the method can be executed by a computer device.
  • the computer device can be implemented as a server or a terminal.
  • the computer device can be as shown in Figure 2
  • the expansion method of the three-dimensional model may include the following steps.
  • Step 210 Expand the three-dimensional model to obtain a basic splicing unit set of the three-dimensional model; the basic splicing unit set includes each basic splicing unit obtained based on the UV island of the three-dimensional model.
  • This basic splicing unit is the splicing result obtained based on the UV island of the three-dimensional model.
  • the three-dimensional model is a model built based on a three-dimensional mesh;
  • the three-dimensional mesh (3D Mesh) is a model representation form that uses polygons to discretely represent the three-dimensional model.
  • the main data of the three-dimensional mesh includes vertices, edges, and faces.
  • the three-dimensional model expansion involved in the embodiments of this application can also be called UV Unwrapping of the three-dimensional model, which refers to the process of cutting the three-dimensional mesh that constitutes the three-dimensional model and flattening it to a two-dimensional plane;
  • the two-dimensional model Plane space can also be called UV space, where U is the horizontal axis (or vertical axis) of the two-dimensional plane, and V is the vertical axis (or horizontal axis) of the two-dimensional plane; U and V take values between 0 and 1.
  • the space is the unit UV space.
  • the basic splicing unit of the three-dimensional model may be the splicing result of the UV island obtained after the computer device cuts, expands and splices the three-dimensional model.
  • the computer device performs UV expansion on the three-dimensional grid of the three-dimensional model to obtain at least two UV islands of the three-dimensional model.
  • the at least two UV islands constitute a UV island set; the UV islands in the UV island set that have adjacency relationships are spliced. , obtain at least one basic splicing unit.
  • the computer device cuts and expands the three-dimensional mesh of the three-dimensional model to obtain at least two UV islands of the three-dimensional model, and splices adjacent UV islands to obtain a basic splicing unit.
  • the basic splicing unit is obtained by simply splicing UV islands.
  • the basic splicing principles for example, judging from the curvature and normal of the two UV islands, two adjacent UV islands are relatively gentle, and can be spliced into a developable unit. Surface), initially splice the splicable UV islands together to obtain the basic splicing unit.
  • the optimization energy is used to characterize the relationship between the geometric attributes of the splicing combination and the geometric attribute requirements; the more the geometric attributes meet the geometric attribute requirements corresponding to the geometric attributes, the smaller the energy value of the optimization energy; the less the geometric attributes.
  • the geometric attributes of the splicing combination can include the length of the visible secant, the length of the soft edge secant, the length of the long and narrow hard edge suture, shape, and symmetry , degree of distortion, and at least one of the length difference between the total length of the tangent line before splicing and the length of the splicing suture; it should be noted that based on actual needs, the computer equipment can set other geometric attributes of the splicing combination and optimization corresponding to other geometric attributes. Energy, so that when the optimization energy of other geometric properties is included in the model unfolding requirements, the computer device can obtain the splicing group based on the optimization energy of other geometric properties.
  • the model expansion requirements may be formulated by relevant personnel based on model design requirements. Different model design requirements may correspond to different model expansion requirements, that is, at least one optimization energy formulated for different model design requirements is different.
  • the computer device can first obtain the basic splicing units based on the set of basic splicing units to construct multiple splicing combinations; and then construct the splicing combination sequence based on the multiple splicing combinations.
  • Step 230 Verify each splicing combination in the splicing combination sequence to obtain the splicing result of the basic splicing unit.
  • the splicing result of the basic splicing unit can be: the splicing result obtained after splicing the basic splicing units in the splicing combination that has passed the verification; for example, the splicing combination that has passed the verification is the basic splicing unit A + the basic splicing unit B, and the splicing combination corresponds to The splicing result of the basic splicing unit is AB.
  • the computer device can verify each splicing combination in sequence according to the order of each splicing combination in the above-mentioned splicing combination sequence.
  • the above-mentioned process of constructing a splicing combination sequence and verifying the splicing combinations in the splicing combination sequence can be called a proposal-review mechanism; wherein each splicing combination in the splicing combination sequence corresponds to a proposal , the verification process of each splicing combination in the splicing combination sequence is the review process of each splicing combination in the splicing combination sequence.
  • Step 240 Generate an expansion result of the three-dimensional model based on the splicing result of the basic splicing unit.
  • a two-dimensional plane also called "UV space”
  • a three-dimensional space are involved, and there is a mapping relationship between the two-dimensional plane and the three-dimensional space; when splicing the UV islands in the two-dimensional plane , based on the mapping relationship between the two-dimensional plane and the three-dimensional space, the computer equipment can simultaneously splice the three-dimensional grid corresponding to the UV island, and then expand the spliced three-dimensional grid to obtain the three-dimensional grid. 2D splicing results.
  • the grid splicing result corresponding to the basic splicing unit in the three-dimensional space can be simultaneously obtained. After expanding the grid splicing result corresponding to the basic splicing unit in the three-dimensional space, Generate the unfolded results of the 3D model.
  • the unfolding result can be mapped and colored in the UV control.
  • the three-dimensional model expansion method obtains a basic splicing unit set of the three-dimensional model by unfolding the three-dimensional model; and combines the basic splicing units in the basic splicing unit set to obtain multiple splicing combinations.
  • a splicing combination sequence is constructed based on each splicing combination; by verifying the splicing combinations in the splicing combination sequence, the splicing results of the basic splicing units are obtained, and then the splicing results of the basic splicing units are generated The unfolded results of the 3D model.
  • the three-dimensional model expansion method provided by the embodiments of the present application can be applied to scenes that require three-dimensional model expansion; schematically, the three-dimensional model expansion method can be applied to but is not limited to scenes of UV expansion of game models, vehicles, etc. Scenes of UV expansion of models, scenes of UV expansion of architectural models, and other model design scenarios; further, the expansion method of the three-dimensional model can be adapted to various irregular UV islands that exist in the UV expansion of the three-dimensional model. Condition.
  • the computer device can map the drawn UV texture back to the three-dimensional grid surface, that is, map it back to the three-dimensional model, thereby representing the color, material, light and shadow and other effects of the three-dimensional model.
  • 1UV and 2UV two sets of UV are usually involved, called 1UV and 2UV. 1UV is used to draw color textures, normal textures, etc., and 2UV is used to draw lighting textures, shadow textures, etc. .
  • the three-dimensional model expansion method provided by the embodiment of the present application can be used to cut and expand the game model to obtain a basic splicing unit set of the three-dimensional model; based on the basic splicing unit set, a splicing that meets the model expansion requirements is constructed Combination sequence; the model expansion requirement is used to indicate at least one optimization energy formulated based on the design requirements of the game model; each splicing combination in the splicing combination sequence is verified to obtain the splicing result of the basic splicing unit; finally, based on the basic splicing unit
  • the expansion result generates the expansion result of the game model, thereby automating the expansion process of the game model and improving the expansion effect of the game model.
  • the server when the method provided by this application is executed by a server, the server can be implemented as a cloud server in the cloud platform for unfolding the three-dimensional model; the cloud server can be provided with an external interface to receive the to-be-processed data sent by the terminal.
  • the three-dimensional model is expanded by the three-dimensional model, and the expansion result of the three-dimensional model is returned to the terminal; for example, when the cloud server receives the game model sent by the terminal, the game model can be expanded through the three-dimensional model expansion method provided by this application.
  • the expansion result of the game model is obtained, and the expansion result of the game model is returned to the terminal, so that the terminal displays the expansion result of the game model through the corresponding application program interface and performs further processing.
  • the process of unfolding a three-dimensional model is an NPC problem (Non-deterministic Polynomial Complete Problem), that is, a non-deterministic problem of completely polynomial complexity; among them, P-type problems refer to problems that can be solved in polynomial time, while NP problems refer to It is not certain that the problem can be solved in polynomial time but the correctness of the solution can be determined.
  • the NPC problem is a NP problem, and all NP problems can be reduced to this problem in polynomial time.
  • the three-dimensional model expansion method provided by the embodiment of the present application can use the divide-and-conquer idea to solve the NPC problem of three-dimensional model expansion to minimize the complexity of the three-dimensional model expansion process.
  • the three-dimensional model expansion method determined based on the divide-and-conquer idea It can be divided into three links: dismantling the UV island, pre-splicing the UV island, and splicing the UV island under the proposal-review mechanism; among them, when the UV island is disassembled, the cutting unit can be defined based on the unfolding characteristics and production principles, and the three-dimensional model can be Disassemble it into fragmented UV islands that are convenient for UV expansion; when pre-splicing the UV islands, the fragmented UV islands can be pre-spliced and re-UV expanded based on the model design requirements; finally, based on the results of the pre-splicing of the UV islands, through The proposal-review mechanism performs overall UV island splicing and expansion to obtain the expansion results of the three-dimensional model.
  • Figure 3 shows a flow chart of another three-dimensional model expansion method provided by an exemplary embodiment of the present application.
  • the method can be executed by a computer device.
  • the computer device can be implemented as a server or a terminal.
  • the computer device can be as follows: For the server or terminal shown in Figure 1, as shown in Figure 3, the expansion method of the three-dimensional model may include the following steps.
  • Step 310 Cut and expand the three-dimensional model based on the cutting unit to obtain a UV island set, which contains fragmented UV islands of the three-dimensional model.
  • the computer device can disassemble the three-dimensional model based on the cutting unit to obtain fragmented, fragmented UV islands that are easy to UV unfold.
  • UV Island refers to the two-dimensional grid model in UV space; after cutting the three-dimensional grid, a larger number of three-dimensional blocks will be obtained, and these three-dimensional blocks will be expanded into UV space respectively to obtain each Three-dimensional blocks are two-dimensional grid models that are independent of each other in UV space. These two-dimensional grid models are UV islands.
  • the fragmented UV islands of the three-dimensional model can be obtained in different ways; under different circumstances, the cutting units used to obtain the fragmented UV islands are different.
  • the computer device when it obtains the fragmented UV island of the three-dimensional model, it can perform different cuts on the three-dimensional model based on whether there is a 1UV expansion result of the three-dimensional model; the 1UV expansion result can be based on the expansion requirements of the 1UV for the three-dimensional model.
  • the unfolding result obtained after unfolding.
  • the computer device may obtain the UV island set. To implement the following steps.
  • the 1UV expansion result is the expansion result obtained by performing 1UV cutting and expansion on the three-dimensional model
  • the first polygon set contains the corresponding 1UV expansion result 2D polygon.
  • S3102 Perform overlap detection on the two-dimensional polygons in the first polygon set to obtain a second polygon set; the second polygon set includes unconnected and non-overlapping two-dimensional polygons.
  • perform overlap detection on the two-dimensional polygons in the first polygon set, and the process of obtaining the second polygon set can be implemented as:
  • the overlap detection process includes:
  • the first polygon is any one of the two-dimensional polygons in the first polygon set;
  • the overlap detection sub-process includes:
  • the first neighborhood polygon of the second polygon is a two-dimensional polygon that has an adjacent relationship with the second polygon; or the first domain polygon is a three-dimensional polygon with the second polygon.
  • Polygons are polygons that have adjacency relationships on the model. Neighboring polygons can also be called adjacent polygons;
  • Two-dimensional polygons in the first neighborhood polygon that do not overlap with the two-dimensional polygons included in the first set are added to the detection sequence.
  • first polygon set obtained through 1UV expansion for each two-dimensional polygon, overlap detection with its neighbor polygons is performed to obtain a first set; for multiple first polygons
  • the multiple two-dimensional polygons in the shape set obtain multiple first sets, and the multiple first sets constitute a second polygon set (a set of non-overlapping two-dimensional polygons).
  • the first polygon set can be divided into multiple polygon groups according to whether they are adjacent, and overlap detection is performed in each polygon group to obtain a first set.
  • Multiple polygon groups respectively obtain multiple first sets, forming a second polygon set.
  • any first two-dimensional polygon in the first polygon set add it to the first set, then obtain the neighborhood polygons of the first first two-dimensional polygon, and determine whether each neighborhood polygon is consistent with the first two-dimensional polygon.
  • Two-dimensional polygons overlap. For neighborhood polygons that do not overlap, add them to the first set, and obtain the neighborhood polygons of the neighborhood polygons to further determine whether they overlap. If there is no overlap, put them into the first set. Set, and the detection process is repeated until no neighborhood polygons are obtained.
  • any two-dimensional polygon is selected from the first polygon set, and the two-dimensional polygon is used as the starting point to continuously determine whether the adjacent two-dimensional polygons overlap, and the ones without overlap are placed into the first polygon set. Set until no more adjacent two-dimensional polygons can be obtained, and a first set is obtained.
  • the first polygon in the first polygon set is added to the detection sequence; the first polygon is any one of the two-dimensional polygons in the first polygon set;
  • Figure 4 shows a schematic diagram of the process of obtaining a second polygon set according to an exemplary embodiment of the present application.
  • the first polygon set includes a two-dimensional image corresponding to the 1UV expansion result.
  • l is a positive integer, indicating the number of two-dimensional polygons contained in the second polygon set; when performing overlap detection on the two-dimensional polygons in the first polygon set, the computer device can detect the overlap from the first polygon set.
  • the polygon set randomly obtains a polygon p i , that is, the first polygon p i , and pushes the first polygon p i into the detection sequence Q; in the detection sequence Q, the second polygon q at the top of the sequence is taken out , add it to the first set, and obtain the first neighborhood polygon of the second polygon; add the two-dimensional polygons in the first neighborhood polygon that do not overlap with the two-dimensional polygons contained in the first set to In the detection sequence Q, the two-dimensional polygons in the first neighborhood polygons that overlap with the two-dimensional polygons included in the first set are not processed.
  • the computer device can add the neighborhood polygons to the detection sequence Q in the order of acquisition or verification order. , or they can also be added to the detection sequence Q in random order, and this application does not limit this. Thereafter, in accordance with the order of the two-dimensional polygons indicated by the detection sequence Q, the above-mentioned processing is performed on the second polygon at the top of the detection sequence Q in sequence until the detection sequence Q is empty.
  • the detection sequence Q corresponding to the first polygon p i is empty, it means that the overlap detection sub-process based on the first polygon p i ends, and the first set corresponding to the first polygon is obtained; if this When the first polygon set is not empty, another first polygon is randomly obtained from the current first polygon set, and the above overlap detection process is repeated until the first polygon set is empty; thus A second polygon set containing two-dimensional polygons in the first set corresponding to at least one first polygon is obtained.
  • the first set is a set of polygons obtained based on the overlap detection sub-process initiated by an optional first polygon in the first polygon set; each first polygon will have a corresponding first polygon. set; therefore, if the above overlap detection process is carried out for w rounds, w is a positive integer, and w ⁇ v, a first set corresponding to w first polygons will be generated.
  • the second polygon set P 2 contains w two-dimensional polygons in the first set.
  • the first polygon is the first polygon obtained from the first polygon set
  • the first second polygon obtained from the detection sequence is also is the first polygon.
  • the computer device in order to avoid repeated detection and redundant detection in the above-mentioned detection process, during the detection process, the computer device will compare the two-dimensional polygons in the first polygon set that are the same as the two-dimensional polygons included in the first set. 3D polygons are deleted; further, the computer equipment can mark the polygons that have been overlapped in pairs to avoid repeated detection of the detected polygons, resulting in a waste of computing resources; schematically, when the second most When the polygon is polygon 1, its neighbor polygons include polygon 2.
  • polygon 2 In the overlap detection sub-process corresponding to polygon 1, it is determined that polygon 2 and polygon 1 do not overlap, then polygon 2 can be added to the detection sequence, and Label polygon 1 and polygon 2, indicating that polygon 1 and polygon 2 have been overlapped.
  • the overlap detection process of polygon 2 it is obtained that the neighborhood polygons of polygon 2 include polygon 1, but because polygon 2 The overlap detection with polygon 1 has already been performed. Therefore, the overlap detection process of polygon 1 and the process of adding polygon 1 to the detection sequence can be skipped.
  • the first cutting unit is a cutting unit determined based on the second polygon set.
  • the first cutting unit may be a cutting unit determined based on the two-dimensional polygons included in the second polygon set.
  • the three-dimensional model is cut and expanded along the edges of the two-dimensional polygons in the second polygon set to obtain fragmentation
  • the fragmented UV islands constitute the UV island set in step 310.
  • a two-dimensional polygon is cut and expanded to obtain a UV island. That is, based on the 1UV expansion result, the two-dimensional polygons in the expansion result are de-overlapping; based on the de-overlapping two-dimensional polygons, the three-dimensional model is cut and expanded to obtain the UV island set.
  • the computer device can achieve cutting and unfolding of the three-dimensional model without using the 1UV expansion result. That is to say, regardless of whether there is a 1UV expansion result, the computer device can obtain the three-dimensional model in the following manner. To fragment UV islands, the process can be implemented as the following steps.
  • S3104 Obtain a third polygon set of the three-dimensional model; the third polygon set includes two-dimensional polygons obtained by cutting and expanding the three-dimensional mesh of the three-dimensional model.
  • the computer device can cut the three-dimensional grid of the three-dimensional model using the minimum division unit of the three-dimensional grid as the cutting unit to obtain the third polygon set of the third model.
  • the three-dimensional model is composed of several triangular patches, and the triangular patches are the minimum division units of the three-dimensional mesh of the three-dimensional model. Then the computer device can cut each triangular patch along the edge of the triangular patch of the three-dimensional model to obtain the third polygon set. For example, if the three-dimensional model consists of 100 triangular patches, then the three-dimensional model is cut along the smallest dividing unit to obtain 100 two-dimensional polygons (triangular patches), and the 100 two-dimensional polygons constitute the third polygon set.
  • S3105 Calculate the normal vectors of the three-dimensional grid corresponding to the two-dimensional polygons in the third polygon set, and obtain the normal vector set corresponding to the third polygon set.
  • the two-dimensional polygons in the third polygon set have corresponding three-dimensional grids in the three-dimensional space, and the computer device can obtain each The normal vector of the three-dimensional grid.
  • the normal vector is used to represent the orientation of the three-dimensional grid.
  • S3106 Obtain a fourth polygon set based on the third polygon set and the normal vector set; the fourth polygon set contains the largest expandable two-dimensional polygon in the third polygon set; wherein, the largest An expandable two-dimensional polygon is a two-dimensional polygon whose orientation difference between the two-dimensional polygons indicated by the normal vector is less than the difference threshold.
  • the process of obtaining the fourth polygon set can be implemented as:
  • the fourth polygon set contains at least one second set ;
  • the vector verification process includes:
  • the third polygon is any one of the two-dimensional polygons in the third polygon set;
  • the vector verification sub-process includes:
  • the second neighborhood polygon of the fourth polygon is the two-dimensional polygon corresponding to the neighborhood three-dimensional grid; the neighborhood three-dimensional grid is the three-dimensional grid corresponding to the fourth polygon.
  • a polygon (third polygon) in the third polygon set is obtained, and the third polygon is added to the second set.
  • Obtain the neighbor polygon of the third polygon which has an adjacent relationship with the third polygon on the three-dimensional model), and determine the difference in normal vectors between the neighbor polygon and the third polygon. If the difference is less than the difference threshold (or two (the angle between the normal vectors is less than the threshold), then add the neighborhood polygon to the second set, continue to obtain the neighborhood polygons of the neighborhood polygon, continue to judge whether the normal vector difference is less than the threshold, and repeat the judgment process until it cannot The neighborhood polygons are obtained, and finally a second set is obtained.
  • adjacent and gentle triangular faces (two-dimensional polygons) on the three-dimensional model are divided into a second set, thereby obtaining multiple second sets.
  • Figure 5 shows a schematic diagram of the process of obtaining a fourth polygon set according to an exemplary embodiment of the present application.
  • the number of two-dimensional polygons included in the shape set; the fourth polygon set includes at least one two-dimensional polygon in the second set, and the fourth polygon set can be expressed as P 4 ⁇ p 0 , p 1 ,. .., p k ⁇ .
  • k is a positive integer, indicating the number of two-dimensional polygons contained in the fourth polygon set; when performing vector verification on the two-dimensional polygons in the third polygon set, the computer device can obtain the result from the third polygon set.
  • the set randomly obtains a polygon p d , that is, the third polygon p d , and pushes the third polygon p d into the verification sequence F; the method of obtaining the fourth polygon f at the top of the sequence in the verification sequence F vector And the normal vector of the third polygon p d
  • the fourth polygon is The shape is added to the second set, and the second neighborhood polygon of the fourth polygon is obtained; the second neighborhood polygon is added to the verification sequence F.
  • the computer device can be added to the detection sequence according to the acquisition order or verification order of the neighborhood polygons, or it can also be added to the detection sequence in random order. This application There are no restrictions on this. Thereafter, according to the order of the polygons indicated by the verification sequence F, the orientation difference judgment is performed on the normal vector of the fourth polygon at the top of the detection sequence F and the normal vector of the third polygon until the detection sequence is empty.
  • the verification sequence F corresponding to the third polygon p d is empty, it means that the vector verification sub-process based on the third polygon p d ends, and the second set corresponding to the third polygon is obtained; if at this time The third polygon set is not empty, then randomly obtain another third polygon from the current third polygon set, and repeat the above vector verification process until the third polygon set is empty; thereby obtaining A fourth polygon set including two-dimensional polygons in the second set corresponding to at least one third polygon.
  • the second set is a set of polygons obtained based on the vector verification sub-process initiated by an optional third polygon in the third polygon set; each third polygon will have a corresponding second set ; Therefore, if the above vector combination verification process is carried out for s rounds, s is a positive integer, and s ⁇ t, a second set corresponding to s third polygons will be generated.
  • the fourth polygon set P 4 contains s two-dimensional polygons in the second set.
  • the third polygon is the first polygon obtained from the third polygon set
  • the first fourth polygon obtained from the verification sequence It is also the third polygon.
  • the orientation difference is determined based on the normal vectors of the two, the orientation difference between the third polygon and the third polygon itself is determined.
  • the fourth polygon is added to the second set; if the normal vector of the third polygon and the fourth polygon are If the normal vector of the side makes the above inequality invalid, then the fourth side will not be added to the second set.
  • the computer device in order to avoid repeated detection and redundant detection in the above detection process, during the detection process, the computer device will delete the same two-dimensional polygons contained in the third polygon set as those in the second set. ; Further, the computer device can mark the polygons that have been verified by pairwise vectors to avoid repeated detection of the detected polygons, resulting in a waste of computing resources.
  • S3107 Cut and expand the three-dimensional model based on the second cutting unit to obtain fragmented UV islands of the three-dimensional model; the second cutting unit is a cutting unit determined based on the fourth polygon set.
  • the second cutting unit may be a cutting unit determined based on the two-dimensional polygons included in the fourth polygon set.
  • the fourth polygon set includes multiple second sets, and the multiple two-dimensional polygons in a second set can be expanded at most, then the edges of each second set can be expanded
  • the three-dimensional model is cut and expanded to obtain the UV island set of the three-dimensional model.
  • multiple two-dimensional polygons in a second set form a UV island.
  • UV island set For example, after using the cutting results (UV island set) obtained by the above method, these UV islands can be further disassembled according to the art production requirements, that is, invisible cutting lines and hard edge cutting lines can be added.
  • the computer equipment can first calculate the invisible part through the ray casting method, and then analyze the distribution of the invisible area on the current UV island, cut the highly significant invisible area from the middle to generate two new UV islands, and then Iterate until all UV islands are processed.
  • computer equipment can cut the hard edges of all UV islands based on the hard edges of the art marks (manual marks) (contained in the model data) to obtain more finely divided UV islands isolated by hard edges.
  • the UV island set obtained by disassembling the above method not only retains the artistic intention of 1UV as much as possible, but also has good scalability and covers all reasonable secants (invisible secants) in the art production principles. Lines and hard edge secants), of course these secants are excessive, so next you need to remove the excess secants by splicing UV islands.
  • Step 320 Pre-splicing and re-expanding are performed based on the UV island set to obtain a basic splicing unit set of the three-dimensional model.
  • the basic splicing unit is the splicing result obtained based on the fragmented UV island of the three-dimensional model.
  • pre-splicing and re-expanding based on the UV island set refers to determining whether each fragmented UV island has a common edge or an adjacency relationship in a two-dimensional plane.
  • the UV islands are spliced together.
  • UV islands with common edges or adjacency relationships are spliced into three-dimensional blocks corresponding to the three-dimensional space; after each spliced three-dimensional block is re-expanded , each basic splicing unit of the three-dimensional model can be obtained, thereby obtaining the basic splicing unit set of the three-dimensional model.
  • the basic splicing unit of the three-dimensional model can be the result obtained after splicing and unfolding at least two fragmented UV islands. That is to say, one basic splicing unit of the three-dimensional model can correspond to at least two fragmented UV islands. .
  • pre-stitch and re-expand based on the UV island set to obtain the basic splicing unit set of the 3D model including:
  • At least one pre-splicing method includes at least one of plane pre-splicing, soft-edge pre-splicing and semantic segmentation pre-splicing;
  • the plane pre-splicing is used to indicate the method of splicing through neighborhood spreading and plane splicing;
  • the soft edge pre-splicing is used to indicate the method of dividing the 3D model into regions through hard edges, and then splicing the 3D model through heuristic search in each area;
  • the semantic segmentation pre-splicing is used to indicate the use of the geometric semantic features of the 3D model to perform 3D stitching.
  • the model is decomposed to obtain semantic segmentation areas, which are spliced within each semantic segmentation area.
  • plane pre-splicing refers to using the neighborhood spreading method to obtain the largest plane set in the three-dimensional model, which contains at least two planes; then according to the definition of the developable surface on the discrete grid, if the adjacent After splicing the planes, the malleability can be guaranteed, that is, the Gaussian curvature is 0, then the two planes will be spliced together; conversely, if the adjacent planes cannot guarantee the malleability after splicing, that is, the Gaussian area is not 0, then the two planes will not be spliced.
  • Figure 6 shows a schematic diagram of plane pre-splicing according to an exemplary embodiment of the present application.
  • plane 610 and plane 620 are any two planes in the largest plane set, and after plane 610 and plane 620 are spliced Extensibility can be ensured, so the plane 610 and the plane 620 can be spliced.
  • Soft edge pre-stitching refers to using hard edges to divide the 3D model into multiple areas. During soft edge pre-stitching, splicing is performed in each area based on the hard edge division. Since soft-edge splicing has a higher priority in the art production process, soft-edge pre-splicing can ensure the accuracy of the splicing effect; when splicing in each area, heuristic search can be used to achieve the desired results in each area. Among them, the heuristic search method may include: greedy algorithm, annealing algorithm, genetic algorithm, ant colony algorithm and other heuristic methods, as well as the proposal-review mechanism splicing method provided by the embodiment of this application.
  • the proposal review mechanism refers to a plan that adds the proposal content to the proposal sequence, and takes out the proposal content in the proposal sequence and reviews it in order to determine the feasibility of the proposal content; in different applications, the proposal-review mechanism The corresponding proposal content is different from the review content.
  • the proposal content is a planar splicing combination of each splicing plane generated by fragmented UV islands after planar preprocessing; in the semantic segmentation pre-splicing process , the content of this proposal is the splicing combination of each splicing result obtained after soft-edge pre-splicing.
  • Soft and Hard Edge are a definition and classification of model mesh edges using production tools when making three-dimensional models.
  • the light and shadow on both sides of the hard edge change drastically, forming an obvious contrast between light and dark; while the light and shadow transition on both sides of the soft edge is gentle and light and dark are blurred.
  • the basic splicing plane refers to each splicing plane generated after plane preprocessing of fragmented UV islands;
  • the plane splicing queue contains a plane splicing combination;
  • the plane splicing combination is a splicing combination composed of at least two planes;
  • the plane splicing combinations in the plane splicing queue are reviewed sequentially.
  • the soft-edge pre-splicing process can be performed simultaneously in each area divided based on the hard-edge. That is to say, the above-mentioned soft-edge pre-splicing process through the proposal-review mechanism can be implemented simultaneously in each area. In the area, the soft edge pre-splicing splicing result corresponding to each area is obtained, and the soft edge pre-splicing splicing result of the three-dimensional model is obtained.
  • Semantic segmentation pre-stitching refers to using the collective semantic features of the 3D model, such as size, shape, etc., to combine the original 3D
  • the model is decomposed and pre-stitched within each semantic segmentation area obtained by decomposition.
  • the semantic segmentation algorithm used when decomposing the original three-dimensional model can be the SDF (Shape Diameter Function) segmentation algorithm, or more geometric features can be introduced to differentiate different semantics.
  • the proposal-review mechanism provided by the embodiment of this application can be used Splicing method; among them, the implementation form of the proposal-review mechanism splicing method in semantic segmentation pre-splicing can refer to the soft-edge pre-splicing process and the process of splicing basic splicing units in the following embodiments, which will not be described again here.
  • the computer device when the computer device uses at least two pre-splicing methods to pre-splice and re-expand the fragmented UV islands, the computer device can follow the priority order corresponding to the at least two pre-splicing methods, Pre-splicing and re-expansion are performed in sequence.
  • Pre-splicing and re-expansion are performed in sequence.
  • the pre-splicing method including at least two of plane pre-splicing, soft-edge pre-splicing and semantic segmentation pre-splicing
  • the fragmented UV islands are pre-spliced and re-expanded through at least one pre-splicing method, Get basic splicing units, including:
  • the fragmented UV islands are pre-spliced and re-expanded to obtain the basic splicing unit.
  • the computer device can follow the priority order of each pre-stitching method, using the fragmented UV islands as the basis for splicing, and pass through different The pre-splicing method with a lower priority is spliced to obtain the splicing result; the pre-splicing method with a lower priority is further spliced based on the splicing result of the adjacent, high-priority previous pre-splicing method.
  • the priority of plane pre-stitching is higher than the priority of soft-edge pre-stitching; the priority of soft-edge pre-stitching is higher than the priority of semantic segmentation pre-stitching. That is to say, when the computer device obtains the pre-splicing result of the three-dimensional model based on the above three pre-splicing methods, it first splices and expands the fragmented UV islands through plane pre-splicing to obtain the plane pre-splicing splicing result; and then uses the soft Edge pre-splicing splices and expands the splicing results of plane pre-splicing to obtain soft-edge pre-splicing splicing results; then, the soft-edge pre-splicing splicing results are spliced and expanded through semantic segmentation pre-splicing to obtain semantic segmentation pre-splicing.
  • the splicing result is obtained, that is, the pre-stitching result of the three-dimensional model is obtained.
  • Figure 7 shows a schematic diagram of the pre-stitching process of a three-dimensional model according to an exemplary embodiment of the present application. It is assumed that plane pre-stitching, soft-edge pre-stitching and semantic segmentation are used in the pre-stitching process with fragmented UV islands. Pre-splicing Three pre-splicing methods.
  • the three pre-splicing methods are linearly processed according to the order of priority (including splicing and re-expansion), as shown in Figure 7, computer equipment
  • the pre-splicing results corresponding to the three pre-splicing methods are obtained respectively, and the pre-splicing results obtained by semantic segmentation pre-splicing are obtained.
  • the result is obtained as a basic splicing unit set; among them, the division results of the splicing area corresponding to different pre-splicing methods are different.
  • the above-mentioned method of dividing the splicing area based on the divide-and-conquer idea and using global features to deal with the splicing problem can reduce the complexity of the problem.
  • This method can be applied to models with complex structures and can improve the efficiency of model splicing.
  • Step 330 Construct a splicing combination sequence based on the basic splicing unit set; the splicing combination sequence includes each splicing combination obtained by combining each basic splicing unit based on the model expansion requirements; the model expansion requirements include at least one type formulated based on the model design requirements. Optimization energy; the optimization energy is used to indicate the geometric properties of the splice combination.
  • At least one optimization energy indicated by the model expansion requirements includes: visible secant length energy (E inv ), soft and hard edge length energy (E edge ), shape energy (E shape ), and symmetry energy (E symm ) , twist energy (E d ) and tangent length energy (E s ), etc.
  • FIG. 8 shows a schematic diagram of the color bleeding phenomenon according to an exemplary embodiment of the present application.
  • part (A) of Figure 8 shows the color bleeding phenomenon caused by soft edge secant lines, that is, Seams 810 are evident in the three-dimensional model
  • part (B) of Figure 8 shows the The color bleeding phenomenon caused by long and narrow hard edges means that black edges 820 appear in the three-dimensional model; therefore, the smaller the energy, the less the color bleeding phenomenon, thereby achieving the purpose of reducing the color bleeding phenomenon.
  • Shape energy (E shape ) indicates the number of irregular shapes. The smaller the shape energy, the better, so that the expansion result of the three-dimensional model has a regular shape and reduces irregular shapes. Irregular shapes include rings, holes, and slender strips. etc.
  • the symmetry energy (E symm ) is used to indicate the number of missing symmetry axes in the splicing combination. The smaller the symmetry energy (E symm ), the better, so that the expansion result of the three-dimensional model remains symmetrical.
  • the distortion energy (E d ) is used to indicate the total deformation amount of the angular deformation amount plus the area deformation amount. The smaller the distortion energy (E d ), the better, so that the distortion of the expansion result of the three-dimensional model is smaller.
  • the tangent length energy (E s ) is used to indicate the length difference obtained by subtracting the splicing suture length from the total tangent length before splicing. The smaller the tangent length energy (E s ), the better, so as to make the tangent length as short as possible.
  • the computer device can exhaustively exhaust the splicing combinations of the basic splicing units and push all the splicing combinations into the splicing combination sequence to construct the splicing combination sequence;
  • the computer device can search for the splicing combination sequence through heuristic conditions. The paths are pruned to reduce the amount of data processing and the complexity of the splicing problem.
  • splicing combination sequence based on the splicing combination constructed by the basic splicing unit, including:
  • a splicing combination sequence is constructed.
  • the pruning strategy may be a strategy set based on model design requirements; optionally, the pruning strategy based on at least one of the above optimization energies may include: a strategy based on splicing length, and a strategy based on splicing sutures. at least one of;
  • the strategy based on the splicing length includes: in response to the ratio of the length difference corresponding to the basic splicing combination to the length of the adjacent edge being less than the target threshold, rejecting the basic splicing combination; the length difference refers to the length of the adjacent edge of the two basic splicing units and the length of the two adjacent edges.
  • the splicing suture-based strategy includes rejecting the base splicing combination in response to a difference between the number of segments of the suture in the base splicing combination and the number of consecutive adjacent edges in two base splicing units in the base splicing combination being greater than a number threshold.
  • the splicing combinations with too short splicing lengths are screened out: when the adjacent sides of two basic splicing units are very long, but the sutures in the basic splicing combinations corresponding to these two basic splicing units are too short, the resulting splicing The resulting shape will be irregular and violate the principle of keeping the tangent length as short as possible. Therefore, this splicing combination is rejected. Filter out the splicing combinations of segmented splicing sutures: The constraint on the number of segments of the splicing sutures is used to ensure the effectiveness of the sutures. Generally speaking, the number of segments of the sutures in the basic splicing combination is equal to the two segments in the basic splicing combination.
  • a quantity threshold can be set to determine whether there are segments in the spliced suture through the difference between the number of segments of the suture and the number of consecutive adjacent edges.
  • the process of constructing the splicing combination sequence can be implemented as:
  • the optimized energy value includes the energy value of at least one optimized energy
  • a splicing combination sequence is constructed.
  • the computer device when the model expansion requirement formulates an optimized energy based on the model design requirements, that is to say, when the optimized energy value includes an energy value of an optimized energy, the computer device can be based on the optimization of each optimal splicing combination.
  • the energy value of the energy is used to sort each optimal splicing combination, the sorting result is obtained as a verification sequence, and based on the verification sequence, a splicing combination sequence is constructed.
  • n kinds of optimization energies have their own priorities; n ⁇ 2, And n is an integer;
  • each preferred splicing combination Based on the optimized energy value of each preferred splicing combination and the priority of n optimized energies, the verification order of each preferred splicing combination is obtained.
  • the priority order of at least one optimization energy can be formulated by relevant personnel based on model design requirements. That is to say, the model expansion requirements include at least one optimization energy formulated based on model related requirements, and at least one optimization energy respectively. priority.
  • the above six optimization energies can be sorted in order of priority as follows: visible secant length energy (E inv ), soft and hard edge lengths Energy (E edge ), shape energy (E shape ), symmetry energy (E symm ), twist energy (E d ), and tangent length energy (E s ).
  • E inv visible secant length energy
  • E edge soft and hard edge lengths Energy
  • shape energy E shape
  • symmetry energy E symm
  • twist energy E d
  • tangent length energy E tangent length energy
  • the energy values of the optimized energy are sorted according to the priority order, and judgments are made in sequence; schematically, taking the priority order of the six types of energy shown schematically above as an example, first according to the visible cut
  • the line length energy (E inv ) is sorted from small to large in order of the preferred splicing combinations. If in the sorting result, there are a preferred splicing combinations with the same visible secant length energy (E inv ), then a preferred splicing combination is used.
  • the combined soft and hard edge length energy (E edge ) is further sorted from small to large in order of a preferred splicing combination.
  • the verification order of the b preferred splicing combinations is further determined according to the shape energy (E shape ) of the b preferred splicing combinations, and so on, until the verification order of all the preferred splicing combinations is determined; schematically, it is assumed that there are 8 preferred splicing combinations Combinations, after sorting these 8 preferred splicing combinations based on the visible secant length energy (E inv ) from small to large, there are 3 preferred splicing combinations whose visible secant length energy (E inv ) energy values are all in the If there are three digits, then the 3 optimal splicing combinations will be sorted in ascending order of soft and hard edge length energy (E edge ), and the optimal splicing combinations corresponding to the 3rd to 5th positions will be determined; if there are still 2 preferred The visible secant length energy (E inv ) of the splicing combination
  • the two optimal splicing combinations are sorted in order from small to large in shape energy (E shape ) to determine the 4th position.
  • the 4th and 5th positions respectively correspond to the preferred splicing combination; until each verification sequence corresponds to a preferred splicing combination position.
  • the computer device can use the tangent length energy (E s ) directly sorts several preferred splicing combinations to determine the verification order of several preferred splicing combinations; where the target number can be 4, that is, based on the visible secant length energy (E inv ), soft and hard edge length energy ( After sorting the preferred splicing combinations using E edge ), shape energy (E shape ), and symmetry energy (E symm ), if the verification order of the preferred splicing combination still cannot be confirmed, it will be determined directly by the sorting result of the tangent length energy (E s ). Verification sequence of this preferred splicing combination.
  • the computer device can also use the threshold to classify the splicing combination based on the optimized energy of the target number with higher priority.
  • Determine the verification sequence grouping of each preferred splicing combination among them, the preferred splicing combinations in the groups smaller than the energy threshold are spliced first, and the preferred splicing combinations in the groups larger than the energy threshold are spliced later; after that, the optimal splicing combinations in each group obtained after the second classification are Optimize the splicing combination and sort by category. That is to say, based on the optimized energy value of each preferred splicing combination and the priority of n optimized energies, the verification sequence for obtaining each preferred splicing combination can be implemented as:
  • n-1 optimized Energy is the optimization energy other than the target optimization energy among the n types of optimization energy
  • the target optimization energy is the optimization energy with the lowest priority among the n types of optimization energy
  • the splicing combinations of the 2 (n-1) groups are sorted separately to obtain the verification order of each optimal splicing combination.
  • n-1 optimization energies include the top 4 optimization energies in priority order, that is, secant length energy (E inv ), soft and hard edge length energy (E edge ), and shape energy (E shape ) ;
  • the computer device first performs two classifications on the optimal splicing combination based on the visible secant length energy (E inv ) and its corresponding first energy threshold, and obtains the first category of visible secant length energy (E inv ) less than the first energy threshold.
  • the preferred splicing combinations and the preferred splicing combinations of the second category whose visible secant length energy (E inv ) is less than the first energy threshold are divided into two groups, in which the verification priority of the first category is higher than that of the second category.
  • the optimal splicing combination of six categories is divided into four groups.
  • the verification priorities corresponding to these four groups from high to low are: third category > fourth category > fifth category > sixth category; and then , based on the shape energy (E shape ) and its corresponding third energy threshold, the preferred splicing combinations corresponding to the third category, the fourth category, the fifth category and the sixth category are classified into two categories, and are divided into eight groups; finally , based on the symmetry energy (E symm ), the optimal splicing combinations corresponding to the eight categories obtained by the two classifications based on the shape energy (E shape ) are classified into two categories, divided into sixteen groups and three groups.
  • the target optimization energy can be any one other than the optimization energy used for classification.
  • the computer device can be based on the target optimization energy of each optimal splicing combination in each group. energy value, in each group, the preferred splicing combinations are sorted; schematically, in the first group, the computer device sorts the first group based on the energy value of the target optimization energy of each preferred splicing combination in the first group The optimal splicing combinations in are sorted to obtain the sorting results of each optimal splicing combination corresponding to the first group, which is any one of the 2 (n-1) groups.
  • the target optimization energy is the tangent length energy (E s ).
  • the computer device sorts the 2(n-1) groups based on the tangent length energy (E s ) and obtains the sorting results as the optimal ones in each group. Verification order for splicing combinations.
  • the computer device can integrate the 2(n-1) groups based on the priority of each group to obtain each preferred splicing combination in the splicing sequence.
  • the combined verification order wherein, among the groups divided by the same optimized energy, the verification priority of the group smaller than the energy threshold corresponding to the optimized energy is higher than the priority of the group larger than the energy threshold corresponding to the optimized energy.
  • group 1 and group 2 can be obtained after classifying 8 preferred splicing combinations based on visible secant length energy (E inv ), where the visible secant length energy (E inv ) of the preferred splicing combination in group 1 is The secant length energy is less than the first energy threshold; the visible secant length energy of the preferred splicing combination in group 2 is greater than the first energy threshold; assuming that group 1 contains the preferred splicing combinations 1, 3, 4, and 8, and group 2 contains the preferred Splicing combinations 2, 5, 6, and 7; based on the soft and hard edge length energy (E edge ), the optimal splicing combinations in group 1 and the optimal splicing combinations in group 2 are classified into two categories, respectively, to obtain group 1-1, group 1- 2 and
  • Group 2-1 contains the preferred splicing combinations 2 and 5
  • group 2-2 contains the preferred splicing combinations 6 and 7
  • E s tangent length energy
  • group 1-1, group 1-2 The optimal splicing combinations contained in group 2-1 and group 2-2 are sorted to obtain group 1-1: 1, 4, group 1-2: 8, 3, group 2-1: 5, 2, and group 2-2. : 6, 7;
  • the computer equipment integrates the verification order of the preferred splicing combinations in each group, and obtains the verification order of each preferred splicing combination in the splicing sequence as 1, 4, 8, 3, 5, 2, 6, 7.
  • each preferred splicing combination is pushed into the splicing combination sequence to construct the splicing combination sequence.
  • the splicing combination (including a basic splicing combination and a preferred splicing combination) includes an adjacency relationship table and a symmetry relationship table between basic splicing units, which are used to standardize the basic splicing units and relative position relationships of the splicing combination.
  • Step 340 Verify each splicing combination in the splicing combination sequence to obtain the splicing result of the basic splicing unit.
  • verify each splicing combination in the splicing combination sequence to obtain the splicing results of the basic splicing unit including:
  • the combined verification process includes the following steps.
  • the computer device when verifying the first splicing combination at the top of the sequence in the splicing combination sequence, can verify the first splicing combination through two different verification strategies; based on the above verification method, the first splicing combination can be verified.
  • the verification process of a splicing combination can be implemented as:
  • the initial verification is used to verify whether the first splicing combination can be successfully deployed; wherein successful deployment means that the splicing combination can be deployed, and the deformation after deployment is less than the deformation threshold and symmetry is maintained;
  • a second verification is performed on the first splicing combination; the second verification is used to verify whether the shape of the UV island formed after the first splicing combination is expanded conforms to the shape template.
  • the initial verification is used to review whether the current splicing combination proposal can be expanded, whether the deformation after expansion is too large, and whether the symmetry is destroyed; optionally, during the initial verification, the computer equipment can perform a non-flip on the current splicing combination.
  • ARAP As-Rigid-As-Possible expansion. If the expansion fails, the splicing fails. If the expansion is successful, the degree of distortion and symmetry of the expansion are verified. If the conditions are not met, the degree of distortion is verified. The test is a comparison between the unfolded deformation and the deformation threshold.
  • the verification of symmetry refers to verifying whether the unfolded UV island continues to maintain its original symmetry after unfolding.
  • the splicing combination is rejected; 2.
  • This verification is used to review whether UV island shapes are generated that are not conducive to subsequent steps.
  • the proportion and UV island shapes of subsequent steps can include shapes such as large rings, long strips, and missing self-symmetrical axes, etc.; the shape template is The UV island shape set by relevant personnel is in line with the subsequent steps.
  • updating the splicing combinations in the splicing combination sequence includes:
  • the first basic splicing unit is the basic splicing unit included in the first splicing combination. That is to say, among other splicing combinations including the pre-splicing results that make up the first splicing combination, the pre-splicing results that are the same as the pre-splicing results of the first splicing combination are replaced with the splicing results of the first splicing combination, thereby obtaining a new
  • the splicing combination is updated, and the adjacency relationship table and symmetry relationship table are updated; at the same time, the original splicing combination and the corresponding adjacency relationship table and symmetry relationship table are deleted.
  • the splicing result AB of the first splicing combination is generated; the original splicing combination sequence also includes the basic splicing unit A and the basic splicing unit B.
  • splicing combinations of splicing unit A and basic splicing unit B such as splicing combination A+C, and splicing combination B+F, etc.
  • other splicing combination sequences in the original splicing combination sequence Update the splicing combination, for example, update the splicing combination A+C to AB+C, update the splicing combination B+F to AB+F, update the corresponding adjacency relationship table and symmetry relationship table; update the original splicing combination A+C, and the splicing combination B+F and the corresponding adjacency relationship table and symmetry relationship Table delete.
  • the above method of constructing a splicing combination sequence and sequentially taking out the splicing combinations in the splicing combination sequence and conducting verification to obtain the splicing result of the basic splicing unit can be called a proposal-review mechanism.
  • the computer device can sequentially take out the splicing combinations from the splicing combination sequence according to the processing order indicated by the splicing combination sequence; verify the taken out splicing combinations , if the splicing combination passes the verification, then the splicing result corresponding to the splicing combination is constructed based on the splicing combination, and the splicing combination in the splicing combination sequence is updated based on the splicing result, and the splicing combination is deleted from the splicing combination sequence; if the splicing combination If the splicing combination fails to pass the verification, the splicing combination will be deleted from the s
  • FIG. 9 shows a schematic diagram of the process of splicing combination verification based on the proposal-review mechanism according to an exemplary embodiment of the present application. As shown in Figure 9, the process may include the following steps.
  • the basic splicing unit specifically refers to the pre-stitching result obtained after pre-stitching and re-expanding the fragmented UV islands of the three-dimensional model.
  • the process of constructing a splicing combination may refer to the process of establishing an adjacency relationship table and a symmetry relationship table between basic splicing units.
  • S905 Get the first splicing combination at the top of the splicing combination sequence and perform verification.
  • S906 Determine whether the initial verification is passed. If so, execute S907; otherwise, execute S908.
  • S907 Determine whether the secondary verification is passed. If so, execute S909; otherwise, execute S908.
  • S909 Generate a new splicing unit according to the splicing plan of the first splicing combination, and update the splicing combination sequence based on the new splicing unit.
  • updating the splicing combination sequence based on the new splicing unit means deleting the first splicing combination from the splicing combination sequence, obtaining other splicing combinations in the splicing combination sequence that include the basic splicing unit in the first splicing combination, and splicing the other splicing combinations.
  • the basic splicing unit in the combination sequence is updated to the new splicing unit corresponding to the first splicing combination, and other original splicing combinations and their corresponding relationship tables are deleted.
  • S910 Perform splicing and expansion according to the final splicing unit to generate an expansion of the three-dimensional model.
  • Step 350 Generate an expansion result of the three-dimensional model based on the splicing result of the basic splicing unit.
  • the splicing result of the basic splicing unit includes the two-dimensional splicing result of the UV island in the two-dimensional plane and the three-dimensional splicing result corresponding to the two-dimensional splicing result in the three-dimensional space.
  • the computer equipment re-expands the three-dimensional splicing result to obtain the The unfolded results of the 3D model.
  • non-deployable islands and degenerate islands during the expansion process of the three-dimensional model.
  • Computer equipment needs to perform special processing on these islands to ensure the expansion effect; among them, non-deployable islands include: islands with large expansion deformations. , expand overlapping islands and islands that cannot be solved by expansion methods; for islands that cannot be expanded, the original UV island shape of the corresponding three-dimensional grid can be retained; for degenerate islands, it can be degenerated into a point and placed in Specify the coordinate position.
  • the computer device introduces a rollback mechanism to process the splicing results based on the basic splicing unit to make up for the excessive splicing that has occurred in the previous steps, and to supplement and correct the splicing results; optionally, this application
  • a cutting strategy of irregular UV islands can be introduced as the fallback mechanism of the present application. This cutting strategy classifies various irregularities that may exist during the UV expansion process of the model, and its cutting strategy can be very flexible. Combined with the intention of art production, it can efficiently cut irregular UV island shapes.
  • the expansion method of the three-dimensional model obtains the basic splicing unit set of the three-dimensional model by cutting and unfolding the three-dimensional model; after obtaining the combination of each contact splicing unit based on the basic splicing unit set, the After each splicing combination, according to at least one optimization energy formulated according to the model design requirements, a splicing combination sequence is constructed based on each splicing combination; by verifying the splicing combinations in the splicing combination sequence, the splicing result of the basic splicing unit is obtained, based on The splicing result of the basic splicing unit generates the expansion result of the three-dimensional model.
  • Table 1 lists the comparative data of the number of UV islands of the tool expansion results obtained based on the three-dimensional model expansion method provided by this application on several typical art resources and the manual expansion results; Table 2 It is the result of testing on the art resource database.
  • the data shows the comparison between the final automatic 2UV results obtained based on the three-dimensional model expansion method provided by this application and the manual results. The dimensions of comparison are the four that artists are more concerned about when making 2UV.
  • Quantitative indicators Among them, the expansion method of the three-dimensional model mainly affects the last two indicators. Over 90% means that the sample exceeds 90% of the manual results on this indicator, and over 100% means that the sample completely exceeds the manual results on this indicator.
  • Figure 10 shows a schematic diagram comparing the automatic 2UV final result after baking with the manual 2UV baking result.
  • the baking result 1010 obtained by baking the 2UV expansion result obtained based on the expansion method of the three-dimensional model provided by the present application
  • the difference between the manual 2UV baking result 1020 and the virtual 2UV baking result 1030 is small, and the phenomenon of seam bleeding can be avoided to a certain extent, which shows that the expansion method of the three-dimensional model provided by the present application has a better expansion effect.
  • Figure 11 shows a block diagram of a three-dimensional model expansion device according to an exemplary embodiment of the present application.
  • the three-dimensional model expansion device may include the following modules.
  • the unit set acquisition module 1110 is used to perform step 210 in the above method embodiment
  • Sequence building module 1120 used to perform step 220 in the above method embodiment
  • the combined verification module 1130 is used to perform step 230 in the above method embodiment
  • the result generation module 1140 is used to perform step 240 in the above method embodiment.
  • sequence building module 1120 includes:
  • the exhaustive sub-module is used to exhaustively enumerate the basic splicing combinations constructed based on each basic splicing unit to obtain the basic splicing combination set; the pruning sub-module is used to prune the basic splicing combination set based on the pruning strategy to obtain each optimal splicing Combination; sequence construction sub-module, used to construct splicing combination sequences based on each preferred splicing combination.
  • sequence building sub-modules include:
  • the energy value acquisition unit is used to obtain the optimized energy value of each optimal splicing combination; the optimized energy value includes the energy value of at least one optimized energy; the sequence acquisition unit is used to obtain each optimal splicing based on the optimized energy value of each optimal splicing combination.
  • the verification sequence of the combination; the sequence construction unit is used to construct the splicing combination sequence based on the verification sequence of each preferred splicing combination.
  • At least one optimization energy includes n optimization energies, and the n optimization energies have respective priorities; n ⁇ 2, and n is an integer;
  • a sequence acquisition unit is used to obtain the verification order of each preferred splicing combination based on the optimized energy value of each preferred splicing combination and the priorities of n optimized energies.
  • n-1 optimized Energy is the optimization energy other than the target optimization energy among the n types of optimization energy
  • the target optimization energy is the optimization energy with the lowest priority among the n types of optimization energy
  • the splicing combinations of the 2 (n-1) groups are sorted respectively, and the verification order of each optimal splicing combination is obtained.
  • the pruning strategy includes: at least one of a splicing length-based strategy and a splicing suture-based strategy;
  • the strategy based on the splicing length includes: in response to the ratio of the length difference corresponding to the basic splicing combination to the length of the adjacent edge being less than the target threshold, rejecting the basic splicing combination; the length difference refers to the length of the adjacent edge of the two basic splicing units and the length of the two adjacent edges.
  • the splice-seam-based strategy includes rejecting the base splice combination in response to the number of segments of the suture in the base splice combination being greater than the number of adjacent edges in two base splice units in the base splice combination.
  • the combination verification module 1130 is configured to perform at least one combination verification process based on the splicing combination sequence until the splicing combination sequence is empty, and obtain the splicing result of the basic splicing unit;
  • the combined verification module 1130 includes:
  • the combination verification sub-module is used to verify the first splicing combination at the top of the sequence in the splicing combination sequence
  • the unit splicing submodule is configured to splice the basic splicing units included in the first splicing combination in response to the first splicing combination passing the verification, obtain the splicing result of the first splicing combination, and delete the first splicing combination in the splicing combination sequence;
  • the combination update submodule is used to update the splicing combinations in the splicing combination sequence based on the splicing result of the first splicing combination and other splicing combinations corresponding to the basic splicing units included in the first splicing combination; in response to the failure of the first splicing combination verification By deleting the first splicing combination from the splicing combination sequence.
  • the combined verification sub-module includes:
  • the first verification unit is used for initial verification of the first splicing combination; the initial verification is used to verify whether the first splicing combination can be successfully deployed; where successful deployment means that the splicing combination can be deployed, and the deformation after deployment is less than the deformation threshold and maintain symmetry;
  • the second verification unit is used to perform a second verification on the first splicing combination in response to the passing of the initial verification; the second verification unit is used for To verify whether the shape of the UV island formed after the first splicing combination is expanded conforms to the shape template.
  • the combination update submodule is used to replace the first basic splicing unit in other splicing combinations with the splicing result of the first splicing combination; the first basic splicing unit is the basis included in the first splicing combination. splicing unit.
  • the unit set acquisition module 1110 includes:
  • the UV island set acquisition submodule is used to cut and expand the three-dimensional model based on the cutting unit to obtain a UV island set.
  • the UV island set contains each fragmented UV island of the three-dimensional model;
  • the unit acquisition submodule is used to pre-splice and re-expand based on the UV island set to obtain the basic splicing unit set of the three-dimensional model.
  • the unit acquisition submodule is used to pre-splice and re-expand each fragmented UV island through at least one pre-splicing method to obtain a basic splicing unit set of the three-dimensional model;
  • At least one pre-splicing method includes at least one of plane pre-splicing, soft-edge pre-splicing and semantic segmentation pre-splicing; plane pre-splicing is used to indicate the method of splicing through neighborhood spreading and plane splicing; soft edge Pre-splicing is used to indicate the method of dividing the 3D model into regions through hard edges, and then splicing the 3D model through heuristic search methods in each area; semantic segmentation pre-splicing is used to indicate the use of the geometric semantic features of the 3D model to decompose the 3D model. , obtain the semantic segmentation area by splicing within each semantic segmentation area.
  • the unit acquisition submodule is used to respond to at least two of the pre-splicing methods including plane pre-splicing, soft-edge pre-splicing and semantic segmentation pre-splicing, according to the priority of each pre-splicing method, Pre-splicing and re-expanding the fragmented UV islands to obtain the basic splicing unit.
  • the pre-splicing methods including plane pre-splicing, soft-edge pre-splicing and semantic segmentation pre-splicing, according to the priority of each pre-splicing method, Pre-splicing and re-expanding the fragmented UV islands to obtain the basic splicing unit.
  • the three-dimensional model expansion device obtains the basic splicing unit set of the three-dimensional model by cutting and unfolding the three-dimensional model; after obtaining the combination of each contact splicing unit based on the basic splicing unit set, the After each splicing combination, according to at least one optimization energy formulated according to the model design requirements, a splicing combination sequence is constructed based on each splicing combination; by verifying the splicing combinations in the splicing combination sequence, the splicing result of the basic splicing unit is obtained, based on The splicing result of the basic splicing unit generates the expansion result of the three-dimensional model.
  • FIG. 12 shows a structural block diagram of a computer device 1200 according to an exemplary embodiment of the present application.
  • the computer device can be implemented as the server in the above solution of this application.
  • the computer device 1200 includes a processor (such as a central processing unit (CPU)) 1201, a random access memory (Random Access Memory, RAM) 1202, and a read-only memory (Read-Only Memory, ROM) 1203.
  • System memory 1204 and a system bus 1205 connecting the system memory 1204 and the central processing unit 1201.
  • the computer device 1200 also includes a mass storage device 1206 for storing an operating system 1209, applications 1210 and other program modules 1211.
  • the processor 1202 may include one or more processing cores, such as a 4-core processor, a 3-core processor, etc.
  • the processor 1201 can adopt at least one hardware form among DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), and PLA (Programmable Logic Array, programmable logic array). accomplish.
  • the processor 1201 may also include a main processor and a co-processor.
  • the main processor is a processor used to process data in the wake-up state, also called a CPU; the co-processor is used to process data in the standby state. Low-power processor for processing.
  • the processor 1201 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is responsible for rendering and drawing content that needs to be displayed on the display screen.
  • the processor 1201 may also include an AI (Artificial Intelligence, artificial intelligence) processor, which is used to process computing operations related to machine learning.
  • AI Artificial Intelligence, artificial intelligence
  • System memory 1204 may include one or more computer-readable storage media, which may be non-transitory.
  • System memory may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices or flash memory storage devices.
  • non-transitory computer-readable storage medium in system memory is used to store at least one instruction for execution by processor 1201 to implement the present application. Please refer to all or part of the steps in the three-dimensional model expansion method shown in the method embodiment.
  • the computer-readable media may include computer storage media and communication media.
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
  • Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM) flash memory or others Solid-state storage technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, tape cassettes, magnetic tapes, disk storage or other magnetic storage devices.
  • RAM random access memory
  • ROM Erasable Programmable Read Only Memory
  • EEPROM Electronically Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc Read-Only Memory
  • DVD Digital Versatile Disc
  • tape cassettes magnetic tapes
  • disk storage disk storage or other magnetic storage devices.
  • the above-mentioned system memory 1204 and mass storage device 1206
  • the computer device 1200 may also operate on a remote computer connected to a network through a network such as the Internet. That is, the computer device 1200 can be connected to the network through the network interface unit 1207 connected to the system bus 1205, or the network interface unit 1207 can also be used to connect to other types of networks or remote computer systems (not shown) .
  • the computer device 1200 optionally further includes a peripheral device interface and at least one peripheral device.
  • the processor, system memory, and peripheral device interfaces can be connected through buses or signal lines.
  • Each peripheral device can be connected to the peripheral device interface through a bus, a signal line or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit, a display screen, a camera component, an audio circuit and a power supply.
  • computing device 1200 also includes one or more sensors.
  • the one or more sensors include, but are not limited to: acceleration sensors, gyroscope sensors, pressure sensors, optical sensors, and proximity sensors.
  • the memory also stores at least one computer program.
  • the processor 1201 executes the at least one computer program to implement all or part of the steps in the three-dimensional model expansion method shown in the above embodiments.
  • a computer-readable storage medium stores at least one computer program.
  • the computer program is loaded and executed by the processor to implement the above three-dimensional model expansion method. all or part of the steps.
  • the computer-readable storage medium may be a read-only memory, a random access memory, a read-only optical disk, a magnetic tape, a floppy disk, an optical data storage device, etc.
  • a computer program product is also provided.
  • the computer program product includes at least one computer program.
  • the computer program is loaded by a processor and executes the three-dimensional model expansion method shown in any of the above embodiments. All or part of the steps.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本申请提供了一种三维模型的展开方法、装置、设备及存储介质,涉及虚拟场景技术领域。该方法包括:对三维模型进行展开,获得三维模型的基础拼接单元集(210);基于基础拼接单元集构建拼接组合序列;该拼接组合序列中包含基于模型展开要求对各个基础拼接单元进行组合得到的各个拼接组合;该模型展开要求包括基于模型设计需求制定的至少一种优化能量(220);对拼接组合序列中的各个拼接组合进行验证,获得基础拼接单元的拼接结果(230);基于基础拼接单元的拼接结果,生成三维模型的展开结果(240)。上述方法使得三维模型的展开结果更加符合实际需求,提高了三维模型的展开效果。

Description

三维模型的展开方法、装置、设备及存储介质
本申请要求于2022年04月13日提交的申请号为202210382385.7、发明名称为“三维模型的展开方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及虚拟场景技术领域,特别涉及一种三维模型的展开方法、装置、设备及存储介质。
背景技术
UV展开是美术资源生产中的一个重要环节。在对三维模型进行渲染时,需要将三维模型表面的三维网格切割,将切割后的三维网格平铺到二维平面上(二维平面又称为UV平面),即对三维模型进行UV展开。在二维平面上对展开的三维网格进行贴图着色,进而基于二维平面中的贴图着色结果对三维模型进行渲染。
在相关技术中,由于在二维平面上对三维网格进行贴图着色后,需要基于三维网格在二维平面和三维空间的位置映射关系,将贴图着色结果从二维平面映射回三维模型上,实现对三维模型的贴图着色;为了保证二维平面中的贴图结果在映射回三维模型后不扭曲,在对三维模型进行UV展开时,需要在三维模型的三维网格上,寻找尽量短的切割线来将三维网格切开,尽量平整地将三维网格平铺到二维平面上。
然而,上述对三维模型进行UV展开的方法,仅将UV展开问题约束在割线长短以及扭曲程度两个条件上,从而使得UV展开的依据较为局限,使得UV展开的效果较差。
发明内容
本申请实施例提供了一种三维模型的展开方法、装置、设备及存储介质。该技术方案包括如下方面。
一方面,提供了一种三维模型的展开方法,所述方法由计算机设备执行,所述方法包括:
对三维模型进行展开,获得所述三维模型的基础拼接单元集;所述基础拼接单元集中包含基于所述三维模型的UV岛获得的各个基础拼接单元;
基于所述基础拼接单元集构建拼接组合序列;所述拼接组合序列中包含基于模型展开要求对各个所述基础拼接单元进行组合得到的各个拼接组合;所述模型展开要求包括基于模型设计需求制定的至少一种优化能量;所述优化能量用于指示所述拼接组合的几何属性;
对所述拼接组合序列中的各个所述拼接组合进行验证,获得所述基础拼接单元的拼接结果;
基于所述基础拼接单元的拼接结果,生成所述三维模型的展开结果。
另一方面,提供了一种三维模型的展开装置,所述装置包括:
单元集获取模块,用于对三维模型进行展开,获得所述三维模型的基础拼接单元集;所述基础拼接单元集中包含基于所述三维模型的UV岛获得的各个基础拼接单元;
序列构建模块,用于基于所述基础拼接单元集构建拼接组合序列;所述拼接组合序列中包含基于模型展开要求对各个所述基础拼接单元进行组合得到的各个拼接组合;所述模型展开要求包括基于模型设计需求制定的至少一种优化能量;所述优化能量用于指示所述拼接组合的几何属性;
组合验证模块,用于对所述拼接组合序列中的各个所述拼接组合进行验证,获得所述基础拼接单元的拼接结果;
结果生成模块,用于基于所述基础拼接单元的拼接结果,生成所述三维模型的展开结果。
另一方面,提供了一种计算机设备,所述计算机设备包含处理器和存储器,所述存储器存储有至少一条计算机程序,所述至少一条计算机程序由所述处理器加载并执行以实现上述的三维模型的展开方法。
另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条计算机程序,所述计算机程序由处理器加载并执行以实现上述的者三维模型的展开方法。
另一方面,提供了一种计算机程序产品,所述计算机程序产品包括至少一条计算机程序,所述计算机程序由处理器加载并执行以实现上述各种可选实现方式中提供的三维模型的展开方法。
通过对三维模型进行展开,获得三维模型的基础拼接单元集;对基础拼接单元集中的基础拼接单元进行组合得到多个拼接组合,依据模型设计需求制定的至少一种优化能量,基于各个拼接组合构建拼接组合序列;通过对拼接组合序列中的拼接组合进行验证,获得基础拼接单元的拼接结果,进而基于基础拼接单元的拼接结果生成三维模型的展开结果。在上述对三维模型的展开过程中,可以实现三维模型展开过程的自动化,同时充分考虑到模型设计中的实际需求,使得获得的三维模型的展开结果更加符合实际需求,提高了三维模型的展开效果。
附图说明
图1示出了本申请一示例性实施例提供的模型展开系统的架构示意图;
图2示出了本申请一示例性实施例提供的一种三维模型的展开方法的流程图;
图3示出了本申请一示例性实施例提供的另一种三维模型的展开方法的流程图;
图4示出了本申请一示例性实施例示出的获取第二多边形集合的过程示意图;
图5示出了本申请一示例性实施例示出的获取第四多边形集合的过程示意图;
图6示出了本申请一示例性实施例示出的平面预拼接的示意图;
图7示出了本申请一示例性实施例示出的三维模型的预拼接过程的示意图;
图8示出了本申请一示例性实施例示出的渗色现象的示意图;
图9示出了本申请一示例性实施例示出的基于提案-审理机制进行拼接组合验证的过程示意图;
图10示出了自动2UV最终结果通过烘焙后与人工制作的2UV烘焙结果的对比示意图;
图11示出了本申请一示例性实施例示出的三维模型的展开装置的方框图;
图12示出了本申请一示例性实施例示出的计算机设备的结构框图。
具体实施方式
为了便于后面描述,首先对本申请实施例中涉及到的名词进行简单介绍。
三维网格(3D Mesh):是一种以多边形进行组合来离散表征三维模型的形式,主要数据包含顶点、边与面。三维网格包括:三维空间中用于表征三维模型表面无数个面片。示例性的,三维网格的最小组成是三角形面片,三维模型的表面可以划分为无数个三角形面片,无数个三角形面片组成了该三维模型的三维网格。示例性的,三维模型上具有多个点,多个点之间的互相连接组成了三维网格。
UV展开(UV Unwrapping):指将三维模型的三维网格切开,并展平到二维平面的过程,该二维平面空间也被称为UV空间或纹理空间,其中,U为该二维平面的横轴(或纵轴),V为该二维平面的纵轴(或横轴)。其中u,v取值在0~1之间的空间为单位UV空间,因此将三维模型展平到UV空间的过程也被称为UV展开。
网格参数化(Mesh Parameterization):三维模型UV展开后,需要通过网格参数化算法来求三维模型上的各个点从三维空间到二维平面映射关系。
UV岛(UV Island):三维网格被切开后会分为很多网格块(相当于将三维模型切割为很多个模型快),每个网格块各自展平到UV空间,形成UV空间中一个个独立的二维网格 模型(二维多边形),犹如飘在UV空间的岛屿,因此该二维网格被称为UV岛。示例性的,UV岛是将三维模型的三维网格切割展平到UV空间后得到的独立的二维多边形,其中,独立是指一个UV岛与其他UV岛在UV空间内不连接。示例性的,将三维模型的三维网格切割为一个个独立的网格快,将一个网格块展平到UV空间中得到一个UV岛。
UV纹理(UV Texture):美工会在UV空间中进行图片绘制,绘制好的图片被称为纹理,根据UV展开的逆过程,可以将绘制好的纹理映射回三维网格表面,从而达到表征三维模型颜色、材质、光影等效果的目的。
1UV、2UV:游戏美术资源中大多使用两套UV,一般称为1UV和2UV,其中1UV用于绘制色彩纹理、法线纹理等,而2UV用于绘制光照纹理、阴影纹理等。
NPC问题(Non-deterministic Polynomial Complete Problem):即完全多项式复杂度的非确定性问题。P类问题指可以在多项式时间内求解的问题,而NP问题指不确定多项式时间内能否求解但是可以确定解的正确性的问题。NPC问题是一种NP问题,所有的NP问题都可以在多项式时间内归约成这个问题。
软硬边(Soft and Hard Edge):美工在制作三维模型时利用制作工具对三维模型的三维网格边的一种定义分类。在渲染时,硬边两侧的光影变化剧烈,形成明显的明暗对比;而软边两侧则光影过度平缓,明暗模糊。
光线投射法(Ray Casting):指从某点出发,在设定方向上构建视锥,然后在视锥内进行离散采样的光线投射,通过统计所有投射光线的碰撞结果来确定该点在设定方向的可视性。该方法常用于碰撞检测与图形渲染。
法曲率(Normal Curvature):刻画曲面在某一方向的弯曲程度的量。
主曲率(Principal Curvature):过曲面上某个点上具有无穷多个正交曲率,其中存在一条曲线使得该曲线的曲率为极大,这个曲率为极大值k_max,垂直于极大曲率面的曲率为极小值k_min。这两个曲率被称为主曲率,他们代表着法曲率的极值。
高斯曲率(Gaussian Curvature):曲面上一点的高斯曲率是该点主曲率k_max和k_min的乘积,是曲率的内在度量。
可展曲面(Developable Surface):如果一个光滑曲面的高斯曲率在曲面边界内处处为0,则该曲面为可展曲面。该定义同样适用于离散网格。
UV装箱(UV Packing/UV Nesting):指将UV岛按固定间隔,排列到单位UV空间的过程,一般要求尽量填满空间。
图1示出了本申请一示例性实施例提供的计算机设备的示意图,该计算机设备可以用于执行本申请提供的三维模型的展开方法。如图1所示,该计算机设备可以是:服务器110或终端120。
上述服务器110可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。
上述终端120可以是具有显示功能的智能手机、平板电脑、笔记本电脑、台式计算机、智能电视、车载终端等,但并不局限于此。该终端120可以用以显示三维模型以及三维模型在各个阶段的展开结果。
其中,服务器110的数量可以是一个或者多个,以及终端120的数量可以是一个或者多个。本申请实施例对于服务器110和终端120的个数不做限制。
当计算机设备是服务器110时,服务器110可以执行本申请提供的三维模型的展开方法生成三维模型的展开结果。服务器110可以基于三维模型的展开结果对三维模型进行贴图着色,得到渲染结果,并将渲染结果发送给终端120进行显示。
当计算机设备是终端120时,终端120可以执行本申请提供的三维模型的展开方法生成 三维模型的展开结果。终端120可以基于三维模型的展开结果对三维模型进行贴图着色并显示。
终端以及服务器通过通信网络相连。可选的,通信网络是有线网络或无线网络。
可选的,上述的无线网络或有线网络使用标准通信技术和/或协议。网络通常为因特网、但也可以是任何网络,包括但不限于局域网(Local Area Network,LAN)、城域网(Metropolitan Area Network,MAN)、广域网(Wide Area Network,WAN)、移动、有线或者无线网络、专用网络或者虚拟专用网络的任何组合。在一些实施例中,使用包括超文本标记语言(Hyper Text Mark-up Language,HTML)、可扩展标记语言(Extensible Markup Language,XML)等的技术和/或格式来代表通过网络交换的数据。此外还可以使用诸如安全套接字层(Secure Socket Layer,SSL)、传输层安全(Transport Layer Security,TLS)、虚拟专用网络(Virtual Private Network,VPN)、网际协议安全(Internet Protocol Security,IPsec)等常规加密技术来加密所有或者一些链路。在另一些实施例中,还可以使用定制和/或专用数据通信技术取代或者补充上述数据通信技术。本申请在此不做限制。
图2示出了本申请一示例性实施例提供的一种三维模型的展开方法的流程图,该方法可以由计算机设备执行,该计算机设备可以实现为服务器或终端,该计算机设备可以是如图1所示的服务器或终端,如图2所示,该三维模型的展开方法可以包括以下步骤。
步骤210,对三维模型进行展开,获得三维模型的基础拼接单元集;该基础拼接单元集中包含基于三维模型的UV岛获得的各个基础拼接单元。
该基础拼接单元是基于三维模型的UV岛获得的拼接结果。
其中,三维模型是基于三维网格构建的模型;三维网格(3D Mesh)是一种以多边形进行组合来离散表征三维模型的模型表征形式,三维网格的主要数据包含顶点、边与面。
本申请实施例中涉及的三维模型展开也可以称为三维模型的UV展开(UV Unwrapping),是指将组成三维模型的三维网格切开,并展平到二维平面的过程;该二维平面空间也可以称为UV空间,其中,U是二维平面的横轴(或纵轴),V为二维平面的纵轴(或横轴);U,V取值在0~1之间的空间为单位UV空间。
在本申请实施例中,三维模型的基础拼接单元可以是计算机设备对三维模型进行切割、展开以及拼接之后获得的UV岛的拼接结果。
示例性的,计算机设备对三维模型的三维网格进行UV展开,得到三维模型的至少两个UV岛,至少两个UV岛构成UV岛集;对UV岛集中具有邻接关系的部分UV岛进行拼接,得到至少一个基础拼接单元。
示例性的,计算机设备对三维模型的三维网格进行切割和展开,得到三维模型的至少两个UV岛,对相邻UV岛进行拼接得到基础拼接单元。
示例性的,基础拼接单元是将UV岛简单拼接得到的,根据基础的拼接原则(例如根据两个UV岛的曲率、法线等判断两个相邻UV岛较为平缓,可以拼接为一个可展曲面),初步将可以拼接的UV岛拼接到一起得到基础拼接单元。
步骤220,基于基础拼接单元集构建拼接组合序列;该拼接组合序列中包含基于模型展开要求对各个基础拼接单元进行组合得到的各个拼接组合;该模型展开要求包括基于模型设计需求制定的至少一种优化能量;该优化能量用于指示拼接组合的几何属性。
可选的,该优化能量用以表征拼接组合的几何属性与几何属性需求之间的关系;几何属性越符合该几何属性对应的几何属性需求,该优化能量的能量值越小;几何属性越不符合几何属性需求,该优化能量的能量值越大;示意性的,该拼接组合的几何属性可以包括,可见割线的长度、软边割线长度、狭长硬边缝线长度、形状、对称性、扭曲程度、拼接前切线总长度与拼接缝线长度的长度差中的至少一种;需要说明的是,基于实际需求,计算机设备可以设置拼接组合的其他几何属性以及对应于其他几何属性的优化能量,以在模型展开要求中包含其他几何属性的优化能量时,计算机设备可以基于其他几何属性的优化能量获取拼接组 合序列中包含的各个拼接组合,本申请对此不进行限制。
其中,该模型展开要求可以是相关人员基于模型设计需求制定的,不同的模型设计需求可以对应有不同的模型展开要求,即不同的模型设计需求制定的至少一种优化能量不同。
构建拼接组合序列时,计算机设备可以先获取基于基础拼接单元集中的基础拼接单元构建多个拼接组合;再基于多个拼接组合构建拼接组合序列。
步骤230,对拼接组合序列中的各个拼接组合进行验证,获得基础拼接单元的拼接结果。
该基础拼接单元的拼接结果可以是:对通过验证的拼接组合中的基础拼接单元进行拼接之后获得的拼接结果;例如,通过验证的拼接组合为基础拼接单元A+基础拼接单元B,该拼接组合对应的基础拼接单元的拼接结果即为AB。
其中,计算机设备可以按照各个拼接组合在上述拼接组合序列中的顺序,对各个拼接组合依次进行验证。
在本申请实施例中,上述构建拼接组合序列,对拼接组合序列中的拼接组合进行验证的过程可以被称为提案-审理机制;其中,该拼接组合序列中的每个拼接组合对应为一个提案,对拼接组合序列中的各个拼接组合的验证过程,即为对拼接组合序列中的各个拼接组合的审理过程。
步骤240,基于基础拼接单元的拼接结果,生成三维模型的展开结果。
在本申请实施例中,涉及二维平面(又可以称为“UV空间”)与三维空间,且二维平面与三维空间之间具有映射关系;当对二维平面内的UV岛进行拼接时,基于二维平面与三维空间之间的映射关系,计算机设备可以同步实现对UV岛对应的三维网格的拼接,之后,再将拼接后的三维网格进行展开,即可获取到三维网格的二维拼接结果。
因此,在获取到基础拼接单元的拼接结果后,可以同步获取到基础拼接单元对应在三维空间中的网格拼接结果,将三维空间中对应于基础拼接单元的网格拼接结果展开后,即可生成三维模型的展开结果。
示例性的,在获得三维模型的展开结果后,可以在UV控件中对展开结果进行贴图着色。
综上所述,本申请实施例提供的三维模型的展开方法,通过对三维模型进行展开,获得三维模型的基础拼接单元集;对基础拼接单元集中的基础拼接单元进行组合得到多个拼接组合,依据模型设计需求制定的至少一种优化能量,基于各个拼接组合构建拼接组合序列;通过对拼接组合序列中的拼接组合进行验证,获得基础拼接单元的拼接结果,进而基于基础拼接单元的拼接结果生成三维模型的展开结果。在上述对三维模型的展开过程中,可以实现三维模型展开过程的自动化,同时充分考虑到模型设计中的实际需求,使得获得的三维模型的展开结果更加符合实际需求,提高了三维模型的展开效果。
本申请实施例提供的三维模型的展开方法,可以应用于需要进行三维模型展开的场景中;示意性的,该三维模型的展开方法可以应用但不限于对游戏模型进行UV展开的场景,对车辆模型进行UV展开的场景,对建筑模型进行UV展开的场景,以及其他模型设计场景中;进一步的,该三维模型的展开方法可以适应于三维模型的UV展开中存在的各种不规则UV岛的情况。
以该三维模型的展开方法应用于游戏模型进行UV展开的场景中为例;在游戏场景中,相关人员会在UV空间中,基于游戏模型的UV展开结果进行图片绘制,绘制好的图片被称为UV纹理(UV Texture),根据UV展开的逆过程,计算机设备可以将绘制好的UV纹理映射回三维网格表面,即映射回三维模型上,从而表征三维模型的颜色、材质、光影等效果。其中,在游戏场景中进行UV展开时,通常会涉及两套UV,称为1UV和2UV,1UV用于进行色彩纹理、法线纹理等的绘制,2UV用于进行光照纹理、阴影纹理等的绘制。
在进行图片绘制之前,需要先对游戏模型进行展开,获得游戏模型在二维平面中的展开 结果;在该过程中,可以利用本申请实施例提供的三维模型的展开方法对游戏模型进行切割以及展开,获得三维模型的基础拼接单元集;基于基础拼接单元集,构建符合模型展开要求的拼接组合序列;该模型展开要求用以指示基于游戏模型的设计需求制定的至少一种优化能量;对拼接组合序列中的各个拼接组合进行验证,获得基础拼接单元的拼接结果;最后基于基础拼接单元的展开结果,生成游戏模型的展开结果,从而实现了对游戏模型展开过程的自动化,提高了对游戏模型的展开效果。
示意性的,当本申请提供的方法由服务器执行时,该服务器可以实现为云平台中用以进行三维模型展开的云服务器;该云服务器可以提供有外接接口,用以接收终端发送的待进行三维模型展开的三维模型,并将三维模型的展开结果返回给终端;比如,当云服务器接收到终端发送的游戏模型后,可以通过本申请提供的三维模型的展开方法对该游戏模型进行展开,获得该游戏模型的展开结果,并将该游戏模型的展开结果返回给该终端,以使得该终端基于通过相应的应用程序界面对该游戏模型的展开结果进行显示,并进行进一步处理。
对三维模型进行展开的过程是一个NPC问题(Non-deterministic Polynomial Complete Problem),即完全多项式复杂度的非确定性问题;其中,P类问题指可以在多项式时间内求解的问题,而NP问题指不确定多项式时间内能否求解但是可以确定解的正确性的问题。NPC问题是一种NP问题,所有的NP问题都可以在多项式时间内归约成这个问题。本申请实施例提供的三维模型的展开方法,可以利用分治思想来求解三维模型展开这个NPC问题,以尽量降低三维模型展开过程的复杂程度,其中,基于分治思想确定的三维模型的展开方法可以分为三个环节:拆解UV岛、UV岛预拼接以及提案-审理机制下的UV岛拼接;其中,拆解UV岛时,可以基于展开特性与生产制作原则定义切割单元,将三维模型拆解为零碎的、方便UV展开的UV岛;UV岛预拼接时,可以基于模型设计需求对零碎的UV岛进行预拼接以及重新UV展开;最后,以UV岛预拼接的结果为基础,通过提案-审理机制进行整体的UV岛拼接和展开,获得三维模型的展开结果。
图3示出了本申请一示例性实施例提供的另一种三维模型的展开方法的流程图,该方法可以由计算机设备执行,该计算机设备可以实现为服务器或终端,该计算机设备可以是如图1所示的服务器或终端,如图3所示,该三维模型的展开方法可以包括以下步骤。
步骤310,基于切割单元,对三维模型进行切割以及展开,获得UV岛集,该UV岛集中包含三维模型的各个碎片化的UV岛。
在对三维模型进行初步展开时,即获取三维模型的各个碎片化的UV岛时,计算机设备可以基于切割单元对三维模型进行拆解,获得零碎的,易于进行UV展开的碎片化UV岛。其中,UV岛(UV Island)是指UV空间中的二维网格模型;在将三维网格切开后,会获得数量较多的三维块,将这些三维块分别展开到UV空间,获得各个三维块在UV空间中彼此独立的二维网格模型,这些二维网格模型即为UV岛。在本申请实施例中,在不同的条件下,可以基于不同的方式获取三维模型的碎片化的UV岛;不同情况下,获取碎片化的UV岛时所依据的切割单元不同。
可选的,计算机设备在获得三维模型的碎片化UV岛时,可以基于是否存在三维模型的1UV展开结果,对三维模型进行不同的切割;该1UV展开结果可以是基于1UV的展开要求对三维模型进行展开之后获得的展开结果。
由于1UV展开时会存在纹理复用,因此,1UV展开结果中通常会存在交叠部分,即二维多边形之间存在部分重合;基于此,在基于1UV展开结果对三维模型进行切割时,需要先去除1UV展开结果中的交叠部分,以保证基于1UV展开结果获得的三维模型的展开结果不存在交叠部分。
(一)基于1UV展开结果获取UV岛集。
示意性的,响应于存在三维模型的1UV展开结果,计算机设备获取UV岛集的过程可 以实现为以下步骤。
S3101,读取三维模型的1UV展开结果,获取第一多边形集合;该1UV展开结果是对三维模型进行1UV切割展开获得的展开结果;该第一多边形集合中包含1UV展开结果对应的二维多边形。
S3102,对第一多边形集合中的二维多边形进行交叠检测,获取第二多边形集合;该第二多边形集合包括无连通、无交叠的二维多边形。
可选的,对第一多边形集合中的二维多边形进行交叠检测,获取第二多边形集合的过程可以实现为:
基于第一多边形集合执行至少一次交叠检测过程,直至第一多边形集合为空,获得第二多边形集合;第二多边形集合中包含至少一个第一集合;
其中,该交叠检测过程,包括:
将第一多边形加入检测序列;该第一多边形是第一多边形集合中的二维多边形中的任意一个;
基于检测序列执行至少一次交叠检测子过程,直至检测序列为空,获得第一集合;
将第一多边形集合中与第一集合中包含的二维多边形相同的二维多边形删除;
该交叠检测子过程,包括:
将处于检测序列中,处于序列首位的第二多边形加入第一集合,并将检测序列中的第二多边形删除;
获取第二多边形的第一邻域多边形;该第一邻域多边形是与第二多边形具有邻接关系的二维多边形;或,该第一领域多边形是与第二多边形在三维模型上具有邻接关系的而为多边形,邻域多边形也可以称为邻接多边形;
将第一邻域多边形中与第一集合中包含的二维多边形不存在交叠的二维多边形,加入检测序列。
可以理解为,对于通过1UV展开获取的第一多边形集合,对其中的每一个二维多边形,将其与其邻域多边形进行交叠检测,得到一个第一集合;对于多个第一多边形集合中的多个二维多边形得到多个第一集合,多个第一集合构成第二多边形集合(无交叠的二维多边形的集合)。
或者说,对于通过1UV展开获取的第一多边形集合中,根据是否邻接可以将第一多边形集合划分为多个多边形组,每个多边形组内进行交叠检测得到一个第一集合,多个多边形组分别得到多个第一集合,构成第二多边形集合。
例如,任取第一多边形集合中的一个第一二维多边形,将其加入第一集合,然后获取第一第一二维多边形的邻域多边形,判断每个邻域多边形是否与第一二维多边形有交叠,对于没有交叠的邻域多边形,将其接入第一集合,并获取该邻域多边形的邻域多边形,进一步判断是否交叠,若没有交叠则放入第一集合,如此重复执行检测过程,直至获取不到邻域多边形。因此,可以理解为,从第一多边形集合中任取一个二维多边形,以该二维多边形为起点,不断判断邻接的二维多边形是否有交叠,将没有交叠的放入第一集合,直至无法再获取到邻接的二维多边形,得到一个第一集合。
示例性的,将第一多边形集合中的第一多边形加入检测序列;该第一多边形是第一多边形集合中的二维多边形中的任意一个;
将处于检测序列中,处于序列首位的第一多边形加入第一集合,并将检测序列中的第一多边形删除;
获取第一多边形的邻域多边形;
将邻域多边形中与第一多边形不存在交叠的二维多边形,加入检测序列;
将处于检测序列中,处于序列首位的第二多边形(邻域多边形中的一个)加入第一集合,并将检测序列中的第二多边形删除;
获取第二多边形的邻域多边形;
将邻域多边形中与第一集合中的二维多边形(第一多边形和不交叠的邻域多边形)不存在交叠的二维多边形,加入检测序列;
如此重复执行获取邻域多边形,判断是否交叠的步骤,直至检测序列为空(再也获取不到无交叠的邻域多边形),则获得一个第一集合;
删除第一多边形集合中,与第一集合中的二维多边形相同的二维多边形;
继续从删除后的第一多边形集合中获取一个第一多边形,继续重复执行上面的步骤,继续得到一个第一集合,直至第一多边形集合为空,最终得到多个第一集合,多个第一集合构成第二多边形集合。
示意性的,图4示出了本申请一示例性实施例示出的获取第二多边形集合的过程示意图,如图4所示,第一多边形集合中包括1UV展开结果对应的二维多边形,该第一多边形集合可以表示为P1={p0,p1,...,pv},其中,v为正整数,表示第一多边形集合中包含的二维多边形的数量;第二多边形集合包括至少一个第一集合中的二维多边形,该第二多边形集合可以表示为P2={p0,p1,...,pl}。其中,l为正整数,表示第二多边形集合中包含的二维多边形的数量;在对第一多边形集合中的二维多边形进行交叠检测时,计算机设备可以从第一多边形集合随机获取一个多边形pi,即第一多边形pi,将第一多边形pi推入检测序列Q中;将检测序列Q中,处于序列首位的第二多边形q取出,加入到第一集合中,并获取第二多边形的第一邻域多边形;将第一邻域多边形中,与第一集合中包含的二维多边形不存在交叠的二维多边形加入到检测序列Q中,对第一邻域多边形中,与第一集合中包含的二维多边形存在交叠的二维多边形不做处理。其中,当第一邻域多边形中,与第一集合中包含的二维多边形存在交叠的多边形的数量为多个时,计算机设备可以按照邻域多边形的获取顺序或者验证顺序加入检测序列Q中,或者,也可以按照随机顺序加入检测序列Q中,本申请对此不进行限制。此后,按照检测序列Q指示的二维多边形的顺序,依次对处于检测序列Q首位的第二多边形进行上述处理,直至检测序列Q为空。
当第一多边形pi对应的检测序列Q为空时,表示基于第一多边形pi进行的交叠检测子过程结束,获得该第一多边形对应的第一集合;若此时第一多边形集合不为空,则从当前第一多边形集合中,随机获取另一个第一多边形,重复上述交叠检测过程,直至第一多边形集合为空;从而获取到包含至少一个第一多边形各自对应的第一集合中的二维多边形的第二多边形集合。
其中,第一集合是基于第一多边形集合中任选的第一多边形发起的交叠检测子过程获得的多边形的集合;每个第一多边形都会有与之对应的第一集合;因此若上述交叠检测过程进行了w轮,w为正整数,且w﹤v则会产生w个第一多边形分别对应的第一集合,此时,第二多边形集合P2中包含w个第一集合中的二维多边形。
当第一多边形是从第一多边形集合中获取的首个多边形时,在将该第一多边形加入到检测序列后,从检测序列中获取的首个第二多边形也为该第一多边形。
在本申请实施例中,为了避免上述检测过程中的重复检测和冗余检测,在检测过程中,计算机设备会将第一多边形集合中与第一集合中包含的二维多边形相同的二维多边形删除;进一步的,计算机设备可以对已进行过两两交叠检测的多边形进行标注,以避免对已检测过的多边形的重复检测,造成计算资源的浪费;示意性的,当第二多边形为多边形1时,其邻域多边形中包含多边形2,在多边形1对应的交叠检测子过程中,确定多边形2多边形1不存在交叠,则可以将多边形2加入到检测序列中,并对多边形1与多边形2进行标注,表示多边形1与多边形2已进行过交叠检测;当进入多边形2的交叠检测过程时,获取到多边形2的邻域多边形中包含多边形1,但由于多边形2已与多边形1进行过交叠检测,因此,可以跳过对多边形1的交叠检测过程,以及跳过将多边形1加入检测序列的过程。
S3103,基于第一切割单元,对三维模型进行切割以及展开,获得三维模型的碎片化的 UV岛,该第一切割单元是基于第二多边形集合确定的切割单元。
该第一切割单元可以是基于第二多边形集合中包含的二维多边形确定的切割单元。
在基于单位模型的1UV展开结果得到无联通、无交叠的第二多边形集合后,沿第二多边形集合中的二维多边形的边缘,对三维模型进行切割、展开,得到碎片化的UV岛,该碎片化的UV岛构成步骤310中的UV岛集。示例性的,一个二维多边形切割展开得到一个UV岛。即,基于1UV展开结果,对展开结果中的二维多边形去交叠;根据去交叠后的二维多边形,对三维模型进行切割和展开,得到UV岛集。
(二)不基于1UV展开结果获取UV岛集。
在另一种可能的实现方式中,计算机设备可以不以1UV展开结果为基础实现对三维模型的切割与展开,也就是说,无论是否存在1UV展开结果,计算机设备均可采用以下方式获取三维模型的碎片化UV岛,该过程可以实现为以下步骤。
S3104,获取三维模型的第三多边形集合;该第三多边形集合包含基于三维模型的三维网格切割并展开获得的二维多边形。
也就是说,计算机设备可以以三维网格的最小划分单元为切割单位对三维模型的三维网格进行切割,获得第三模型的第三多边形集合。
示例性的,三维模型是由数个三角形面片组成的,该三角形面片即为三维模型的三维网格最小划分单元。则计算机设备可以沿三维模型的三角形面片边缘,将每个三角形面片切割下来,得到第三多边形集合。例如,三维模型由100个三角形面片组成,则将三维模型沿最小划分单元切割,得到100个二维多边形(三角形面片),100个二维多边形构成第三多边形集合。
S3105,计算第三多边形集合中的二维多边形对应的三维网格的法向量,获得第三多边形集合对应的法向量集合。
在本申请实施例中,由于二维平面与三维空间之间存在映射关系,第三多边形集合中的二维多边形在三维空间中均有与之对应的三维网格,计算机设备可以获取各个三维网格的法向量,该法向量用以表征该三维网格的朝向。
示例性的,由于第三多边形集合是以最小划分单元(三角形面片)进行切割得到的,则第三多边形集合中的二维多边形(三角形面片)在三维空间中都是一个平面,计算机设备获取第三多边形集合中每个二维多边形对应的法向量。
S3106,基于第三多边形集合以及法向量集合,获取第四多边形集合;该第四多边形集合中包含第三多边形集合中,最大可展开的二维多边形;其中,最大可展开的二维多边形是指法向量指示的二维多边形的朝向差异小于差异阈值的二维多边形。
可选的,基于第三多边形集合以及法向量集合,获取第四多边形集合的过程可以实现为:
基于第三多边形集合以及法向量集合执行至少一次向量验证过程,直至第三多边形集合为空,获得第四多边形集合;该第四多边形集合中包含至少一个第二集合;
其中,该向量验证过程,包括:
将第三多边形加入验证序列;该第三多边形是第三多边形集合中的二维多边形中的任意一个;
基于验证序列执行至少一次向量验证子过程,直至验证序列为空,获得第二集合,该第二集合中包含至少一个第二子集合中的二维多边形;
将第三多边形集合中与第二集合中包含的二维多边形相同的二维多边形删除;
该向量验证子过程,包括:
获取处于验证序列中,处于序列首位的第四多边形的法向量,以及第三多边形的法向量;
响应于第四多边形的法向量与第三多边形的法向量指示的两者之间的朝向差异小于差异 阈值,将第四多边形加入第二集合,并将验证序列中的第四多边形删除;
获取第四多边形的第二邻域多边形;该第二邻域多边形是邻域三维网格对应的二维多边形;该邻域三维网格是与第四多边形对应的三维网格具有邻接关系的三维网格;
将第二邻域多边形加入验证序列。
示例性的,获取第三多边形集合中的一个多边形(第三多边形),将第三多边形加入第二集合。获取第三多边形的邻域多边形(与第三多边形在三维模型上具有邻接关系),判断邻域多边形与第三多边形的法向量差异,若差异小于差异阈值(或者两个法向量的夹角小于阈值),则将该邻域多边形加入第二集合,并继续获取该邻域多边形的邻域多边形,继续判断法向量差异是否小于阈值,以此重复执行判断过程,直至无法获取到邻域多边形,最终得到一个第二集合。
即,以第三多边形集合中的一个多边形为起点,不断判断该多边形与其领域多边形所在平面是否平缓(两个平面的倾斜角度差异小),平缓的一组多边形(这组多边形都邻接)即为一个第二集合。
示例性的,通过上述方式,将三维模型上相邻且平缓的三角形片面(二维多边形)划分到一个第二集合中,进而得到多个第二集合。
示意性的,图5示出了本申请一示例性实施例示出的获取第四多边形集合的过程示意图,如图5所示,第三多边形集合包括基于三维模型的三维网格切割获得的并展开获得的二维多边形,该第三多边形集合可以表示为P3={p0,p1,...,pt},其中,t为正整数,表示第三多边形集合中包含的二维多边形的数量;第四多边形集合包括至少一个第二集合中的二维多边形,该第四多边形集合可以表示为P4={p0,p1,...,pk}。其中,k为正整数,表示第四多边形集合中包含的二维多边形的数量;在对第三多边形集合中的二维多边形进行向量验证时,计算机设备可以从第三多边形集合随机获取一个多边形pd,即第三多边形pd,将第三多边形pd推入验证序列F中;获取验证序列F中,处于序列首位的第四多边形f的法向量以及第三多边形pd的法向量当第四多边形的法向量与第三多边形的法向量之间的关系指示第三多边形与第四多边形之间的朝向差异小于差异阈值时,将该第四多边形加入到第二集合中,并获取第四多边形的第二邻域多边形;将第二邻域多边形加入到验证序列F中。其中,当第二邻域多边形中的多边形的数量为多个时,计算机设备可以按照邻域多边形的获取顺序或者验证顺序加入检测序列中,或者,也可以按照随机顺序加入检测序列中,本申请对此不进行限制。此后,按照验证序列F指示的多边形的顺序,依次对处于检测序列F首位的第四多边形的法向量,与第三多边形的法向量进行朝向差异判断,直至检测序列为空。
当第三多边形pd对应的验证序列F为空时,表示基于第三多边形pd进行的向量验证子过程结束,获得该第三多边形对应的第二集合;若此时第三多边形集合不为空,则从当前第三多边形集合中,随机获取另一个第三多边形,重复上述向量验证过程,直至第三多边形集合为空;从而获取到包含至少一个第三多边形各自对应的第二集合中的二维多边形的第四多边形集合。
其中,第二集合是基于第三多边形集合中任选的第三多边形发起的向量验证子过程获取的多边形的集合;每个第三多边形都会有与之对应的第二集合;因此若上述向量组合验证过程进行了s轮,s为正整数,且s﹤t则会产生s个第三多边形分别对应的第二集合,此时,第四多边形集合P4中包含s个第二集合中的二维多边形。
当第三多边形是从第三多边形集合中获取的首个多边形时,在将该第三多边形加入到验证序列F后,从验证序列中获取的首个第四多边形也为该第三多边形,此时基于两者的法向量进行朝向差异判断时,即为判断第三多边形与第三多边形自身的朝向差异。
可选的,基于第四多边形的法向量与第三多边形的法向量进行朝向差异与差异阈值的判 断过程可以表示为:
其中,表示第三多边形的法向量,表示第四多边形的法向量,δ表示差异阈值对应的数值。其中,δ的取值越接近1,表示第四多边形与第三多边形的朝向差异越小,两者组成的集合越容易投影展开。
若第三多边形的法向量与第四多边形的法向量使得上述不等式成立,则将第四多边形加入到第二集合中;若第三多边形的法向量与第四多边形的法向量使得上述不等式不成立,则不将第四边形加入到第二集合中。
在本申请实施例中,为了避免上述检测过程中的重复检测和冗余检测,在检测过程中,计算机设备会将第三多边形集合中与第二集合中包含的相同的二维多边形删除;进一步的,计算机设备可以对已进行过两两向量验证的多边形进行标注,以避免对已检测过的多边形的重复检测,造成计算资源的浪费。
S3107,基于第二切割单元,对三维模型进行切割以及展开,获得三维模型的碎片化的UV岛;该第二切割单元是基于第四多边形集合确定的切割单元。
该第二切割单元可以是基于第四多边形集合中包含的二维多边形确定的切割单元。
在一个可选的实施例中,第四多边形集合中包括多个第二集合,一个第二集和中的多个二维多边形最大可展开,则可以沿每个第二集合的边缘将三维模型切割及展开,得到三维模型的UV岛集。示例性的,一个第二集合中的多个二维多边形组成一个UV岛。
示例性的,利用上面的方法得到的切割结果(UV岛集)后,还可以结合美工制作要求,进一步拆解这些UV岛,即增加不可见处切割线与硬边切割线。对于前者,计算机设备可以通过光线投射法先计算出不可见部分,然后分析当前UV岛上的不可见区域的分布,将显著性高的不可见区域从中间切断产生两个新的UV岛,依次迭代直到所有UV岛都处理完。对于后者,计算机设备可以根据美工标记(人工标记)的硬边(蕴含在模型数据里),将所有UV岛的硬边都切开,得到以硬边隔离的、更细碎的UV岛。
示例性的,采用上面的方法拆解得到的UV岛集,既尽可能保留了1UV的美术意图,具有很好的可展性,也覆盖了美工制作原则中所有的合理割线(不可见割线与硬边割线),当然这些割线是过量的,所以接下来需要通过拼接UV岛来去除多余的割线。
步骤320,基于UV岛集进行预拼接以及重新展开,获得三维模型的基础拼接单元集。
该基础拼接单元是基于三维模型的碎片化的UV岛获得的拼接结果。
其中,基于UV岛集进行预拼接以及重新展开是指,在二维平面内,对各个碎片化的UV岛之间是否具有公共边或者是否具有邻接关系进行确定,将具有公共边或者具有邻接关系的UV岛进行拼接,同时,基于UV空间与三维空间的映射关系,将具有公共边或者具有邻接关系的UV岛对应在三维空间上的三维块进行拼接;将拼接后的各个三维块重新展开之后,即可获得三维模型的各个基础拼接单元,从而获得三维模型的基础拼接单元集。
可选的,三维模型的基础拼接单元可以是至少两个碎片化的UV岛拼接并展开之后获得的结果,也就是说,三维模型的一个基础拼接单元可以对应于至少两个碎片化的UV岛。
由于获得的碎片化的UV岛较为零碎,他们之间的拼接方案难以穷举,比如,任取一个UV岛,假设其有n个邻居岛,与邻居i有ci条公共边,则这一个UV岛与所有邻居岛存在种可能的方案,令ci=5,n=4,则存在1048576种可能的方案;因此,本申请实施例中采用分治拆解的方式对拼接问题进行处理。
可选的,基于UV岛集进行预拼接以及重新展开,获得三维模型的基础拼接单元集,包括:
通过至少一种预拼接方式,对各个碎片化的UV岛进行预拼接以及重新展开,获得三维模型的基础拼接单元集;
其中,至少一种预拼接方式包括平面预拼接,软边预拼接以及语义分割预拼接中的至少一种;该平面预拼接用以指示通过邻域蔓延和平面拼接的方法进行拼接的方式;该软边预拼接用以指示通过硬边对三维模型进行区域划分后,在各个区域内通过启发式搜索的方式进行拼接的方式;该语义分割预拼接用以指示利用三维模型的几何语义特征对三维模型进行分解,获得语义分割区域,以在各个语义分割区域内进行拼接的方式。
其中,平面预拼接是指利用邻域蔓延的方法获取三维模型中的最大平面集合,该最大平面集合中包含至少两个平面;然后依据可展曲面在离散网格上的定义,若相邻的平面拼接后可以保证可展性,即高斯曲率为0,则将两者拼接起来;反之,若相邻的平面拼接后不能保证可展性,即高斯区域不为0,则不对两者进行拼接。图6示出了本申请一示例性实施例示出的平面预拼接的示意图,如图6所示,平面610和平面620是最大平面集合中的任意两个平面,且平面610与平面620拼接后可以保证可展性,因此,可以将平面610与平面620进行拼接。
软边预拼接是指利用硬边将三维模型划分为多个区域,在软边预拼接时,在基于硬边划分的各个区域内进行拼接。由于软边拼接在美工制作过程中的优先级较高,因此,软边预拼接的方式可以保证拼接效果的准确性;在各个区域内进行拼接时,可以采用启发式搜索的方式实现各个区域内的拼接;其中,启发式搜索的方式可以包括:贪心算法、退火算法、遗传算法、蚁群算法等启发式方法,以及本申请实施例提供的提案-审理机制的拼接方法。该提案审理机制是指,将提案内容加入到提案序列中,并将提案序列中的提案内容依次取出并进行审理,以对提案内容的可行性进行确定的方案;不同应用中,提案-审理机制对应的提案内容和审理内容不同,比如,在软边预拼接过程中,该提案内容为碎片化的UV岛经过平面预处理后生成的各个拼接平面的平面拼接组合;在语义分割预拼接过程中,该提案内容为软边预拼接后获得的各个拼接结果的拼接组合。
在模型相关的领域中,软硬边(Soft and Hard Edge)是在制作三维模型时,利用制作工具对模型网格边的一种定义分类。在渲染时,硬边两侧的光影变化剧烈,形成明显的明暗对比;而软边两侧则光影过渡平缓,明暗模糊。
以下简要对通过提案-审理机制实现软边预拼接的过程进行说明:
获取基础拼接平面;该基础拼接平面是指碎片化的UV岛经过平面预处理后生成的各个拼接平面;
建立基础拼接平面之间的邻接关系表与对称关系表;
基于基础拼接平面之间的邻接关系表与对称关系表,创建拼接平面拼接队列;该平面拼接队列中包含平面拼接组合;该平面拼接组合是由至少两个平面组成的拼接组合;
按照平面拼接队列指示的处理顺序,对平面拼接队列中的平面拼接组合依次进行审核。
其中,若平面拼接组合通过审核,则基于该平面拼接组合构建该平面拼接组合对应的平面拼接结果,并基于该平面拼接结果更新平面拼接队列中的平面拼接组合,并将该平面拼接组合从平面拼接队列中删除;若该平面拼接组合通过审核,则将该平面拼接组合从拼接组合序列中删除,并获取平面拼接队列指示的处理顺序处于下一位,当前处于平面拼接队列第一位的下一平面拼接组合继续进行验证;重复上述过程,直至平面拼接队列中的平面拼接组合为空,获得软边预拼接的拼接结果。
在本申请实施例中,软边预拼接的过程可以是在基于硬边划分的各个区域中同时进行的,也就是说,上述通过提案-审核机制进行软边预拼接的过程可以同步实现在各个区域中,从而获得各个区域各自对应的软边预拼接的拼接结果,进而获得三维模型的软边预拼接的拼接结果。
语义分割预拼接是指利用三维模型的集合语义特征,比如大小、形状等,将原始的三维 模型进行分解,在分解获得的各个语义分割区域内进行预拼接的方式。可选的,对原始的三维模型进行分解时采用的语义分割算法可以是SDF(Shape Diameter Function,形状直径函数)分割算法,或者,也可以引入更多的几何特征,通对不同的语义加以不同的几何约束,并定义出语义结构关系,并基于上述几何约束和语义结构关系从而对三维模型进行分解;在各个语义分割区域中进行拼接时,可以采用本申请实施例提供的提案-审理机制的拼接方法;其中,提案-审理机制的拼接方法在语义分割预拼接中的实现形式,可以参考软边预拼接过程以及下述实施例中对基础拼接单元进行拼接的过程,此处不再赘述。
在一种可能的实现方式中,当计算机设备采用至少两种预拼接方式对碎片化的UV岛进行预拼接以及重新展开时,计算机设备可以按照至少两种预拼接方法分别对应的优先级顺序,依次进行预拼接以及重新展开。示意性的,响应于预拼接方式包含平面预拼接,软边预拼接以及语义分割预拼接中的至少两种,通过至少一种预拼接方式,对碎片化的UV岛进行预拼接以及重新展开,获得基础拼接单元,包括:
按照各个预拼接方式的优先级,对碎片化的UV岛进行预拼接以及重新展开,获得基础拼接单元。
不同的预拼接方式对应有不同的优先级,在计算机设备获取三维模型的预拼接结果时,计算机设备可以依照各个预拼接方式的优先级顺序,以碎片化的UV岛为拼接基础,依次通过不同的预拼接方式拼接获得拼接结果;优先级低的预拼接方式在基于相邻的,优先级高的上一个预拼接方式拼接完成后的拼接结果的基础上,进一步进行拼接。
可选的,平面预拼接的优先级高于软边预拼接的优先级;软边预拼接的优先级高于语义分割预拼接的优先级。也就是说,在计算机设备基于上述三种预拼接方式获取三维模型的预拼接结果时,先通过平面预拼接对碎片化的UV岛进行拼接并展开,获得平面预拼接的拼接结果;再通过软边预拼接对平面预拼接的拼接结果进行拼接并展开,获得软边预拼接的拼接结果;之后,再通过语义分割预拼接对软边预拼接的拼接结果进行拼接并展开,获得语义分割预拼接的拼接结果,即,获得三维模型的预拼接结果。图7示出了本申请一示例性实施例示出的三维模型的预拼接过程的示意图,假设在以碎片化的UV岛进行预拼接的过程中采用了平面预拼接,软边预拼接以及语义分割预拼接三种预拼接方法,在使用上述三种预拼接方法进行拼接时,按照优先级顺序,线性使用三种预拼接方法进行处理(包括拼接以及重新展开),如图7所示,计算机设备按照先进行平面预拼接710,然后再进行软边预拼接720,最后进行语义分割预拼接730的顺序,分别获取三种预拼接方式各自对应的预拼接结果,将语义分割预拼接获得的预拼接结果获取为基础拼接单元集;其中,不同的预拼接方式对应的拼接区域的划分结果不同。
上述基于分治思想利用全局特征来划分拼接区域的方法进行对拼接问题进行处理的方式,可以降低问题的复杂度,该方法可以适用于含有复杂结构的模型,能够提高模型拼接的效率。
步骤330,基于基础拼接单元集构建拼接组合序列;该拼接组合序列中包含基于模型展开要求对各个基础拼接单元进行组合得到的各个拼接组合;该模型展开要求包括基于模型设计需求制定的至少一种优化能量;该优化能量用于指示拼接组合的几何属性。
示意性的,该模型展开要求指示的至少一种优化能量包括:可见割线长度能量(Einv)、软硬边长度能量(Eedge)、形状能量(Eshape)、对称能量(Esymm)、扭曲能量(Ed)以及切线长度能量(Es)等等。
在对至少一种优化能量的要求中,可见割线长度能量(Einv)越小越好,以达到尽量隐藏割线的目的。软硬边长度能量(Eedge)越小越好,其中,软硬边长度是指软边割线长度与狭长硬边缝线长度之和;由于造成渗色的原因与软硬边切割关系有关,图8示出了本申请一示例性实施例示出的渗色现象的示意图,如图8所示,图8中的(A)部分示出了由于软边割线造成的渗色现象,即三维模型中的接缝810明显;图8中的(B)部分示出了由于缝合 狭长硬边导致的渗色现象,即三维模型中出现黑边820;因此,该能量越小,渗色现象越少,从而达到减少渗色现象的目的。形状能量(Eshape)指示不规则形状的数量,该形状能量越小越好,以使得三维模型的展开结果形状规整,减少不规则形状,其中不规则的形状包括环、多洞以及细长条等等。对称能量(Esymm)用以指示拼接组合丢失对称轴的数量,该对称能量(Esymm)越小越好,以使得三维模型的展开结果保持对称。扭曲能量(Ed)用以指示角度形变量加上面积形变量的总形变量,该扭曲能量(Ed)越小越好,以使得三维模型的展开结果的扭曲较小。切线长度能量(Es)用以指示拼接前切线总长度减去拼接缝线长度所得的长度差,该切线长度能量(Es)越小越好,以使得切线长度尽量短。
在一种可能的实现方式中,计算机设备可以穷举基础拼接单元的拼接组合,将所有拼接组合推入拼接组合序列,以构建拼接组合序列;
在另一种可能的实现方式中,由于基于基础拼接单元构建的拼接组合的可能性较多,为了减少计算机设备的数据处理量,在构建拼接组合序列时,计算机设备可以通过启发条件来对搜索路径进行剪枝,以降低数据处理量,降低拼接问题的复杂度。
可选的,基于基础拼接单元构建的拼接组合,构建拼接组合序列,包括:
穷举基于各个基础拼接单元构建的基础拼接组合,获得基础拼接组合集;
基于剪枝策略,对基础拼接组合集进行剪枝,获得各个优选拼接组合;
基于各个优选拼接组合,构建拼接组合序列。
也就是说,在进行构建拼接组合时,可以先对穷举基础拼接单元构建基础拼接组合进行初步筛选,保留其中的部分拼接组合,即优选拼接组合,以减少对对拼接组合序列中的拼接组合进行验证时的数据处理量。
其中,该剪枝策略可以是基于模型设计要求设定的策略;可选的,基于上述至少一种优化能量制定的剪枝策略可以包括:基于拼接长度的策略,以及基于拼接缝线的策略中的至少一种;
基于拼接长度的策略包括:响应于基础拼接组合对应的长度差与相邻边的长度的比值小于目标阈值时,拒绝基础拼接组合;长度差是指两个基础拼接单元相邻边的长度与两个基础拼接单元对应的基础拼接组合中的缝线的长度之间差值;
基于拼接缝线的策略包括:响应于基础拼接组合中的缝线的段数与基础拼接组合中的两个基础拼接单元中的连续相邻边的数量之差大于数量阈值,拒绝基础拼接组合。
也就是说,将拼接长度过短的拼接组合筛除:当两个基础拼接单元相邻边很长,但这两个基础拼接单元对应的基础拼接组合中的缝线过短时,产生的拼接结果的造型会不规整,且违背切线长度尽量短的原则,因此,拒绝该拼接组合。将拼接缝线分段的拼接组合筛除:拼接缝线的分段数的约束用以保证缝线的有效性,一般而言,基础拼接组合中的缝线的段数等于基础拼接组合中的两个基础拼接单元中的连续相邻边的数量;在本申请实施例中,可以设定数量阈值,以通过缝线的段数和连续相邻边的数量之差,确定拼接缝线是否存在分段,例如,当两个基础拼接单元只有一条连续的两邻边,但是缝线却分为隔断的两段,导致中间出现一个切口,这与实际操作过程中所产生的拼接效果不同,也就是说这种分割方式是人工制作过程中不可能出现的,因此,拒绝该拼接组合。
可选的,基于优选拼接组合,构建拼接组合序列的过程可以实现为:
获取各个优选拼接组合的优化能量值;该优化能量值包含至少一种优化能量的能量值;
基于各个优选拼接组合的优化能量值,获取各个优选拼接组合的验证顺序;
基于各个优选拼接组合的验证顺序,构建拼接组合序列。
示意性的,当模型展开要求基于模型设计需求制定了一种优化能量时,也就是说,优化能量值中包含一种优化能量的能量值时,计算机设备可以基于该各个优选拼接组合的该优化能量的能量值对各个优选拼接组合进行排序,将排序结果获取为验证顺序,并基于该验证顺序,构建拼接组合序列。
或者,当模型展开要求基于模型设计需求制定了多种优化能量时,也就是说,优化能量值中包含n种优化能量的能量值时,n种优化能量具有各自的优先级;n≥2,且n为整数;
基于各个优选拼接组合的优化能量值,获取各个优选拼接组合的验证顺序的过程实现为:
基于各个优选拼接组合的优化能量值,以及n种优化能量的优先级,获取各个优选拼接组合的验证顺序。
其中,至少一种优化能量的优先级顺序可以是相关人员基于模型设计需求制定的,也就是说,该模型展开要求包括基于模型涉及需求制定的至少一种优化能量,以及至少一种优化能量各自的优先级。
示意性的,以上述6种优化能量为例,在一种可能的情况下,上述6种优化能量的按照优先级顺序排序可以依次为:可见割线长度能量(Einv)、软硬边长度能量(Eedge)、形状能量(Eshape)、对称能量(Esymm)、扭曲能量(Ed)以及切线长度能量(Es)。需要说明的是,不同情况下,优化能量的优先级顺序可能不同,上述优先级顺序仅为示意性的,不对本申请中的优先级顺序的设定进行限制。
在进行验证顺序确认时,按照优先级顺序,基于优化能量的能量值进行排序,依次进行判断;示意性的,以上述示意性示出的6种能量的优先级顺序为例,先按照可见割线长度能量(Einv)由小到大的顺序对优选拼接组合进行排序,若排序结果中,存在a个优选拼接组合的可见割线长度能量(Einv)相同,则,按照a个优选拼接组合的软硬边长度能量(Eedge)从小到大的顺序进一步对a个优选拼接组合进行排序,若排序结果中,存在b个优选拼接组合的软硬边长度能量(Eedge)也相同,则,按照b个优选拼接组合的形状能量(Eshape)进一步确定b个优选拼接组合的验证顺序,以此类推,直至确定所有优选拼接组合的验证顺序;示意性的,假设存在8个优选拼接组合,基于可见割线长度能量(Einv)由小到大的顺序对这8个优选拼接组合进行排序后,有3个优选拼接组合的可见割线长度能量(Einv)能量值均处于第三位,则按照软硬边长度能量(Eedge)由小到大的顺序对这3个优选拼接组合进行排序,确定第3-5位上分别对应的优选拼接组合;若仍有2个优选拼接组合的可见割线长度能量(Einv)能量值相同,且都位于第4位,那么再按照形状能量(Eshape)由小到大的顺序对这2个优选拼接组合进行排序,确定第4位和第5位分别对应的优选拼接组合;直至各个验证顺序上均对应一个优选拼接组合位置。
在一种可能的实现方式中,当基于优先级顺序,按照目标数量各个优化能量对优选拼接组合进行排序后,仍无法确定若干优选拼接组合的验证顺序,计算机设备可以利用切线长度能量(Es)对若干优选拼接组合直接进行排序,以确定若干优选拼接组合的验证顺序;其中,目标数量可以为4,也就是说,在基于可见割线长度能量(Einv)、软硬边长度能量(Eedge)、形状能量(Eshape)、对称能量(Esymm)对优选拼接组合进行排序后,仍无法确认该优选拼接组合的验证顺序,则通过切线长度能量(Es)的排序结果直接确定该优选拼接组合的验证顺序。
可选的,由于优先级顺序的定义并非一成不变,优选能量用作分类更加稳定与鲁棒;因此计算机设备也可以基于优先级较高的目标数量的优化能量,利用阈值对拼接组合进行二分类,确定各个优选拼接组合的验证顺序分组;其中,小于能量阈值的分组中的优选拼接组合优先拼接,大于能量阈值的分组中的优选拼接组合后拼接;之后,对二分类后获取的各个分组中的优选拼接组合,以分类为单位进行排序。也就是说,基于各个优选拼接组合的优化能量值,以及n种优化能量的优先级,获取各个优选拼接组合的验证顺序可以实现为:
基于n-1种优化能量的能量值,以及n-1种优化能量的优先级,对各个优选拼接组合进行二分类,获得2(n-1)个分组的优选拼接组合;n-1种优化能量为n种优化能量中,除了目标优化能量之外的其它优化能量;该目标优化能量是n种优化能量,优先级最低的优化能量;
基于目标优化能量,对2(n-1)个分组的拼接组合分别进行排序,获得各个优选拼接组合的验证顺序。
计算机设备基于第一组优化能量进行二分类可以获得2(n-1)个分组;示意性的,以n=5为例,且5种优化能量及其对应的优先级排序为:可见割线长度能量(Einv)、软硬边长度能量(Eedge)、形状能量(Eshape)、对称能量(Esymm)以及切线长度能量(Es)为例,此时,目标优化能量为切线长度能量(Es),n-1种优化能量包括优先级排序前4位的优化能量,即可见割线长度能量(Einv)、软硬边长度能量(Eedge)以及形状能量(Eshape);计算机设备先基于可见割线长度能量(Einv)以及其对应的第一能量阈值对优选拼接组合进行二分类,获得可见割线长度能量(Einv)小于第一能量阈值的第一分类的优选拼接组合,以及可见割线长度能量(Einv)小于第一能量阈值的第二分类的优选拼接组合,共分为两个分组,其中,第一分类的验证优先级高于第二分类的验证优先级;再基于软硬边长度能量(Eedge)以及其对应的第二能量阈值对第一分类的优选拼接组合以及第二分类的优选拼接组合分别进行二分类,获得第一分类中的软硬边长度能量(Eedge)小于第二能量阈值的第三分类的优选拼接组合,第一分类中的软硬边长度能量(Eedge)大于第二能量阈值的第四分类的优选拼接组合,第二分类中软硬边长度能量(Eedge)小于第二能量阈值的第五分类的优选拼接组合,以及第二分类中的软硬边长度能量(Eedge)大于第二能量阈值的第六分类的优选拼接组合,共分为四个分组,其中,这四个分组对应的验证优先级顺序由高到低分别为:第三分类>第四分类>第五分类>第六分类;之后,基于形状能量(Eshape)以及其对应的第三能量阈值对第三分类、第四分类、第五分类以及第六分类各自对应的优选拼接组合进行二分类,共分为八个分组;最后,基于对称能量(Esymm)对基于形状能量(Eshape)进行二分类获得的八个分类分别对应的优选拼接组合进行二分类,共分为十六个分3组。
可选的,目标优化能量可以是除用以分类的优化能量中的任意一个,在获取到2(n-1)个分组后,计算机设备可以基于各个分组中,各个优选拼接组合的目标优化能量的能量值,在各个分组中,对优选拼接组合进行排序;示意性的,在第一分组中,计算机设备基于第一分组中的各个优选拼接组合的目标优化能量的能量值,对第一分组中的各个优选拼接组合进行排序,获得第一分组对应的各个优选拼接组合的排序结果,该第一分组是2(n-1)个分组中的任意一个。
示意性的,该目标优化能量是切线长度能量(Es),计算机设备将2(n-1)个分组分别基于切线长度能量(Es)进行排序的排序结果,获取为各个分组中各个优选拼接组合的验证顺序。
在获取到2(n-1)个分组各自包含的优选拼接组合的验证顺序后,计算机设备可以基于各个分组的优先级对2(n-1)个分组进行整合,获得拼接序列中各个优选拼接组合的验证顺序;其中,同一优化能量划分的分组中,小于该优化能量对应的能量阈值的分组的验证优先级高于大于该优化能量对应的能量阈值的分组的优先级。示意性的,以存在8个优选拼接组合,n=3,且3种优化能量及其对应的优先级排序为:可见割线长度能量(Einv)、软硬边长度能量(Eedge)以及切线长度能量(Es)为例,在基于可见割线长度能量(Einv)对8个优选拼接组合进行二分类后可以获得分组1和分组2,其中,分组1中的优选拼接组合的可见割线长度能量小于第一能量阈值;分组2中的优选拼接组合的可见割线长度能量大于第一能量阈值;假设分组1中包含优选拼接组合1、3、4、8,分组2中包含优选拼接组合2、5、6、7;基于软硬边长度能量(Eedge)对分组1中的优选拼接组合和分组2中的优选拼接组合分别进行二分类,获得分组1-1,分组1-2以及分组2-1,分组2-2,其中,分组1-1和分组2-1中的优选拼接组合的软硬边长度能量(Eedge)小于第二能量阈值,分组1-2和分组2-2中的优选拼接组合的软硬边长度能量(Eedge)大于第二能量阈值;假设分组1-1中包括优选拼接组合1、4,分组1-2中包含优选拼接组合3、8;分组2-1中包含优选拼接组合2、5,分组2-2中包含优选拼接组合6、7;之后,基于切线长度能量(Es)分别对分组1-1、分组1-2、 分组2-1、分组2-2中包含的优选拼接组合进行排序,获得分组1-1:1、4,分组1-2:8、3,分组2-1:5、2,分组2-2:6、7;计算机设备基于上述分组和排序结果,对各个分组内的优选拼接组合的验证顺序进行整合,获得拼接序列中各个优选拼接组合的验证顺序为1、4、8、3、5、2、6、7。
基于上述验证顺序,将各个优选拼接组合推入拼接组合序列,以构建该拼接组合序列。
可选的,拼接组合(包括基础拼接组合以及优选拼接组合)中包括基础拼接单元之间的邻接关系表以及对称关系表,用以标准组成拼接组合的基础拼接单元以及相对位置关系。
步骤340,对拼接组合序列中的各个拼接组合进行验证,获得基础拼接单元的拼接结果。
可选的,对拼接组合序列中的各个拼接组合进行验证,获得基础拼接单元的拼接结果,包括:
基于拼接组合序列执行至少一次组合验证过程,直至拼接组合序列为空,获得基础拼接单元的拼接结果;
其中,该组合验证过程包括以下步骤。
S3401,对拼接组合序列中,处于序列首位的第一拼接组合进行验证。
在本申请实施例中,在对拼接组合序列中处于序列首位的第一拼接组合进行验证时,计算机设备可以通过两种不同的验证策略对第一拼接组合进行验证;基于上述验证方式,对第一拼接组合进行验证的过程可以实现为:
对第一拼接组合进行初次验证;该初次验证用以验证第一拼接组合是否可成功展开;其中,成功展开是指拼接组合可展开,并且,展开后的形变小于形变阈值且维持对称性;
响应于初次验证通过,对第一拼接组合进行二次验证;二次验证用以验证第一拼接组合展开后形成的UV岛的形状是否符合形状模板。
也就是说,初次验证用以审查当前拼接组合提案是否可展开、且展开后的形变是否过大以及对称性是否被破坏;可选的,初次验证时,计算机设备可以对当前拼接组合进行无翻转的ARAP(As-Rigid-As-Possible)展开,如果展开失败,则拼接失败,如果展开成功,则校验其展开的扭曲程度与对称性,不满足条件则拒绝,其中,对扭曲程度的校验实现为对展开后的形变与形变阈值之间的比较,对对称性的验证是指在展开后,验证展开后的UV岛是否继续维持原本的对称性,如果破坏则拒绝该拼接组合;二次验证用以审查是否产生不利于后续步骤的UV岛造型,比如,比例与后续步骤的UV岛造型可以包括大圆环,长条以及自对称轴丢失等情况的造型等等;该形状模板是相关人员设定的,符合后续步骤的UV岛造型。
S3402,响应于第一拼接组合验证通过,对第一拼接组合包含的基础拼接单元进行拼接,获得第一拼接组合的拼接结果,并删除拼接组合序列中的第一拼接组合。
S3403,基于第一拼接组合的拼接结果,以及第一拼接组合包含的基础拼接单元各自对应的其他拼接组合,更新拼接组合序列中的拼接组合。
可选的,基于第一拼接组合的拼接结果,以及第一拼接组合包含的基础拼接单元各自对应的其他拼接组合,更新拼接组合序列中的拼接组合,包括:
将其他拼接组合中的第一基础拼接单元替换为第一拼接组合的拼接结果;第一基础拼接单元是第一拼接组合包含的基础拼接单元。也就是说,将包含有组成第一拼接组合的预拼接结果的其他拼接组合中,与第一拼接组合的预拼接结果相同的预拼接结果,替换为第一拼接组合的拼接结果,从而得到新的拼接组合,更新邻接关系表与对称关系表;同时,将原始的拼接组合以及对应的邻接关系表与对称关系表删除。示意性的,假设第一拼接组合中包含基础拼接单元A和基础拼接单元B,且第一拼接组合通过验证,则生成第一拼接组合的拼接结果AB;在原拼接组合序列中还包括包含有基础拼接单元A和基础拼接单元B的其他拼接组合,比如拼接组合A+C,以及拼接组合B+F等等,在获取到第一拼接组合的拼接结果AB后,对原拼接组合序列中的其他拼接组合进行更新,比如,将拼接组合A+C更新为 AB+C,将接组合B+F更新为AB+F,更新对应的邻接关系表与对称关系表;将原拼接组合A+C,以及拼接组合B+F以及对应的邻接关系表与对称关系表删除。
上述构建拼接组合序列,并将拼接组合序列中的拼接组合依次取出并进行验证以获取基础拼接单元的拼接结果的方式可以称为提案-审理机制。在通过提案-审理机制对拼接组合序列执行的至少一次组合验证过程的中,计算机设备可以按照拼接组合序列指示的处理顺序,依次从该拼接组合序列中取出拼接组合;对取出的拼接组合进行验证,若该拼接组合验证通过,则基于该拼接组合构建该拼接组合对应的拼接结果,并基于该拼接结果更新拼接组合序列中的拼接组合,并将该拼接组合从拼接组合序列中删除;若该拼接组合验证不通过,则将该拼接组合从拼接组合序列中删除,并获取原拼接组合序列指示的处理顺序处于下一位,当前处于拼接组合序列第一位的拼接组合继续进行验证;重复上述过程,直至拼接组合序列中的拼接组合为空,获得基础拼接单元的拼接结果。图9示出了本申请一示例性实施例示出的基于提案-审理机制进行拼接组合验证的过程示意图,如图9所示,该过程可以包括以下步骤。
S901,创建基础拼接单元。
在本申请实施例中,该基础拼接单元特指在对三维模型的碎片化UV岛经过预拼接以及重新展开后获得的预拼接结果。
S902,基于基础拼接单元构建拼接组合。
构建拼接组合的过程可以是指建立基础拼接单元之间的邻接关系表以及对称关系表的过程。
S903,基于拼接组合,构建拼接组合序列。
S904,判断拼接组合序列是否为空,若是则执行S99,否则,执行S905。
S905,取拼接组合序列中首位的第一拼接组合,进行验证。
S906,判断初次验证是否通过,若是,则执行S907,否则,执行S908。
S907,判断二次验证是否通过,若是,则执行S909,否则,执行S908。
S908,删除该第一拼接组合。
S909,按第一拼接组合的拼接方案产生新的拼接单元,并基于新的拼接单元更新拼接组合序列。
其中,基于新的拼接单元更新拼接组合序列是指,将该第一拼接组合从拼接组合序列中删除,获取拼接组合序列中包含第一拼接组合中的基础拼接单元的其他拼接组合,将其他拼接组合序列中的基础拼接单元更新为第一拼接组合对应的新的拼接单元,并将原其他拼接组合及其对应的关系表删除。
S910,根据最后的拼接单元,进行拼接以及展开,生成三维模型的展开。
步骤350,基于基础拼接单元的拼接结果,生成三维模型的展开结果。
该基础拼接单元的拼接结果包括在二维平面内对UV岛的二维拼接结果以及该二维拼接结果对应在三维空间中的三维拼接结果,计算机设备对该三维拼接结果进行重新展开,获得该三维模型的展开结果。
可选的,在三维模型的展开过程中可能会存在不可展开的岛以及退化岛,计算机设备需要对这些岛进行特殊处理以保证展开效果;其中,不可展开的岛包括:展开形变很大的岛、展开存在交叠的岛以及展开方式无法求解的岛等;对于不可展开的岛,可以保留其对应的三维网格的原本UV岛造型,对于退化岛,可以将其退化成一个点,放置于指定坐标位置处。
在本申请实施例中,计算机设备引入回退机制对基于基础拼接单元的拼接结果进行处理,以弥补在前面步骤中已经产生的过度拼接,对拼接结果进行补充和修正;可选的,本申请实施例中可以引入不规则UV岛的切割策略作为本申请的回退机制,该切割策略针对模型UV展开过程中可能存在的各种不规则情况,进行归类处理,并且其切割策略可以很灵活的结合美术制作的意图,从而高效的切割不规则的UV岛形状。
综上所述,本申请实施例提供的三维模型的展开方法,通过对三维模型进行切割以及展开,获得三维模型的基础拼接单元集;在获取到基于基础拼接单元集中的各个接触拼接单元组合获得的各个拼接组合后,依据模型设计需求制定的至少一种优化能量,基于各个拼接组合构建拼接组合序列;通过对拼接组合序列中的拼接组合进行验证后,获得基础拼接单元的拼接结果,以基于基础拼接单元的拼接结果生成三维模型的展开结果。在上述对三维模型的展开过程中,可以实现三维模型展开过程的自动化,同时充分考虑到模型设计中的实际需求,使得获得的三维模型的展开结果更加符合实际需求,提高了对三维模型的展开效果。
为验证本申请提供的三维模型的展开方法的效果,在自动2UV项目的切割展开工具中对本申请提供的三维模型的展开方法进行了应用,并测试了其在美术实施例在实际应用中以及其在美术资源2UV生产中的使用效果。下面示意性的提供一些测试统计结果:表1列举了在几个典型美术资源上基于本申请提供的三维模型的展开方法获得的工具展开结果的UV岛数量与人工展开结果的对比数据;表2是在美术资源数据库上测试的结果,数据给出的是基于本申请提供的三维模型的展开方法获得的自动2UV最终结果与人工结果的对比,对比的维度是美工制作2UV时比较关注的四个量化指标,其中,三维模型的展开方法主要影响后两项指标,超九成指该样本超过人工结果在该指标上的九成,超十成则表示该样本在该指标上完全超过人工结果。
表1
表2
结果表明,通过本申请提供的三维模型的展开方法,展开得到的UV岛数量以及不合理的切割线更少、UV岛形状更为规整、对称性维持得更加完整。通过在游戏美术资源数据上测试统计,通过本申请提供的三维模型的展开方法获得的UV岛数量与美工制作的结果相似,整体效果更优。
图10示出了自动2UV最终结果通过烘焙后与人工制作的2UV烘焙结果的对比示意图,如图10所示,基于本申请提供的三维模型的展开方法获得的2UV展开结果烘焙获得的烘焙结果1010与人工制作2UV烘焙结果1020以及与虚拟2UV烘焙结果1030的差异较小,且能够在一定程度上避免接缝渗色的现象,从而表明本申请提供的三维模型的展开方法的展开效果较好。
图11示出了本申请一示例性实施例示出的三维模型的展开装置的方框图,如图11所示,该三维模型的展开装置可以包括以下模块。
单元集获取模块1110,用于执行上述方法实施例中的步骤210;
序列构建模块1120,用于执行上述方法实施例中的步骤220;
组合验证模块1130,用于执行上述方法实施例中的步骤230;
结果生成模块1140,用于执行上述方法实施例中的步骤240。
在一种可能的实现方式中,序列构建模块1120,包括:
穷举子模块,用于穷举基于各个基础拼接单元构建的基础拼接组合,获得基础拼接组合集;剪枝子模块,用于基于剪枝策略,对基础拼接组合集进行剪枝,获得各个优选拼接组合;序列构建子模块,用于基于各个优选拼接组合,构建拼接组合序列。
在一种可能的实现方式中,序列构建子模块,包括:
能量值获取单元,用于获取各个优选拼接组合的优化能量值;优化能量值包含至少一种优化能量的能量值;顺序获取单元,用于基于各个优选拼接组合的优化能量值,获取各个优选拼接组合的验证顺序;序列构建单元,用于基于各个优选拼接组合的验证顺序,构建拼接组合序列。
在一种可能的实现方式中,至少一种优化能量包含n种优化能量,n种优化能量具有各自的优先级;n≥2,且n为整数;
顺序获取单元,用于基于各个优选拼接组合的优化能量值,以及n种优化能量的优先级,获取各个优选拼接组合的验证顺序。
在一种可能的实现方式中,顺序获取单元,用于,
基于n-1种优化能量的能量值,以及n-1种优化能量的优先级,对各个优选拼接组合进行二分类,获得2(n-1)个分组的优选拼接组合;n-1种优化能量为n种优化能量中,除了目标优化能量之外的其它优化能量;目标优化能量是n种优化能量,优先级最低的优化能量;
基于目标优化能量,对2(n-1)个分组的拼接组合分别进行排序,获得各个优选拼接组合的验证顺序。
在一种可能的实现方式中,剪枝策略包括:基于拼接长度的策略,以及基于拼接缝线的策略中的至少一种;
基于拼接长度的策略包括:响应于基础拼接组合对应的长度差与相邻边的长度的比值小于目标阈值时,拒绝基础拼接组合;长度差是指两个基础拼接单元相邻边的长度与两个基础拼接单元对应的基础拼接组合中的缝线的长度之间差值;
基于拼接缝线的策略包括:响应于基础拼接组合中的缝线的段数大于基础拼接组合中的两个基础拼接单元中的相邻边的数量,拒绝基础拼接组合。
在一种可能的实现方式中,组合验证模块1130,用于基于拼接组合序列执行至少一次组合验证过程,直至拼接组合序列为空,获得基础拼接单元的拼接结果;
其中,组合验证模块1130,包括:
组合验证子模块,用于对拼接组合序列中,处于序列首位的第一拼接组合进行验证;
单元拼接子模块,用于响应于第一拼接组合验证通过,对第一拼接组合包含的基础拼接单元进行拼接,获得第一拼接组合的拼接结果,并删除拼接组合序列中的第一拼接组合;
组合更新子模块,用于基于第一拼接组合的拼接结果,以及第一拼接组合包含的基础拼接单元各自对应的其他拼接组合,更新拼接组合序列中的拼接组合;响应于第一拼接组合验证不通过,将第一拼接组合从拼接组合序列中删除。
在一种可能的实现方式中,组合验证子模块,包括:
第一验证单元,用于对第一拼接组合进行初次验证;初次验证用以验证第一拼接组合是否可成功展开;其中,成功展开是指拼接组合可展开,并且,展开后的形变小于形变阈值且维持对称性;
第二验证单元,用于响应于初次验证通过,对第一拼接组合进行二次验证;二次验证用 以验证第一拼接组合展开后形成的UV岛的形状是否符合形状模板。
在一种可能的实现方式中,组合更新子模块,用于将其他拼接组合中的第一基础拼接单元替换为第一拼接组合的拼接结果;第一基础拼接单元是第一拼接组合包含的基础拼接单元。
在一种可能的实现方式中,单元集获取模块1110,包括:
UV岛集获取子模块,用于基于切割单元,对三维模型进行切割以及展开,获得UV岛集,UV岛集中包含三维模型的各个碎片化的UV岛;
单元获取子模块,用于基于UV岛集进行预拼接以及重新展开,获得三维模型的基础拼接单元集。
在一种可能的实现方式中,单元获取子模块,用于通过至少一种预拼接方式,对各个碎片化的UV岛进行预拼接以及重新展开,获得三维模型的基础拼接单元集;
其中,至少一种预拼接方式包括平面预拼接,软边预拼接以及语义分割预拼接中的至少一种;平面预拼接用以指示通过邻域蔓延和平面拼接的方法进行拼接的方式;软边预拼接用以指示通过硬边对三维模型进行区域划分后,在各个区域内通过启发式搜索的方法进行拼接的方式;语义分割预拼接用以指示利用三维模型的几何语义特征对三维模型进行分解,获得语义分割区域,以在各个语义分割区域内进行拼接的方式。
在一种可能的实现方式中,单元获取子模块,用于响应于预拼接方式包含平面预拼接,软边预拼接以及语义分割预拼接中的至少两种,按照各个预拼接方式的优先级,对碎片化的UV岛进行预拼接以及重新展开,获得基础拼接单元。
综上所述,本申请实施例提供的三维模型的展开装置,通过对三维模型进行切割以及展开,获得三维模型的基础拼接单元集;在获取到基于基础拼接单元集中的各个接触拼接单元组合获得的各个拼接组合后,依据模型设计需求制定的至少一种优化能量,基于各个拼接组合构建拼接组合序列;通过对拼接组合序列中的拼接组合进行验证后,获得基础拼接单元的拼接结果,以基于基础拼接单元的拼接结果生成三维模型的展开结果。在上述对三维模型的展开过程中,可以实现三维模型展开过程的自动化,同时充分考虑到模型设计中的实际需求,使得获得的三维模型的展开结果更加符合实际需求,提高了对三维模型的展开效果。
图12示出了本申请一示例性实施例示出的计算机设备1200的结构框图。该计算机设备可以实现为本申请上述方案中的服务器。所述计算机设备1200包括处理器(比如中央处理器(Central Processing Unit,CPU))1201、包括随机存取存储器(Random Access Memory,RAM)1202和只读存储器(Read-Only Memory,ROM)1203的系统存储器1204,以及连接系统存储器1204和中央处理单元1201的系统总线1205。所述计算机设备1200还包括用于存储操作系统1209、应用程序1210和其他程序模块1211的大容量存储设备1206。
处理器1202可以包括一个或多个处理核心,比如4核心处理器、3核心处理器等。处理器1201可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1201也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU;协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1201可以集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1201还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
系统存储器1204可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。系统存储器还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,系统存储器中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器1201所执行以实现本申 请中方法实施例示出的三维模型的展开方法中的全部或部分步骤。
不失一般性,所述计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、可擦除可编程只读寄存器(Erasable Programmable Read Only Memory,EPROM)、电子抹除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)闪存或其他固态存储其技术,只读光盘(Compact Disc Read-Only Memory,CD-ROM)、数字多功能光盘(Digital Versatile Disc,DVD)或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知所述计算机存储介质不局限于上述几种。上述的系统存储器1204和大容量存储设备1206可以统称为存储器。
根据本公开的各种实施例,所述计算机设备1200还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即计算机设备1200可以通过连接在所述系统总线1205上的网络接口单元1207连接到网络,或者说,也可以使用网络接口单元1207来连接到其他类型的网络或远程计算机系统(未示出)。
在一些实施例中,计算机设备1200还可选包括有:外围设备接口和至少一个外围设备。处理器、系统存储器和外围设备接口之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口相连。具体地,外围设备包括:射频电路、显示屏、摄像头组件、音频电路和电源中的至少一种。
在一些实施例中,计算机设备1200还包括有一个或多个传感器。该一个或多个传感器包括但不限于:加速度传感器、陀螺仪传感器、压力传感器、光学传感器以及接近传感器。
所述存储器还存储有至少一条计算机程序,处理器1201通过执行该至少一条计算机程序来实现上述各个实施例所示的三维模型的展开方法中的全部或部分步骤。
在一示例性实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有至少一条计算机程序,该计算机程序由处理器加载并执行以实现上述三维模型的展开方法中的全部或部分步骤。例如,该计算机可读存储介质可以是只读存储器、随机存取存储器、只读光盘、磁带、软盘和光数据存储设备等。
在一示例性实施例中,还提供了一种计算机程序产品,该计算机程序产品包括至少一条计算机程序,该计算机程序由处理器加载并执行上述任一实施例所示的三维模型的展开方法的全部或部分步骤。

Claims (20)

  1. 一种三维模型的展开方法,所述方法由计算机设备执行,所述方法包括:
    对所述三维模型进行展开,获得所述三维模型的基础拼接单元集;所述基础拼接单元集中包含基于所述三维模型的UV岛获得的各个基础拼接单元;
    基于所述基础拼接单元集构建拼接组合序列;所述拼接组合序列中包含基于模型展开要求对各个所述基础拼接单元进行组合得到的各个拼接组合;所述模型展开要求包括基于模型设计需求制定的至少一种优化能量;所述优化能量用于指示所述拼接组合的几何属性;
    对所述拼接组合序列中的各个所述拼接组合进行验证,获得所述基础拼接单元的拼接结果;
    基于所述基础拼接单元的拼接结果,生成所述三维模型的展开结果。
  2. 根据权利要求1所述的方法,其中,所述基于所述基础拼接单元集构建拼接组合序列,包括:
    穷举基于所述各个基础拼接单元构建的基础拼接组合,获得基础拼接组合集;
    基于剪枝策略,对所述基础拼接组合集进行剪枝,获得各个优选拼接组合;
    基于各个所述优选拼接组合,构建所述拼接组合序列。
  3. 根据权利要求2所述的方法,其中,所述基于各个所述优选拼接组合,构建所述拼接组合序列,包括:
    获取各个所述优选拼接组合的优化能量值;所述优化能量值包含至少一种所述优化能量的能量值;
    基于各个所述优选拼接组合的所述优化能量值,获取各个所述优选拼接组合的验证顺序;
    基于各个所述优选拼接组合的所述验证顺序,构建所述拼接组合序列。
  4. 根据权利要求3所述的方法,其中,至少一种所述优化能量包含n种所述优化能量,n种所述优化能量具有各自的优先级;n≥2,且n为整数;
    所述基于各个所述优选拼接组合的所述优化能量值,获取各个所述优选拼接组合的验证顺序,包括:
    基于各个所述优选拼接组合的所述优化能量值,以及n种所述优化能量的优先级,获取各个所述优选拼接组合的所述验证顺序。
  5. 根据权利要求4所述的方法,其中,所述基于各个所述优选拼接组合的所述优化能量值,以及n种所述优化能量的优先级,获取各个所述优选拼接组合的验证顺序,包括:
    基于n-1种所述优化能量的能量值,以及n-1种所述优化能量的优先级,对各个所述优选拼接组合进行二分类,获得2(n-1)个分组的所述优选拼接组合;n-1种所述优化能量为n种所述优化能量中,除了目标优化能量之外的其它所述优化能量;所述目标优化能量是n种所述优化能量,优先级最低的所述优化能量;
    基于所述目标优化能量,对2(n-1)个分组的所述拼接组合分别进行排序,获得各个所述优选拼接组合的所述验证顺序。
  6. 根据权利要求4所述的方法,其中,所述剪枝策略包括:基于拼接长度的策略,以及基于拼接缝线的策略中的至少一种;
    所述基于拼接长度的策略包括:响应于所述基础拼接组合对应的长度差与相邻边的长度的比值小于目标阈值时,拒绝所述基础拼接组合;所述长度差是指两个所述基础拼接单元相邻边的长度与两个所述基础拼接单元对应的基础拼接组合中的缝线的长度之间差值;
    所述基于拼接缝线的策略包括:响应于所述基础拼接组合中的缝线的段数与所述基础拼接组合中的两个所述基础拼接单元中的连续相邻边的数量之差大于数量阈值,拒绝所述基础拼接组合。
  7. 根据权利要求1所述的方法,其中,所述对所述拼接组合序列中的各个所述拼接组合进行验证,获得所述基础拼接单元的拼接结果,包括:
    基于所述拼接组合序列执行至少一次组合验证过程,直至所述拼接组合序列为空,获得所述基础拼接单元的拼接结果;
    其中,所述组合验证过程包括:
    对所述拼接组合序列中,处于序列首位的第一拼接组合进行验证;
    响应于所述第一拼接组合验证通过,对所述第一拼接组合包含的所述基础拼接单元进行拼接,获得所述第一拼接组合的拼接结果,并删除所述拼接组合序列中的所述第一拼接组合;
    基于所述第一拼接组合的拼接结果,以及所述第一拼接组合包含的所述基础拼接单元各自对应的其他拼接组合,更新所述拼接组合序列中的所述拼接组合。
  8. 根据权利要求7所述的方法,其中,所述组合验证过程还包括:
    响应于所述第一拼接组合验证不通过,将所述第一拼接组合从所述拼接组合序列中删除。
  9. 根据权利要求7所述的方法,其中,所述对所述拼接组合序列中,处于序列首位的第一拼接组合进行验证,包括:
    对所述第一拼接组合进行初次验证;所述初次验证用以验证所述第一拼接组合是否可成功展开;其中,成功展开是指拼接组合可展开,并且,展开后的形变小于形变阈值且维持对称性;
    响应于所述初次验证通过,对所述第一拼接组合进行二次验证;所述二次验证用以验证所述第一拼接组合展开后形成的UV岛的形状是否符合形状模板。
  10. 根据权利要求7所述的方法,其中,所述基于所述第一拼接组合的拼接结果,以及所述第一拼接组合包含的所述基础拼接单元各自对应的其他拼接组合,更新所述拼接组合序列中的所述拼接组合,包括:
    将所述其他拼接组合中的第一基础拼接单元替换为所述第一拼接组合的拼接结果;所述第一基础拼接单元是所述第一拼接组合包含的所述基础拼接单元。
  11. 根据权利要求1所述的方法,其中,所述优化能量的能量值,与所述拼接组合的几何属性和几何属性需求之间的符合程度成反相关。
  12. 根据权利要求1所述的方法,其中,所述对三维模型进行展开,获得所述三维模型的基础拼接单元集,包括:
    基于切割单元,对所述三维模型进行展开,获得UV岛集,所述UV岛集中包含所述三维模型的各个碎片化的UV岛;
    基于所述UV岛集进行预拼接以及重新展开,获得所述三维模型的基础拼接单元集。
  13. 根据权利要求12所述的方法,其中,所述基于所述UV岛集进行预拼接以及重新展开,获得所述三维模型的基础拼接单元集,包括:
    通过至少一种预拼接方式,对各个碎片化的所述UV岛进行预拼接以及重新展开,获得所述三维模型的基础拼接单元集;
    其中,至少一种所述预拼接方式包括平面预拼接,软边预拼接以及语义分割预拼接中的至少一种;所述平面预拼接用以指示通过邻域蔓延和平面拼接的方法进行拼接的方式;所述软边预拼接用以指示通过硬边对所述三维模型进行区域划分后,在各个区域内通过启发式搜索的方法进行拼接的方式;所述语义分割预拼接用以指示利用所述三维模型的几何语义特征对所述三维模型进行分解,获得语义分割区域,以在各个语义分割区域内进行拼接的方式。
  14. 根据权利要求13所述的方法,其中,响应于所述预拼接方式包含平面预拼接,软边预拼接以及语义分割预拼接中的至少两种,所述通过至少一种预拼接方式,对各个碎片化的所述UV岛进行预拼接以及重新展开,获得所述三维模型的基础拼接单元集,包括:
    按照各个所述预拼接方式的优先级,对碎片化的所述UV岛进行预拼接以及重新展开,获得所述基础拼接单元。
  15. 一种三维模型的展开装置,其中,所述装置包括:
    单元集获取模块,用于对所述三维模型进行展开,获得所述三维模型的基础拼接单元集;所述基础拼接单元集中包含基于所述三维模型的UV岛获得的各个基础拼接单元;
    序列构建模块,用于基于所述基础拼接单元集构建拼接组合序列;所述拼接组合序列中包含基于模型展开要求对各个所述基础拼接单元进行组合得到的各个拼接组合;所述模型展开要求包括基于模型设计需求制定的至少一种优化能量;所述优化能量用于指示所述拼接组合的几何属性;
    组合验证模块,用于对所述拼接组合序列中的各个所述拼接组合进行验证,获得所述基础拼接单元的拼接结果;
    结果生成模块,用于基于所述基础拼接单元的拼接结果,生成所述三维模型的展开结果。
  16. 根据权利要求15所述的装置,其中,所述序列构建模块,包括:
    穷举子模块,用于穷举基于所述各个基础拼接单元构建的基础拼接组合,获得基础拼接组合集;
    剪枝子模块,用于基于剪枝策略,对所述基础拼接组合集进行剪枝,获得各个优选拼接组合;
    序列构建子模块,用于基于各个所述优选拼接组合,构建所述拼接组合序列。
  17. 根据权利要求16所述的装置,其中,所述序列构建子模块,包括:
    能量值获取单元,用于获取各个所述优选拼接组合的优化能量值;所述优化能量值包含至少一种所述优化能量的能量值;
    顺序获取单元,用于基于各个所述优选拼接组合的所述优化能量值,获取各个所述优选拼接组合的验证顺序;
    序列构建单元,用于基于各个所述优选拼接组合的所述验证顺序,构建所述拼接组合序列。
  18. 根据权利要求15所述的装置,其中,所述组合验证模块,用于基于所述拼接组合序列执行至少一次组合验证过程,直至所述拼接组合序列为空,获得所述基础拼接单元的拼接结果;
    其中,所述组合验证模块,包括:
    组合验证子模块,用于对所述拼接组合序列中,处于序列首位的第一拼接组合进行验证;
    单元拼接子模块,用于响应于所述第一拼接组合验证通过,对所述第一拼接组合包含的所述基础拼接单元进行拼接,获得所述第一拼接组合的拼接结果,并删除所述拼接组合序列中的所述第一拼接组合;
    组合更新子模块,用于基于所述第一拼接组合的拼接结果,以及所述第一拼接组合包含的所述基础拼接单元各自对应的其他拼接组合,更新所述拼接组合序列中的所述拼接组合;响应于所述第一拼接组合验证不通过,将所述第一拼接组合从所述拼接组合序列中删除。
  19. 一种计算机设备,其中,所述计算机设备包括处理器和存储器,所述存储器存储有至少一条计算机程序,所述至少一条计算机程序由所述处理器加载并执行以实现如权利要求1至14任一所述的三维模型的展开方法。
  20. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有至少一条计算机程序,所述计算机程序由处理器加载并执行以实现如权利要求1至14任一所述的三维模型的展开方法。
PCT/CN2023/079872 2022-04-13 2023-03-06 三维模型的展开方法、装置、设备及存储介质 WO2023197779A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210382385.7 2022-04-13
CN202210382385.7A CN114494668B (zh) 2022-04-13 2022-04-13 三维模型的展开方法、装置、设备及存储介质

Publications (2)

Publication Number Publication Date
WO2023197779A1 WO2023197779A1 (zh) 2023-10-19
WO2023197779A9 true WO2023197779A9 (zh) 2024-01-04

Family

ID=81488851

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/079872 WO2023197779A1 (zh) 2022-04-13 2023-03-06 三维模型的展开方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114494668B (zh)
WO (1) WO2023197779A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114494668B (zh) * 2022-04-13 2022-07-15 腾讯科技(深圳)有限公司 三维模型的展开方法、装置、设备及存储介质
CN115294258B (zh) * 2022-09-26 2022-12-23 腾讯科技(深圳)有限公司 三维模型的展开方法、装置、设备及计算机可读存储介质
CN115329615B (zh) * 2022-10-18 2023-02-10 北京名洋数字科技股份有限公司 基于数据库预存展品自动投影模型系统及方法

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4754005B2 (ja) * 2009-03-12 2011-08-24 任天堂株式会社 ゲームプログラムおよびゲーム装置
JP5497617B2 (ja) * 2010-11-16 2014-05-21 住友重機械工業株式会社 画像生成装置及び操作支援システム
US9191648B2 (en) * 2011-02-22 2015-11-17 3M Innovative Properties Company Hybrid stitching
EP3343506A1 (en) * 2016-12-28 2018-07-04 Thomson Licensing Method and device for joint segmentation and 3d reconstruction of a scene
CN106647211A (zh) * 2017-01-19 2017-05-10 中国人民解放军装甲兵工程学院 合成全息体视图的视角图片分割重组打印方法
US10628997B2 (en) * 2017-08-24 2020-04-21 Emilio Santos Method for generating three-dimensional models from constrained sketches and an instruction set
CN112569574B (zh) * 2019-09-30 2024-03-19 超级魔方(北京)科技有限公司 一种模型拆解方法、装置、电子设备及可读存储介质
CN111681317B (zh) * 2020-03-31 2023-03-17 腾讯科技(深圳)有限公司 数据处理方法、装置、电子设备及存储介质
US11900537B2 (en) * 2020-05-25 2024-02-13 Technologies Shapeshift 3D Inc. Method and device for constraining shape deformation of 3D objects
CN112085840B (zh) * 2020-09-17 2024-03-29 腾讯科技(深圳)有限公司 语义分割方法、装置、设备及计算机可读存储介质
CN112288856B (zh) * 2020-10-29 2024-02-27 陕西科技大学 一种三维碎片拼接重构方法、系统、设备及存储介质
CN112884870B (zh) * 2021-02-26 2024-07-12 深圳市商汤科技有限公司 一种三维模型的展开方法、电子设备以及计算机存储介质
CN112926122A (zh) * 2021-03-16 2021-06-08 重庆电子工程职业学院 基于bim技术的预装三维效果图的建筑施工预拼装方法
CN113989293A (zh) * 2021-10-29 2022-01-28 上海商汤智能科技有限公司 图像分割方法及相关模型的训练方法和装置、设备
CN114494668B (zh) * 2022-04-13 2022-07-15 腾讯科技(深圳)有限公司 三维模型的展开方法、装置、设备及存储介质

Also Published As

Publication number Publication date
WO2023197779A1 (zh) 2023-10-19
CN114494668A (zh) 2022-05-13
CN114494668B (zh) 2022-07-15

Similar Documents

Publication Publication Date Title
WO2023197779A9 (zh) 三维模型的展开方法、装置、设备及存储介质
CN111008422B (zh) 一种建筑物实景地图制作方法及系统
CN110543716B (zh) 三维架空电缆层级电网优化方法、装置和计算机设备
CN115294258B (zh) 三维模型的展开方法、装置、设备及计算机可读存储介质
WO2023193523A1 (zh) 一种模型展开方法、装置、电子设备、计算机可读存储介质及计算机程序产品
CN112347546A (zh) 基于轻量级设备的bim渲染方法、设备和计算机可读存储介质
Peng et al. Exploring quadrangulations
WO2022166681A1 (zh) 一种虚拟场景生成方法、装置、设备和存储介质
CN111918298B (zh) 基于聚类的站点规划方法、装置、电子设备和存储介质
WO2024037236A1 (zh) 路口面的生成方法、装置、设备、存储介质和程序产品
US20240062469A1 (en) Data processing method, apparatus, device, and medium
Laycock et al. Automatically generating large urban environments based on the footprint data of buildings
CN104658033A (zh) 多光源下的全局光照绘制方法及装置
CN113724279B (zh) 路网自动划分交通小区的系统、方法、设备及存储介质
WO2024051498A1 (zh) 多边形修正及生成方法、装置、电子设备及计算机可读存储介质
US20240212285A1 (en) Processing three-dimensional model based only on visible model region
WO2022161319A1 (zh) 一种阴影贴图的处理方法、装置、设备及计算机可读存储介质、程序产品
CN115222806A (zh) 多边形处理方法、装置、设备及计算机可读存储介质
She et al. 3D building model simplification method considering both model mesh and building structure
CN115830255B (zh) 一种仿真场景生成方法、装置、电子设备和存储介质
CN115131526B (zh) 一种自动化综合制图方法及系统
CN103745072A (zh) 自动扩展缺陷图形库的方法
CN114491841A (zh) 一种基于nx二次开发与图神经网络的加工特征识别方法
Taghavi Automatic 2D abstraction and hexahedral meshing by sorting a Delaunay mesh
CN115115806B (zh) 一种基于单基元解析的屋顶参数化重构方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23787427

Country of ref document: EP

Kind code of ref document: A1