Overlay detection method and device, computer program product and electronic equipment
By performing UV expansion and triangular surface overlap detection on the virtual model, the problems of low accuracy and efficiency of UV overlap detection are solved, and high-precision and efficient UV overlap detection are achieved.
Patent Information
- Application Number
- CN202510593228.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-12
AI Technical Summary
In the prior art, UV overlap detection accuracy and efficiency are low, making it difficult to meet high-precision requirements, especially when dealing with complex large scenarios, the efficiency is significantly reduced.
By UV expansion of the virtual model, the polygonal faces are divided into triangle faces, the potential overlap range of the triangle faces in each coordinate dimension is determined, and the triangle overlap detection is performed, and the possible overlapping faces are screened out for further detection.
Improve the accuracy and efficiency of UV overlap detection, reduce human error, and reduce server processing overhead.
Smart Images

Figure CN120471880A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an overlap detection method, an overlap detection device, a computer program product, and an electronic device. Background Art
[0002] In the process of animation and game production, with the improvement of hardware and software efficiency, more and more sophisticated models are produced and used. In the process of UV mapping of the models, UV overlap may occur, resulting in model mapping misalignment, and then unnecessary visual errors, affecting the user experience.
[0003] Related technologies rely on software visual displays, such as the operating interface and rendering output, to determine whether UV overlap occurs. This is not only time-consuming but also significantly reduces efficiency when processing complex and large scenes. In addition, some existing UV detection tools identify overlapping UVs based on the user-selected model surface, which makes it difficult to meet the requirements of high-precision detection.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0005] The present disclosure provides an overlap detection method, an overlap detection device, a computer program product, and an electronic device, which at least to some extent solve the problems of low UV overlap detection accuracy and efficiency in related technologies.
[0006] According to a first aspect of the present disclosure, there is provided an overlap detection method, characterized in that the method includes: performing UV unfolding on a virtual model to be detected to obtain polygonal patches corresponding to each model surface of the virtual model, and dividing the polygonal patches corresponding to each model surface of the virtual model into triangular patches; determining the potential overlapping range of each triangular patch in each coordinate dimension, and determining the overlap detection patch corresponding to each triangular patch based on the potential overlapping range of each triangular patch in each coordinate dimension; wherein the range endpoints of the potential overlapping range of the overlap detection patch in the target coordinate dimension are located within the potential overlapping range of the corresponding triangular patch in the target coordinate dimension, and the target coordinate dimension is one of the coordinate dimensions; performing triangle overlap detection on each triangular patch and the overlap detection patch corresponding to each triangular patch to obtain a triangle overlap detection result of each triangular patch, and determining the overlap detection result of the polygonal patch corresponding to each model surface of the virtual model based on the triangle overlap detection result of each triangular patch.
[0007] According to a second aspect of the present disclosure, an overlap detection device is provided, characterized in that the device includes: a UV unfolding module, configured to perform UV unfolding on a virtual model to be detected, obtain polygonal facets corresponding to each model surface of the virtual model, and divide the polygonal facets corresponding to each model surface of the virtual model into triangular facets; a facet determination module, configured to determine the potential overlapping range of each triangular facet in each coordinate dimension, and determine the overlap detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension; wherein the range endpoints of the potential overlapping range of the overlap detection facet in the target coordinate dimension are located within the potential overlapping range of the corresponding triangular facet in the target coordinate dimension, and the target coordinate dimension is one of the coordinate dimensions; an overlap detection module, configured to perform triangle overlap detection on each triangular facet with the overlap detection facet corresponding to each triangular facet, obtain triangle overlap detection results of each triangular facet, and determine the overlap detection results of the polygonal facets corresponding to each model surface of the virtual model based on the triangle overlap detection results of each triangular facet.
[0008] According to a third aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the overlap detection method of the first aspect and possible implementation manners thereof are implemented.
[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the overlap detection method of the first aspect and its possible implementation method by executing the executable instructions.
[0010] The technical solution disclosed in this disclosure has the following beneficial effects:
[0011] During the above-mentioned overlap detection process, UV unfolding is performed on the virtual model to be detected to obtain polygonal patches corresponding to each model surface of the virtual model, and the polygonal patches corresponding to each model surface of the virtual model are divided into triangular patches; the potential overlap range of each triangular patch in each coordinate dimension is determined, and based on the potential overlap range of each triangular patch in each coordinate dimension, the overlap detection patch corresponding to each triangular patch is determined; wherein, the range endpoints of the potential overlap range of the overlap detection patch in the target coordinate dimension are located within the potential overlap range of the corresponding triangular patch in the target coordinate dimension, and the target coordinate dimension is one of the coordinate dimensions; triangle overlap detection is performed on each triangular patch and the overlap detection patch corresponding to each triangular patch to obtain the triangle overlap detection results of each triangular patch, and based on the triangle overlap detection results of each triangular patch, the overlap detection results of the polygonal patches corresponding to each model surface of the virtual model are determined. In the present disclosure, by determining the potential overlapping range of each triangular facet in each coordinate dimension, and determining the overlapping detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension, the possible overlapping triangular facets (i.e., overlapping detection facets) can be preliminarily screened out, and further overlapping detection is performed on these possible overlapping triangular facets to obtain information on overlapping UVs of objects. This can not only reduce errors caused by human factors and ensure detection accuracy, but also optimize the amount of overlapping detection tasks, improve overlapping detection efficiency, and reduce server processing overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 A flowchart of an overlap detection method provided by one of the embodiments of the present disclosure is shown;
[0013] Figure 2A A schematic diagram illustrating unfolding a virtual model into a two-dimensional plane provided by one of the embodiments of the present disclosure is shown;
[0014] Figure 2B A schematic diagram illustrating encoding of various faces of a virtual model provided by one of the embodiments of the present disclosure is shown;
[0015] Figure 2C A schematic diagram showing triangulation of polygonal facets provided by one of the embodiments of the present disclosure is shown;
[0016] Figure 2D A schematic diagram illustrating encoding of triangular facets provided by one of the embodiments of the present disclosure is shown;
[0017] Figure 3 A flowchart of determining the potential overlap range of each triangular facet in each coordinate dimension provided by one of the embodiments of the present disclosure is shown;
[0018] Figure 4A schematic diagram illustrating determining the upper and lower limits of a range of a to-be-processed face in different coordinate dimensions provided by one of the embodiments of the present disclosure is shown;
[0019] Figure 5 A schematic diagram illustrating range endpoint sorting provided by one of the embodiments of the present disclosure;
[0020] Figure 6 A schematic diagram showing coverage of candidate detection patch sets of different coordinate dimensions provided by one of the embodiments of the present disclosure is shown;
[0021] Figure 7 A flowchart of traversing a set of overlapping detection patches of a patch to be processed provided by one of the embodiments of the present disclosure is shown;
[0022] Figure 8 A schematic diagram showing a data structure for UV overlap detection of a virtual object according to an embodiment of the present disclosure;
[0023] Figure 9 A structural block diagram of an overlap detection device according to one embodiment of the present disclosure is shown;
[0024] Figure 10 An electronic device for implementing the above-mentioned overlap detection method according to one of the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0025] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.
[0026] The accompanying drawings are schematic illustrations of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the description below, many specific details are provided to provide a full description of the embodiments of the present disclosure. However, those skilled in the art will appreciate that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or that other methods, components, devices, steps, etc. may be used to replace one or more specific details.
[0027] Related technologies rely on software visual displays, such as the operating interface and rendering output, to determine whether UV overlap occurs. This is not only time-consuming but also significantly reduces efficiency when processing complex and large scenes. In addition, some existing UV detection tools identify overlapping UVs based on the user-selected model surface, which makes it difficult to meet the requirements of high-precision detection.
[0028] In view of one or more of the above problems, exemplary embodiments of the present disclosure provide an overlap detection method, overlap detection apparatus, computer program product, and electronic device. The overlap detection method can be deployed on a user terminal and applied to model UV overlap detection scenarios to assist users in animation or game production.
[0029] In an optional embodiment, referring to Figure 1 As shown, a flowchart of an overlap detection method is provided, which specifically includes the following steps S110 to S130:
[0030] Step S110: UV unfolding is performed on the virtual model to be inspected to obtain polygonal patches corresponding to each surface of the virtual model, and the polygonal patches corresponding to each surface of the virtual model are divided into triangular patches;
[0031] Step S120: determining the potential overlapping range of each triangular face in each coordinate dimension, and determining the overlap detection face corresponding to each triangular face based on the potential overlapping range of each triangular face in each coordinate dimension; wherein the range endpoints of the potential overlapping range of the overlap detection face in the target coordinate dimension are located within the potential overlapping range of the corresponding triangular face in the target coordinate dimension, where the target coordinate dimension is one of the coordinate dimensions;
[0032] Step S130, performing triangle overlap detection on each triangular facet and the overlap detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, and determining the overlap detection result of the polygonal facets corresponding to each model surface of the virtual model based on the triangle overlap detection result of each triangular facet.
[0033] Figure 1 In the method shown, by determining the potential overlapping range of each triangular facet in each coordinate dimension, and determining the overlapping detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension, the possible overlapping triangular facets (i.e., overlapping detection facets) can be preliminarily screened out, and further overlap detection is performed on these possible overlapping triangular facets to obtain information on overlapping UVs of the object. This can not only reduce errors caused by human factors and ensure detection accuracy, but also optimize the amount of overlapping detection tasks, improve overlap detection efficiency, and reduce server processing overhead.
[0034] Below Figure 1 Provide detailed instructions for each step.
[0035] In step S110 , UV unfolding is performed on the virtual model to be detected to obtain polygonal patches corresponding to each surface of the virtual model, and the polygonal patches corresponding to each surface of the virtual model are divided into triangular patches.
[0036] The virtual model may be a three-dimensional model with one or more faces produced by animation production software, and the present disclosure does not specifically limit its shape and size.
[0037] Among them, UV unfolding is the process of mapping the surface of a three-dimensional model to a two-dimensional plane. UV unfolding a virtual model can obtain a two-dimensional plane layout of the model. Each surface of the model can be unfolded into a series of polygonal patches, for example, Figure 2A As shown, a schematic diagram of unfolding a virtual model into a two-dimensional plane is provided.
[0038] Optionally, in order to facilitate the distinction between the various polygonal faces of the virtual model, the various polygonal faces of the virtual model may be numbered separately. For example, Figure 2B , provides a schematic diagram for encoding each face of a virtual model. Specifically, each polygonal face of the virtual model can be encoded sequentially starting from 0 to obtain a list of serial numbers for all polygonal faces of the virtual object, for example, FacesIdList(obj) = [0, 1, 2, ...], where FacesIdList(obj) is used to represent a list of serial numbers for all polygonal faces of the virtual object obj, and [0, 1, 2, ...] records the serial numbers of each polygonal face of the virtual object obj.
[0039] After obtaining the polygonal patches corresponding to the surfaces of each model of the virtual model, these polygonal patches can be converted into triangular patches. For example, the polygonal patches can be triangulated by using the existing function provided by the animation production software, that is, the function that inputs a polygon and outputs the triangles composed of it. This disclosure does not specifically limit this. Figure 2C As shown, a schematic diagram of triangulating polygonal patches is provided, wherein each polygonal patch may be composed of one or more triangular patches.
[0040] Optionally, in order to distinguish the triangular facets, the triangular facets can be numbered separately. For example, Figure 2DAs shown, a schematic diagram of encoding each triangular facet is provided. Specifically, each triangular facet can be encoded sequentially starting from 0 to obtain a dictionary TriFaceInfo of the correspondence between the serial number of each triangular facet and the serial number of the polygonal facet to which it belongs. For example, TriFaceInfo(obj) = {0:0, 1:0, 2:0, 3:1, 4:2, 5:2}, TriFaceInfo(obj) is used to represent the correspondence dictionary between the serial number of each triangular facet of the virtual object obj and the serial number of the polygonal facet to which it belongs, {0:0, 1:0, 2:0, 3:1, 4:2, 5:2} means that triangular facet No. 0 belongs to polygonal facet No. 0, triangular facet No. 1 belongs to polygonal facet No. 0, triangular facet No. 2 belongs to polygonal facet No. 0, triangular facet No. 3 belongs to polygonal facet No. 1, triangular facet No. 4 belongs to polygonal facet No. 2, and triangular facet No. 5 belongs to polygonal facet No. 2.
[0041] For example, all polygonal patches of the virtual object obj are polled, and the serial numbers of the polygonal patches are represented by FaceId, starting from 0. The number of triangles that can be converted from the polygonal patch is obtained, and the serial numbers of the triangle patches are represented by TriId, starting from 0. TriFaceInfo(obj) is generated, where the initial values of FaceId and TriId are 0. For example, if a polygonal patch can be converted into 3 triangles, then TriId+0, TriId+1, and TriId+2 all correspond to the FaceId of the polygonal patch, and TriId is set to TriId+3=0+3=3, and the next polygonal patch is queried.
[0042] In step S120, the potential overlapping range of each triangular facet in each coordinate dimension is determined, and the overlapping detection facet corresponding to each triangular facet is determined based on the potential overlapping range of each triangular facet in each coordinate dimension; wherein the range endpoints of the potential overlapping range of the overlapping detection facet in the target coordinate dimension are located within the potential overlapping range of the corresponding triangular facet in the target coordinate dimension, and the target coordinate dimension is one of the coordinate dimensions.
[0043] The potential overlap range refers to the area where triangle faces may overlap in the UV space, and may include the upper and lower limits of the range corresponding to each coordinate dimension.
[0044] Specifically, the potential overlapping range in each coordinate dimension may be determined according to the vertex coordinates of each triangular facet.
[0045] Exemplarily, the range occupied by the target circle surrounding the triangular face in each coordinate dimension can be determined as the potential overlapping range of the corresponding triangular face in each coordinate dimension, where the target circle has the midpoint of the triangular face as the center and the maximum distance from the midpoint to the vertex of the triangular face as the radius.
[0046] In an optional embodiment, in step S120, the potential overlapping range of each triangular facet in each coordinate dimension is determined, such as Figure 3 As shown, this can be achieved by following the steps below:
[0047] Step S310, obtaining the vertex coordinates of each triangular facet, and determining the midpoint coordinates of each triangular facet according to the vertex coordinates of each triangular facet;
[0048] Step S320 : determining the potential overlapping range of each triangular facet in each coordinate dimension according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet.
[0049] Figure 3 In the steps shown, the potential overlapping range of the triangular facets in each coordinate dimension is obtained through coordinate query and calculation processing, which is simple and easy to implement.
[0050] Specifically, in step S310, the vertex coordinates of each triangular facet are obtained, and the midpoint coordinates of each triangular facet are determined according to the vertex coordinates of each triangular facet.
[0051] Among them, the vertex coordinates of the triangle patch refer to the vertex UV coordinate values, which can be represented by the uvPs parameter. The corresponding data format can be, for example, [(0.1, 0.2), (0.2, 0.3), (0.2, 0.5)].
[0052] For example, in order to clarify the vertices corresponding to each triangular patch, UvIds data of the triangular patch may be constructed to record the vertices corresponding to the triangular patch.
[0053] For example, in order to facilitate the search for vertex coordinates, an association dictionary can be established in advance between the vertex serial number of the triangle patch and the vertex UV coordinate value. For example, idPInfo = {0: (0.1, 0.2), 2: (0.2, 0.3), 5 (0.2, 0.5)}, which means that the triangle patch contains vertices 0, 2, and 5, and the coordinate value of vertex 0 is (0.1, 0.2), the coordinate value of vertex 2 is (0.2, 0.3), and the coordinate value of vertex 5 is (0.2, 0.5). idPInfo represents the association dictionary between the vertex serial number and the vertex UV coordinate value.
[0054] Optionally, when generating UVs for a virtual model, you can construct a U value list and a V value list based on vertex sequence numbers. Since some triangles may share points, you can quickly retrieve the UV coordinates corresponding to the same vertices in different triangles from the U value list and V value list based on vertex sequence numbers to speed up processing.
[0055] In an optional embodiment, the vertex coordinates of each triangular facet are obtained in step S310, and the midpoint coordinates of each triangular facet are determined based on the vertex coordinates of each triangular facet. This can be achieved by the following steps: obtaining the vertex coordinates of the facet to be processed; the facet to be processed is any facet among the triangular faces; based on the vertex coordinates of the facet to be processed, determining the coordinate mean of the three vertices of the facet to be processed in each coordinate dimension; based on the coordinate mean of the three vertices of the facet to be processed in each coordinate dimension, determining the midpoint coordinates of the facet to be processed.
[0056] For example, each triangular facet may be traversed and each triangular facet may be used as a facet to be processed.
[0057] Exemplarily, the coordinate value of the midpoint of the surface to be processed can be determined by the average value of the coordinates of the three vertices of the surface to be processed, which is simple to operate and easy to implement. Exemplarily, the midpoint coordinate values (Bc1, Bc2) can be obtained by calculating Bc1=(a1+b1+c1) / 3, Bc2=(a2+b2+c2) / 3, wherein a1, b1, c1 respectively represent the coordinate values of the vertices a, b, and c of the surface to be processed in the first coordinate dimension, a2, b2, c2 respectively represent the coordinate values of the vertices a, b, and c of the surface to be processed in the second coordinate dimension, Bc1 represents the coordinate value of the midpoint of the surface to be processed in the first coordinate dimension, and Bc2 represents the coordinate value of the midpoint of the surface to be processed in the second coordinate dimension.
[0058] By determining the midpoint coordinates of the triangular facets, data assistance is provided to further determine the potential overlapping range of each triangular facet in each coordinate dimension, and the range area is represented from the data level.
[0059] Specifically, in step S320 , the potential overlapping range of each triangular facet in each coordinate dimension is determined according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet.
[0060] In an optional embodiment, in step S320, the potential overlapping range of each triangular facet in each coordinate dimension is determined based on the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet. This can be achieved by the following steps: determining the distance between the midpoint and the vertex of each triangular facet based on the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet; determining the potential overlapping range of each triangular facet in each coordinate dimension based on the midpoint coordinates of each triangular facet and the distance between the midpoint and the vertex of each triangular facet.
[0061] Specifically, the distance between the midpoint of the corresponding triangular facet and its vertices can be determined based on the vertex coordinates of the triangular facet and the midpoint coordinates of the triangular facet, and the potential overlapping range of the triangular facet in each coordinate dimension can be determined based on the midpoint coordinates of the triangular facet and the distance between the midpoint and the vertices.
[0062] Exemplarily, the target circle of the triangular patch can be determined with the midpoint of the triangular patch as the center and the maximum distance between the midpoint of the triangular patch and the vertex as the radius, so that the range occupied by the target circle surrounding the triangular patch in each coordinate dimension can be determined as the potential overlapping range of the corresponding triangular patch in each coordinate dimension.
[0063] Exemplarily, the midpoint of the triangular patch can be used as the center of the circle, and the maximum distance between the midpoint of the triangular patch and the vertex increased by a preset distance can be used as the radius to determine the target circle of the triangular patch, so that the range occupied by the target circle surrounding the triangular patch in each coordinate dimension can be determined as the potential overlapping range of the corresponding triangular patch in each coordinate dimension, so as to increase the redundant detection range and avoid omissions.
[0064] In an optional embodiment, the above-mentioned determination of the potential overlapping range of each triangular facet in each coordinate dimension based on the coordinates of the midpoint of each triangular facet and the distance between the midpoint of each triangular facet and the vertex can be achieved by the following steps: comparing the distance between the midpoint of the facet to be processed and each vertex of the facet to be processed to determine the maximum distance between the midpoint of the facet to be processed and the vertex; the facet to be processed is any facet among the triangular facets; adding the coordinate value of the midpoint of the facet to be processed in each coordinate dimension to the maximum distance between the midpoint of the facet to be processed and the vertex to obtain the upper limit of the range of the facet to be processed in each coordinate dimension; subtracting the coordinate value of the midpoint of the facet to be processed in each coordinate dimension from the maximum distance between the midpoint of the facet to be processed and the vertex to obtain the lower limit of the range of the facet to be processed in each coordinate dimension; and determining the potential overlapping range of the facet to be processed in each coordinate dimension based on the upper limit and lower limit of the range of the facet to be processed in each coordinate dimension.
[0065] Specifically, after determining the maximum distance between the midpoint of the face to be processed and each vertex of the face to be processed through distance comparison processing, the coordinate value of the midpoint of the face to be processed in each coordinate dimension can be added to the maximum distance respectively to obtain the upper limit of the range of the face to be processed in each coordinate dimension, for example, MaxTriDist1=Bc1+Dist, MaxTriDist2=Bc2+Dist; the coordinate value of the midpoint of the face to be processed in each coordinate dimension can be subtracted from the maximum distance respectively to obtain the lower limit of the range of the face to be processed in each coordinate dimension, for example, MinTriDist1=Bc1-Dist, MinTriDist2=Bc2-Dist. Among them, Dist represents the maximum distance between the midpoint of the face to be processed and each vertex of the face to be processed, MaxTriDist1 represents the upper limit of the range of the face to be processed in the first coordinate dimension, MaxTriDist2 represents the upper limit of the range of the face to be processed in the second coordinate dimension, MinTriDist1 represents the lower limit of the range of the face to be processed in the first coordinate dimension, MinTriDist2 represents the lower limit of the range of the face to be processed in the second coordinate dimension, Bc1 represents the coordinate component of the midpoint Bc of the face to be processed in the first coordinate dimension, and Bc2 represents the coordinate component of the midpoint Bc of the face to be processed in the second coordinate dimension. Figure 4 As shown, a schematic diagram is provided for determining the upper limit and lower limit of the range of the face to be processed in different coordinate dimensions.
[0066] Exemplarily, the coordinate values of the midpoint of the face to be processed in each coordinate dimension can be added to the maximum distance and preset distance between the midpoint of the face to be processed and the vertex to obtain the upper limit of the range of the face to be processed in each coordinate dimension; the coordinate values of the midpoint of the face to be processed in each coordinate dimension can be subtracted from the maximum distance and preset distance between the midpoint of the face to be processed and the vertex to obtain the lower limit of the range of the face to be processed in each coordinate dimension, so as to increase the redundant detection range and avoid omissions.
[0067] After determining the upper and lower limits of the range of the face to be processed in each coordinate dimension, the potential overlap range of the face to be processed in each coordinate dimension can be obtained based on the upper and lower limits of the range of the face to be processed in each coordinate dimension. For example, the potential overlap range of the first coordinate dimension is [MinTriDist1, MaxTriDist1], and the potential overlap range of the second coordinate dimension is [MinTriDist2, MaxTriDist2]. This allows for further coarse screening of faces from each triangular facet that potentially overlap with the face to be processed, i.e., the overlap detection faces of the face to be processed, thereby reducing the overlap detection workload.
[0068] In an optional embodiment, the potential overlapping range includes an upper range limit and a lower range limit. In step S120, the overlapping detection facets corresponding to each triangular facet are determined based on the potential overlapping range of each triangular facet in each coordinate dimension. This can be achieved by the following steps: for each coordinate dimension, the range endpoints corresponding to the potential overlapping range of each triangular facet are sorted to obtain the sorting results corresponding to each coordinate dimension; the range endpoints include an upper range limit and a lower range limit; based on the sorting results corresponding to each coordinate dimension, the candidate detection facet set corresponding to each triangular facet in each coordinate dimension is determined; the candidate detection facet set includes triangular faces whose range endpoints are arranged between the upper range limit and the lower range limit of the corresponding triangular facet; based on the candidate detection facet set corresponding to each triangular facet in each coordinate dimension, the overlapping detection facet corresponding to each triangular facet is determined.
[0069] For example, to facilitate program analysis, a range data structure for the face to be processed can be constructed in each coordinate dimension based on the serial number of the face to be processed and the upper and lower limits of the range in each coordinate dimension. For example, the range data structure TriRange1 for the face to be processed in the first coordinate dimension includes [MinTriDist1, CurrentTriId] and [MaxTriDist1, CurrentTriId]; the range data structure TriRange2 for the face to be processed in the second coordinate dimension includes [MinTriDist2, CurrentTriId] and [MaxTriDist2, CurrentTriId], where CurrentTriId represents the serial number of the face to be processed.
[0070] For example, the potential overlapping ranges of all triangular facets in the first coordinate dimension can be formed into a list TriRangeList1; the potential overlapping ranges of all triangular facets in the second coordinate dimension can be formed into a list TriRangeList2 for future use. It should be noted that the terms first coordinate dimension and second coordinate dimension in this disclosure are used to distinguish different coordinate dimensions in UV space.
[0071] For example, when sorting, the potential overlapping range TriRange1 of each triangular face in TriRangeList1 in the first coordinate dimension can be sorted according to the range endpoint value; the potential overlapping range TriRange2 of each triangular face in TriRangeList2 in the second coordinate dimension can be sorted according to the range endpoint value to obtain the sorting results corresponding to each coordinate dimension.
[0072] After obtaining the sorting results corresponding to each coordinate dimension, the candidate detection facet set corresponding to each triangular facet in each coordinate dimension can be determined based on the sorting results corresponding to each coordinate dimension. Among them, the facets in the candidate detection facet set are facets that may overlap after coarse screening of other triangular facets based on the potential overlapping range of the corresponding triangular facets in the corresponding coordinate dimension. Specifically, the triangular facets arranged between the upper limit and the lower limit of the range of the first coordinate dimension of the triangular facet to be processed among other triangular facets can be added to the candidate detection facet set of the first coordinate dimension of the triangular facet to be processed; the triangular facets arranged between the upper limit and the lower limit of the range of the second coordinate dimension of the triangular facet to be processed among other triangular facets can be added to the candidate detection facet set of the second coordinate dimension of the triangular facet to be processed.
[0073] For example, taking the first coordinate dimension as an example, the sorted TriRangeList1 is [[0.1,10],[0.2,11],[0.25,12],[0.27,11],[0.3,10]], where the first element in the inner [] is the range endpoint, and the second element is the serial number of the corresponding triangle face. By polling the sorted TriRangeList1, the serial numbers with the same second element in the inner [] can be recorded. For example, the serial numbers arranged at the 1st and 5th positions are the same, both corresponding to triangle face No. 10, and the serial numbers arranged at the 2nd and 4th positions are the same, both corresponding to triangle face No. 11. Among them, triangle face No. 10 spans triangle face No. 11 and No. 12. Triangle face No. 11 and No. 12 are patches that may overlap with triangle face No. 10. At this time, triangle face No. 11 and No. 12 can be added to the candidate detection face set of triangle face No. 10 in the first coordinate dimension. Among them, triangle patch No. 11 spans triangle patch No. 12, and triangle patch No. 12 may overlap with triangle patch No. 11. At this time, triangle patch No. 12 can be added to the candidate detection patch set of triangle patch No. 11 in the first coordinate dimension.
[0074] For example, Figure 5As shown, taking the first coordinate dimension as an example, the sorted TriRangeList1 is [[MinTriDist1_4,4],[MinTriDist1_2,2],[MinTriDist1_1,1],[MaxTriDist1_1,1],[MinTriDist1_0,0],[MinTriDist1_3,3],[MaxTriDist1_0,0],[MaxTriDist1_4,4],[MaxTriDist1_2,2],MaxTriDist1_3,3]], where the first element in [] is the range endpoint, and the second element is the triangle face serial number that matches the corresponding range endpoint. Among them, MinTriDist1_4, MinTriDist1_2, MinTriDist1_1, MaxTriDist1_1, MinTriDist1_0, MinTriDist1_3, MaxTriDist1_0, MaxTriDist1_4, MaxTriDist1_2, and MaxTriDist1_3 are the range endpoints sorted from small to large. When the to-be-processed facet is triangle facet 4, the triangle faces arranged between the upper and lower limits of the range of triangle facet 4 include triangle faces 2, 1, 0, and 3. In this case, triangle facet 4 may overlap with triangle faces 2, 1, 0, and 3. In this case, the sequence numbers of triangle faces 2, 1, 0, and 3 can be added to the candidate detection facet set of triangle facet 4 in the first coordinate dimension. When the face to be processed is triangle face No. 2, the triangle faces arranged between the upper and lower limits of the range of triangle face No. 2 include triangle faces No. 1, 0, 3, and 4. At this time, triangle face No. 2 may overlap with triangle faces No. 1, 0, 3, and 4. The serial numbers of triangle faces No. 1, 0, 3, and 4 can be added to the candidate detection face set of triangle face No. 2 in the first coordinate dimension.
[0075] By polling each coordinate dimension separately, the candidate detection facet set corresponding to each triangular facet in each coordinate dimension can be obtained. For example, the candidate detection facet set overlapTriIds1 corresponding to the first coordinate dimension of the facet to be processed and the candidate detection facet set overlapTriIds2 corresponding to the second coordinate dimension can be obtained. Figure 6As shown, a coverage diagram of a set of candidate detection facets of different coordinate dimensions is provided, wherein the triangles covered by the thick solid frame may represent triangular facets that may overlap with the facet to be processed, as determined based on the TriRangeList1 corresponding to the first coordinate dimension; the triangles covered by the thick dotted frame may represent triangular facets that may overlap with the triangle to be processed, as determined based on the TriRangeList2 corresponding to the second coordinate dimension, wherein the dark triangle represents the facet to be processed.
[0076] Optionally, in order to facilitate program identification processing, the serial number of the to-be-processed patch and the candidate detection patch set of the corresponding to-be-processed patch in each coordinate dimension may be represented in the form of a key-value pair.
[0077] After determining the candidate detection patch sets corresponding to each triangular patch in each coordinate dimension, the overlapping detection patches corresponding to each triangular patch can be determined based on the candidate detection patch sets corresponding to each triangular patch in each coordinate dimension.
[0078] Exemplarily, a patch in a candidate detection patch set corresponding to the patch to be processed in each coordinate dimension may be determined as an overlapping detection patch corresponding to the patch to be processed.
[0079] For example, the intersection of the patch to be processed and the patches in the candidate detection patch set corresponding to each coordinate dimension may be taken to obtain the overlapping detection patches corresponding to the patch to be processed.
[0080] By sorting the range endpoints, we can roughly screen out the faces that may overlap with each triangle face, namely the overlapping detection faces, which can avoid a large number of redundant overlapping detections to a certain extent.
[0081] In an optional embodiment, the above-mentioned determination of the overlapping detection patch corresponding to each triangular facet based on the candidate detection patch set corresponding to each triangular facet in each coordinate dimension can be achieved by the following steps: merging the candidate detection patch set corresponding to each triangular facet in each coordinate dimension to obtain the overlapping detection patch set of each triangular facet; determining the overlapping detection patch corresponding to each triangular facet based on the overlapping detection patch set of each triangular facet.
[0082] For example, each triangular facet can be traversed and treated as a facet to be processed respectively, and the intersection of the candidate detection facet sets corresponding to the facet to be processed in each coordinate dimension can be taken to obtain the overlapping detection facet set of the facet to be processed, and the faces in the overlapping detection facet set of the facet to be processed can be determined as overlapping detection faces, so as to further reduce the workload of overlapping detection and alleviate the overlapping detection overhead of the server.
[0083] Optionally, to facilitate program processing, the serial number of each triangular face and its candidate detection face set overlapTriIds1 in the first coordinate dimension can be represented in the form of a key-value pair to form a relational dictionary idOverlapInfo1; the serial number of each triangular face and its candidate detection face set overlapTriIds2 in the second coordinate dimension can be represented in the form of a key-value pair to form a relational dictionary idOverlapInfo2.
[0084] For example, the serial number CurrentTriId of the face to be processed and the candidate detection face set overlapTriIds1 of the face to be processed in the first coordinate dimension can be determined by traversing the relational dictionary idOverlapInfo1, and the candidate detection face set overlapTriIds2 of the face to be processed in the second coordinate dimension can be obtained by querying the CurrentTriId of the relational dictionary idOverlapInfo2. The overlapping detection face set overlapTriIds of the face to be processed CurrentTriId can be obtained by taking the intersection of the candidate detection face set overlapTriIds1 of the face to be processed in the first coordinate dimension and the candidate detection face set overlapTriIds2 of the face to be processed in the second coordinate dimension. Figure 6 The triangle patches in the overlapping area of the thick solid line frame and the thick dashed line frame are shown.
[0085] Optionally, to facilitate program processing, the serial number of each triangle face and its corresponding overlap detection face set overlapTriIds may be represented in a key-value pair format to form a relational dictionary idOverlapInfo for easy query and processing of related information.
[0086] In an optional embodiment, each triangular facet of the above-mentioned virtual model corresponds to a unique serial number, and the overlapping detection facet set of each triangular facet is used to determine the overlapping detection facet corresponding to each triangular facet. This can be achieved by the following steps: comparing the serial number of the facet to be processed with the serial numbers of each facet in the overlapping detection facet set of the facet to be processed; the facet to be processed is any facet among the triangular faces; performing a first filtering process on the overlapping detection facet set of the facet to be processed based on the comparison result of the serial number of the facet to be processed and the serial numbers of each facet in the overlapping detection facet set of the facet to be processed; and determining the overlapping detection facet corresponding to the facet to be processed based on the overlapping detection facet set after the first filtering process of the facet to be processed.
[0087] Exemplarily, taking the serial number of the patch to be processed as CurrentTriId, by polling the patches in the overlapping detection patch set overlapTriIds of the patch to be processed, the serial number CurrentTriId can be compared with the serial numbers OtherTriId of each patch in overlapTriIds respectively. According to the comparison results, the triangular patches that meet the first preset condition can be filtered from overlapTriIds to retain the patches that need to be detected for overlap with the patch to be processed, that is, the overlapping detection patches, thus avoiding repeated detection. For example, the first preset condition can be configured to be less than.
[0088] It should be noted that in the actual application process, the first preset condition can also be configured to be greater than, as long as the purpose of avoiding repeated detection is met. The present disclosure does not specifically limit this.
[0089] In an optional implementation manner, the above first filtering process for the overlapping detection patch set of the patch to be processed according to the comparison results between the serial number of the patch to be processed and the serial numbers of each patch in the overlapping detection patch set of the patch to be processed can be achieved through the following steps: Filter out the patches with serial numbers less than the patch to be processed from the overlapping detection patch set of the patch to be processed according to the comparison results between the serial number of the patch to be processed and the serial numbers of each patch in the overlapping detection patch set of the patch to be processed.
[0090] For example: The triangular patches with serial numbers that meet OtherTriId < CurrentTriId can be filtered from the overlapping detection patch set overlapTriIds of the patch to be processed, that is, skip the triangular patches with serial numbers less than CurrentTriId, so that the triangular patches that do not meet OtherTriId < CurrentTriId are retained in overlapTriIds to avoid repeated detection. Here, OtherTriId represents the serial number of the patch in the overlapping detection patch set overlapTriIds.
[0091] In an optional embodiment, the above-mentioned determination of the overlapping detection patches corresponding to the face to be processed based on the overlapping detection patch set after the face to be processed has been first filtered can be achieved by the following steps: determining the polygonal patches to which the face to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the face to be processed has been first filtered; obtaining the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs; the overlapping patch set includes polygonal patches corresponding to the surfaces of each model of the virtual model and the polygonal patches to which the face to be processed belongs, which have been detected to overlap; performing a second filtering process on the overlapping detection patch set after the face to be processed has been first filtered according to the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the face to be processed has been first filtered; determining the overlapping detection patch corresponding to the face to be processed according to the overlapping detection patch set after the face to be processed has been second filtered.
[0092] For example, the serial number CurrentFaceId of the polygonal face to which the face to be processed belongs, and the serial number OtherFaceId of the polygonal face to which each face in the overlapping detection face set after the face to be processed has been subjected to the first filtering process can be determined by querying the correspondence dictionary TriFaceInfo between the serial numbers of each triangular face of the virtual object and the serial numbers of the polygonal face to which it belongs.
[0093] For example, a set of overlapping facets, FaceIdOverlap, corresponding to the polygonal facets to which the facet to be processed belongs can be obtained. Based on the set FaceIdOverlap and the serial number OtherFaceId of the polygonal facets to which each facet in the overlapping detection facet set after the facet to be processed has undergone the first filtering process, triangular facets that meet the second preset condition are further filtered from overlapTriIds to retain the facets that need to be overlapped with the facet to be processed, i.e., the overlapping detection facets, to avoid redundant detection. The second preset condition includes: the serial number OtherFaceId of the polygonal facet to which it belongs is in the overlapping facet set FaceIdOverlap.
[0094] For example, the facets in the overlap detection facet set that have undergone the second filtering process on the facet to be processed may be used as the overlap detection facets corresponding to the facet to be processed.
[0095] In an optional embodiment, the above-mentioned second filtering process is performed on the overlapping detection patch set after the first filtering process of the face to be processed according to the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the face to be processed has undergone the first filtering process. This can be achieved by the following steps: according to the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs, the faces whose polygonal patches are located in the overlapping patch set are filtered out from the overlapping detection patch set after the face to be processed has undergone the first filtering process.
[0096] For example, the faces whose serial number OtherFaceId of the polygonal faces belongs to is in the overlapping face set FaceIdOverlap from the overlapping detection face set overlapTriIds of the face to be processed, so as to avoid redundant detection and improve detection efficiency. It should be noted that when the serial number OtherFaceId of the polygonal face to which the triangle face in the overlapping detection face set overlapTriIds of the face to be processed belongs is in the overlapping face set FaceIdOverlap, it indicates that the existence of overlapping triangle faces in the two polygonal faces OtherFaceId and CurrentFaceId has been detected before, so the current detection can be skipped to reduce unnecessary redundant processing overhead, where CurrentFaceId is the serial number of the polygonal face to which the face to be processed belongs.
[0097] Optionally, in an actual process, it may be determined one by one whether filtering is required according to the order of the face sequence numbers in overlapTriIds, and this disclosure does not make any specific limitation on this.
[0098] Step S130, performing triangle overlap detection on each triangular facet and the overlap detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, and determining the overlap detection result of the polygonal facets corresponding to each model surface of the virtual model based on the triangle overlap detection result of each triangular facet.
[0099] After determining the overlap detection patch corresponding to the to-be-processed patch, the to-be-processed patch and its corresponding overlap detection patch can be subjected to overlap detection using a triangle overlap detection technique, which is not specifically limited in this disclosure. Examples include the bounding box method, separating axis theorem, line segment intersection detection method, inverse affine transformation method, and the like.
[0100] Optionally, if the serial number OtherFaceId of the polygonal face to which the triangular face serial number OtherTriId in the overlapping detection face set overlapTriIds of the face to be processed belongs is not in the overlapping face set FaceIdOverlap corresponding to the polygonal face to which the face to be processed belongs, the triangular face corresponding to OtherTriId can be determined as the overlapping detection face of the face to be processed, and an overlapping detection can be performed between the triangular face and the face to be processed. After the detection is completed, the serial number of the next triangular face in the overlapping detection face set overlapTriIds of the face to be processed is continued to be determined.
[0101] In an optional embodiment, the following steps can also be performed: if it is detected that there is overlap between the face to be processed and the overlapping detection face corresponding to the face to be processed, the polygonal face to which the overlapping detection face corresponding to the face to be processed belongs is added to the overlapping face set corresponding to the polygonal face to which the face to be processed belongs.
[0102] For example, if it is detected that there is an overlap between the face to be processed and the overlapping detection face corresponding to the face to be processed, the serial number of the polygonal face to which the overlapping detection face corresponding to the face to be processed belongs can be added to the overlapping face set FaceIdOverlap corresponding to the polygonal face to which the face to be processed belongs, so as to speed up the detection in subsequent rounds.
[0103] It should be noted that a FaceIdOverlap set of overlapping facets can be created in advance for each polygonal facet. This set is initially empty and can be continuously added as the overlap detection process runs until all triangle facets are traversed. For example, to facilitate program processing, the serial number of each polygonal facet and the corresponding FaceIdOverlap set of overlapping facets can be represented as a key-value pair to form a relational dictionary FaceIdOverlapInfo to facilitate related information query.
[0104] After traversing each triangular face, the resulting relationship dictionary FaceIdOverlapInfo can be used as the overlap detection result of the polygonal faces corresponding to each surface of the virtual model and fed back to the user for processing to improve the UV overlap phenomenon of the virtual object and enhance the visual performance of the virtual object.
[0105] For example, Figure 7 As shown, a flowchart of traversing the overlap detection face set of the face to be processed is provided, which may specifically include the following steps:
[0106] Step S701, obtaining the serial number CurrentTriId of the face to be processed and the serial number OtherTriId in the overlap detection face set overlapTriIds of the face to be processed;
[0107] Step S702, determine whether CurrentTriId is less than OtherTriId; if so, jump to step S708; if not, execute step S703;
[0108] Step S703: query TriFaceInfo to obtain CurrentFaceId corresponding to CurrentTriId and OtherFaceId corresponding to OtherTriId;
[0109] Among them, TriFaceInfo is a dictionary of correspondences between the serial numbers of each triangular face of the virtual object and the serial numbers of the polygonal face to which it belongs; CurrentFaceId is the serial number of the polygonal face to which CurrentTriId belongs; OtherFaceId is the serial number of the polygonal face to which OtherTriId belongs; when the CurrentFaceId corresponding to CurrentTriId is the same as the OtherFaceId corresponding to OtherTriId, it is a self-overlap detection of the polygonal face CurrentFaceId;
[0110] Step S704: query FaceIdOverlapInfo to obtain the overlapping face set FaceIdOverlap corresponding to CurrentFaceId;
[0111] Among them, FaceIdOverlapInfo is a dictionary of correspondences between the serial numbers of each polygonal face of the virtual object and the set of overlapping facets corresponding to the corresponding polygonal facets;
[0112] Step S705, determine whether OtherFaceId appears in the overlapping face set FaceIdOverlap corresponding to CurrentFaceId; if so, jump to step S708; if not, execute step S706;
[0113] Step S706, determine whether the triangle patch corresponding to CurrentTriId overlaps with the triangle patch corresponding to the current OtherTriId; if not, jump to step S708; if so, execute step S707;
[0114] Step S707, adding OtherFaceId to the overlapping face set FaceIdOverlap corresponding to CurrentFaceId;
[0115] Step S708 : Compare the sequence number CurrentTriId of the face to be processed with the next sequence number in the overlap detection face set overlapTriIds of the face to be processed.
[0116] pass Figure 7 The steps shown can filter some elements in the overlap detection patch set corresponding to the patch to be processed, so as to reduce the workload of overlap detection between triangular patches.
[0117] In an optional embodiment, triangle overlap detection is performed on each triangular facet respectively with the overlapping detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, which can be achieved by the following steps: according to the vertex coordinates of the facet to be processed, an affine transformation matrix from the preset basic facet to the facet to be processed is constructed; the facet to be processed is any facet among the triangular faces; the shape of the preset basic facet is an equilateral right triangle and the right-angled sides are parallel to the coordinate axis; according to the inverse matrix of the affine transformation matrix and the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed, the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed after the inverse affine transformation are determined; according to the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed after the inverse affine transformation and the vertex coordinates of the preset basic facet, the overlapping state between the facet to be processed and the overlapping detection facet corresponding to the facet to be processed is determined.
[0118] The default base patch is an equilateral right triangle with its sides parallel to the coordinate axes. It is a fictitious triangular patch used in the overlap detection process and is not a real patch. Optionally, to facilitate calculations, the right-angled vertex of the default base patch can be placed at the origin (0,0).
[0119] For example, taking the to-be-processed patch containing vertices a, b, and c as an example, when constructing an affine transformation matrix from a preset base patch to the to-be-processed patch according to the vertex coordinates of the to-be-processed patch, the affine transformation matrix AT shown below can be constructed:
[0120]
[0121] Among them, ca1 represents the component of the vector formed by point a to point c in the first coordinate dimension; ca2 represents the component of the vector formed by point a to point c in the second coordinate dimension; cb1 represents the component of the vector formed by point b to point c in the first coordinate dimension; cb2 represents the component of the vector formed by point b to point c in the second coordinate dimension; c1 represents the component of point c in the first coordinate dimension; c2 represents the component of point c in the second coordinate dimension.
[0122] Based on the affine transformation matrix AT, the inverse matrix IAT of the affine transformation matrix AT can be calculated for use.
[0123] Furthermore, taking the example that the overlap detection patch corresponding to the to-be-processed patch contains vertices d, e, and f, the following vertex matrix TM can be constructed based on the vertex coordinates of the overlap detection patch corresponding to the to-be-processed patch:
[0124]
[0125] Among them, d1 represents the component of vertex d in the first coordinate dimension; d2 represents the component of vertex d in the second coordinate dimension; e1 represents the component of vertex e in the first coordinate dimension; e2 represents the component of vertex e in the second coordinate dimension; f1 represents the component of vertex f in the first coordinate dimension; f2 represents the component of vertex f in the second coordinate dimension.
[0126] Furthermore, by calculating TM×IAT, the overlap detection patch corresponding to the to-be-processed patch can be subjected to an inverse affine transformation to obtain the vertex coordinates of the overlap detection patch corresponding to the to-be-processed patch after the inverse affine transformation.
[0127] After determining the vertex coordinates of the overlap detection patch corresponding to the to-be-processed patch after the inverse affine transformation, the overlap state between the to-be-processed patch and the overlap detection patch corresponding to the to-be-processed patch can be determined based on the vertex coordinates of the overlap detection patch corresponding to the to-be-processed patch after the inverse affine transformation and the vertex coordinates of the preset basic patch. Specifically, if the vertex coordinates of the overlap detection patch corresponding to the to-be-processed patch after the inverse affine transformation constitute a triangle TriA, and the vertex coordinates of the preset basic patch constitute a triangle TriB, an overlap detection judgment can be performed between the triangle TriA and the triangle TriB, and the overlap detection result between the triangle TriA and the triangle TriB can be used as the overlap detection result between the to-be-processed patch and the overlap detection patch corresponding to the to-be-processed patch.
[0128] Since the affine transformation of a two-dimensional plane does not affect the relative relationship between two objects, a preset basic patch with a fictitious regular shape is used to detect the overlapping state between the triangle formed by the vertex coordinates of the preset basic patch and the triangle formed by the vertex coordinates of the overlapping detection patch corresponding to the patch to be processed after the inverse affine transformation, and use it as the overlapping detection result between the patch to be processed and the overlapping detection patch corresponding to the patch to be processed. This can simplify the computational complexity of overlapping detection while ensuring detection accuracy, improve the efficiency of overlapping detection, and optimize overall performance.
[0129] For example, Figure 8As shown, a schematic diagram of the data structure for UV overlap detection of virtual objects is provided. The serial number FaceId of each polygonal facet can be obtained by polling all polygonal facets of the virtual object Obj to be detected. The serial number TriId of each triangle facet can be obtained by polling the triangular facets from which the polygonal facets are split. Based on the serial number FaceId of each polygonal facet and the serial number TriId of the triangular facets from which each polygonal facet is split, a TriUV data structure for each triangle facet can be created. The TriUV data structure can include uvPs (i.e., the UV coordinate values of the vertices of the triangle facet), UvIds (i.e., the serial numbers of the vertices corresponding to the triangle facet), idPInfo (i.e., the association dictionary between the vertex serial numbers and the vertex UV coordinate values of the triangle facet), Bc (i.e., the coordinate values of the midpoint of the triangle facet), Dist (i.e., the maximum distance between the midpoint of the triangle facet and the vertex), the inverse matrix IAT of the affine transformation matrix, and the vertex matrix TM. The TriUV data structure of each triangle facet can form a TriUVList list. A relationship dictionary TriFaceInfo may be created based on the correspondence between the serial number TriId of each triangular face and the serial number FaceId of the polygonal face to which it belongs. Based on the TriUV data structure of each triangular face, a list TriRangeList1 formed by the potential overlapping range set of all triangular faces in the first coordinate dimension and a list TriRangeList2 formed by the potential overlapping range set of the second coordinate dimension may be calculated. A relationship dictionary idOverlapInfo1 between the serial number of each triangular face and its candidate detection face set in the first coordinate dimension may be constructed based on the list TriRangeList1; a relationship dictionary idOverlapInfo2 between the serial number of each triangular face and its candidate detection face set in the second coordinate dimension may be constructed based on the list TriRangeList2; based on the relationship dictionary idOverlapInfo1 and the relationship dictionary idOverlapInfo2 of each triangular face, a relationship dictionary idOverlapInfo between the serial number of each triangular face and its corresponding overlapping detection face set may be generated. The serial numbers of each triangular facet can be traversed through idOverlapInfo, and they can be used as faces to be processed respectively. According to the serial number CurrentTriId of the facet to be processed, CurrentTriUV (i.e., the TriUV corresponding to CurrentTriId) can be obtained; and according to the serial number OtherTriId of the overlapping detection facet corresponding to the facet to be processed, OtherTriUV (i.e., the TriUV corresponding to OtherTriId) can be obtained.The triangle overlap between CurrentTriId and OtherTriId can be determined based on the IAT in CurrentTriUV and the TM in OtherTriUV. If overlap exists, the relationship dictionary TriFaceInfo can be used to query the serial number CurrentFaceId of the polygonal patch corresponding to the serial number CurrentTriId, and the serial number OtherFaceId of the polygonal patch corresponding to the serial number OtherTriId, and add OtherFaceId to FaceIdOverlapInfo[CurrentFaceId]. FaceIdOverlapInfo is a dictionary of correspondences between the serial numbers of each polygonal patch of the virtual object and the set of overlapping patches corresponding to the corresponding polygonal patch.
[0130] Optionally, after determining the overlap detection results of the polygonal patches corresponding to the surfaces of each model of the virtual model, the overlap detection results can also be visualized on the user interface to prompt the model maker of the current UV overlap status of the virtual model.
[0131] In an optional embodiment, after determining the overlap detection results of the polygonal patches corresponding to the model surfaces of the virtual model, the following steps can also be performed: if there is overlap between the polygonal patches corresponding to the model surfaces of the virtual model, control the adjustment of the UV layout of the virtual model, and based on the adjusted UV layout, control the virtual model to perform texture mapping and render it to the user interface.
[0132] For example, if there is overlap between the polygonal patches corresponding to the surfaces of each model of the virtual model, the model maker can manually adjust the UV vertices or edges of the overlapping area based on the overlap detection results visually displayed in the user interface; adjust the UV layout through operations such as translation and scaling to reduce the overlap between the polygonal patches corresponding to the surfaces of each model of the virtual model.
[0133] For example, if there is overlap between polygonal patches corresponding to the surfaces of each model of the virtual model, the overlapping UV areas can be re-expanded based on the UV automatic expansion algorithm to reduce the overlap between polygonal patches corresponding to the surfaces of each model of the virtual model.
[0134] Optionally, after texture mapping is performed on the virtual model and rendering is performed to the user interface, the model maker may further determine whether other modification operations need to be performed on the virtual model based on the rendering effect of the virtual model. This disclosure does not specifically limit this.
[0135] Through the UV overlap detection disclosed in this disclosure, UV overlap can be discovered and repaired in a timely manner at an early stage, which not only improves the efficiency of model production, but also ensures that each texture area is effectively utilized, thereby reducing content occupancy, reducing the GPU (Graphics Processing Unit) load, and improving the visual performance of the model.
[0136] In an optional embodiment, the above-mentioned control and adjustment of the UV layout of the virtual model can also be achieved through the following steps: determining the degree of UV overlap based on the overlap detection results of the polygonal faces corresponding to the surfaces of each model of the virtual model; determining the UV layout adjustment strategy based on the UV overlap degree; and controlling the adjustment of the UV layout of the virtual model based on the UV layout adjustment strategy.
[0137] Among them, the degree of UV overlap can be used to measure the UV unfolding effect. For example, the lower the UV overlap, the better the UV unfolding effect; the higher the UV overlap, the worse the UV unfolding effect. Exemplarily, the degree of UV overlap can be represented by the number of overlapping facets (e.g., polygonal facets or triangular facets). Exemplarily, the degree of UV overlap can also be represented by the ratio of the number of overlapping facets (e.g., polygonal facets or triangular facets) to the total number of facets. It should be noted that the indicators used here to characterize the degree of UV overlap are exemplary. In actual applications, other types of indicators can also be used to characterize the degree of UV overlap, and this disclosure does not specifically limit this.
[0138] UV layout adjustment strategies may include, but are not limited to, local UV layout adjustment strategies and global UV layout adjustment strategies. Local UV layout adjustment strategies may, for example, re-unwrap overlapping UV regions or perform fine-tuning strategies such as translation and scaling of vertices or edges in overlapping UV regions, which are not specifically limited in this disclosure. Global UV layout adjustment strategies involve re-unwrapping the virtual model using a different UV unwrapping algorithm.
[0139] For example, if the UV overlap is below a preset threshold, indicating that the original UV unwrapping effect is relatively good, a local adjustment strategy for the UV layout can be used to adjust the UV layout in a targeted manner. If the UV overlap is above the preset threshold, indicating that the original UV unwrapping effect is relatively poor, a global adjustment strategy for the UV layout can be used to re-UV unwrap the virtual model. The preset threshold can be configured by the model maker based on the production accuracy requirements and is not specifically limited in this disclosure.
[0140] By selecting different UV layout adjustment strategies, it is possible to reduce computational processing overhead and alleviate the processor burden while ensuring the UV unfolding effect.
[0141] The exemplary embodiment of the present disclosure further provides an overlap detection device, referring to Figure 9 As shown, the overlap detection device 900 may include the following program modules:
[0142] The UV unfolding module 910 is used to perform UV unfolding on the virtual model to be inspected to obtain polygonal patches corresponding to each surface of the virtual model, and to divide the polygonal patches corresponding to each surface of the virtual model into triangular patches;
[0143] The patch determination module 920 is configured to determine the potential overlap range of each triangular patch in each coordinate dimension, and determine the overlap detection patch corresponding to each triangular patch based on the potential overlap range of each triangular patch in each coordinate dimension; wherein the range endpoints of the potential overlap range of the overlap detection patch in the target coordinate dimension are located within the potential overlap range of the corresponding triangular patch in the target coordinate dimension, where the target coordinate dimension is one of the coordinate dimensions;
[0144] The overlap detection module 930 is used to perform triangle overlap detection on each triangular facet with the overlap detection facet corresponding to each triangular facet, obtain the triangle overlap detection results of each triangular facet, and determine the overlap detection results of the polygonal facets corresponding to each model surface of the virtual model based on the triangle overlap detection results of each triangular facet.
[0145] In an optional embodiment, based on the above-mentioned scheme, the patch determination module 920 determines the potential overlapping range of each triangular patch in each coordinate dimension, including: a midpoint coordinate determination module, used to obtain the vertex coordinates of each triangular patch, and determine the midpoint coordinates of each triangular patch based on the vertex coordinates of each triangular patch; an influence range determination module, used to determine the potential overlapping range of each triangular patch in each coordinate dimension based on the vertex coordinates of each triangular patch and the midpoint coordinates of each triangular patch.
[0146] In an optional embodiment, based on the above-mentioned scheme, the midpoint coordinate determination module can be configured as follows: obtaining the vertex coordinates of the face to be processed; the face to be processed is any face among the triangular faces; according to the vertex coordinates of the face to be processed, determining the coordinate mean of the three vertices of the face to be processed in each coordinate dimension; according to the coordinate mean of the three vertices of the face to be processed in each coordinate dimension, determining the midpoint coordinates of the face to be processed.
[0147] In an optional embodiment, based on the above-mentioned scheme, the influence range determination module includes: a distance determination module, which is used to determine the distance between the midpoint and the vertex of each triangular facet according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet; an influence range calculation module, which is used to determine the potential overlapping range of each triangular facet in each coordinate dimension according to the midpoint coordinates of each triangular facet and the distance between the midpoint and the vertex of each triangular facet.
[0148] In an optional embodiment, based on the above-mentioned scheme, the influence range calculation module can be configured as follows: comparing the distance between the midpoint of the face to be processed and each vertex of the face to be processed to determine the maximum distance between the midpoint of the face to be processed and the vertex; the face to be processed is any face among the triangular faces; adding the coordinate value of the midpoint of the face to be processed in each coordinate dimension to the maximum distance between the midpoint of the face to be processed and the vertex to obtain the upper limit of the range of the face to be processed in each coordinate dimension; subtracting the coordinate value of the midpoint of the face to be processed in each coordinate dimension from the maximum distance between the midpoint of the face to be processed and the vertex to obtain the lower limit of the range of the face to be processed in each coordinate dimension; and determining the potential overlapping range of the face to be processed in each coordinate dimension according to the upper limit and lower limit of the range of the face to be processed in each coordinate dimension.
[0149] In an optional embodiment, based on the above-mentioned scheme, the potential overlapping range includes an upper range limit and a lower range limit, and the patch determination module 920 determines the overlapping detection patch corresponding to each triangular patch according to the potential overlapping range of each triangular patch in each coordinate dimension, including: a range endpoint sorting module, which is used to sort the range endpoints corresponding to the potential overlapping range of each triangular patch for each coordinate dimension to obtain the sorting results corresponding to each coordinate dimension; the range endpoints include an upper range limit and a lower range limit; a candidate detection patch set determination module, which is used to determine the candidate detection patch set corresponding to each triangular patch in each coordinate dimension according to the sorting results corresponding to each coordinate dimension; the candidate detection patch set includes triangular patches whose range endpoints are arranged between the upper range limit and the lower range limit of the corresponding triangular patch; an overlapping detection patch determination module, which is used to determine the overlapping detection patch corresponding to each triangular patch according to the candidate detection patch set corresponding to each triangular patch in each coordinate dimension.
[0150] In an optional embodiment, based on the above-mentioned scheme, the above-mentioned overlapping detection patch determination module includes: an overlapping detection patch set determination module, which is used to merge the candidate detection patch sets corresponding to each triangular patch in each coordinate dimension to obtain the overlapping detection patch sets of each triangular patch; an overlapping detection patch set filtering module, which is used to determine the overlapping detection patches corresponding to each triangular patch based on the overlapping detection patch sets of each triangular patch.
[0151] In an optional embodiment, based on the above-mentioned scheme, each triangular face of the virtual model corresponds to a unique serial number, and the overlapping detection face set filtering module includes: a serial number comparison module, which is used to compare the serial number of the face to be processed with the serial numbers of each face in the overlapping detection face set of the face to be processed; the face to be processed is any face among the triangular faces; a first filtering processing module, which is used to perform a first filtering processing on the overlapping detection face set of the face to be processed based on the comparison result of the serial number of the face to be processed and the serial numbers of each face in the overlapping detection face set of the face to be processed; a first set processing module, which is used to determine the overlapping detection face corresponding to the face to be processed based on the overlapping detection face set of the face to be processed after the first filtering processing.
[0152] In an optional embodiment, based on the above-mentioned scheme, the first filtering processing module can be configured as: according to the comparison result of the serial number of the facet to be processed and the serial numbers of each facet in the overlapping detection facet set of the facet to be processed, filter out the faces with serial numbers smaller than the facet to be processed from the overlapping detection facet set of the facet to be processed.
[0153] In an optional embodiment, based on the above-mentioned scheme, the first set processing module includes: a belonging patch determination module, which is used to determine the polygonal patches to which the patch to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the patch to be processed has been subjected to the first filtering processing; an overlapping patch set acquisition module, which is used to obtain the overlapping patch set corresponding to the polygonal patches to which the patch to be processed belongs; the overlapping patch set includes the polygonal patches corresponding to the surfaces of each model of the virtual model and the polygonal patches to which the patch to be processed belongs, which have been detected to overlap; a second filtering processing module, which is used to perform a second filtering processing on the overlapping detection patch set after the first filtering processing of the patch to be processed according to the overlapping patch set corresponding to the polygonal patches to which the patch to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the first filtering processing of the patch to be processed belongs; the second set processing module is used to determine the overlapping detection patch corresponding to the patch to be processed according to the overlapping detection patch set after the second filtering processing of the patch to be processed.
[0154] In an optional embodiment, based on the aforementioned scheme, the second filtering processing module can be configured as follows: according to the overlapping patch set corresponding to the polygonal patch to which the patch to be processed belongs, filter out the patches whose polygonal patches are located in the overlapping patch set from the overlapping detection patch set after the patch to be processed has undergone the first filtering processing.
[0155] In an optional embodiment, based on the above-mentioned scheme, the overlap detection device 900 may include a set update module: if it is detected that there is an overlap between the face to be processed and the overlap detection face corresponding to the face to be processed, the polygonal face corresponding to the overlap detection face corresponding to the face to be processed is added to the overlapping face set corresponding to the polygonal face to which the face to be processed belongs.
[0156] In an optional embodiment, based on the above-mentioned scheme, the overlap detection module 930 performs triangle overlap detection on each triangular facet with the overlap detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, which can be configured as follows: according to the vertex coordinates of the facet to be processed, construct an affine transformation matrix from the preset basic facet to the facet to be processed; the facet to be processed is any facet among the triangular faces; the shape of the preset basic facet is an equilateral right triangle and the right-angled sides are parallel to the coordinate axis; according to the inverse matrix of the affine transformation matrix and the vertex coordinates of the overlap detection facet corresponding to the facet to be processed, determine the vertex coordinates of the overlap detection facet corresponding to the facet to be processed after the inverse affine transformation; according to the vertex coordinates of the overlap detection facet corresponding to the facet to be processed after the inverse affine transformation and the vertex coordinates of the preset basic facet, determine the overlapping state between the facet to be processed and the overlap detection facet corresponding to the facet to be processed.
[0157] In an optional embodiment, based on the above-mentioned scheme, the overlap detection device 900 may include: a layout adjustment module, which is used to control the adjustment of the UV layout of the virtual model if there is overlap between the polygonal patches corresponding to the surfaces of each model of the virtual model; and a model rendering module, which is used to control the texture mapping of the virtual model and render it into the user interface based on the adjusted UV layout.
[0158] In an optional embodiment, based on the aforementioned scheme, the layout adjustment module can be configured to: determine the degree of UV overlap based on the overlap detection results of the polygonal facets corresponding to the surfaces of each model of the virtual model; determine the UV layout adjustment strategy based on the UV overlap degree; and control and adjust the UV layout of the virtual model based on the UV layout adjustment strategy.
[0159] The specific details of each part of the above-mentioned device have been described in detail in the implementation method part. The undisclosed details can be found in the implementation method part, so they will not be repeated here.
[0160] The exemplary embodiments of the present disclosure further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, implements the above overlap detection method.
[0161] In one embodiment, a computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The computer-readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk drive (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing the computer program, such as a read-only memory, NAND flash memory, and the like.
[0162] In one embodiment, the computer program product may be an intangible product containing a computer program. For example, the computer program product may be implemented as a virtual digital product, such as a digital file such as an executable file or installation package storing the computer program.
[0163] The code of the computer program can be written in one or more programming languages. Programming languages include C, Java, C++, etc. The program code can be executed entirely on the user computing device, partially on the user computing device, or as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device via any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., via an Internet connection provided by a carrier).
[0164] Computer programs can be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program is run on an electronic device, its code is used to cause the electronic device to execute (more specifically, to cause the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure. For example, the following steps may be included:
[0165] For the virtual model to be tested, UV unfolding is performed to obtain polygonal patches corresponding to each surface of the virtual model, and the polygonal patches corresponding to each surface of the virtual model are divided into triangular patches;
[0166] Determine the potential overlapping range of each triangular facet in each coordinate dimension, and determine the overlap detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension; wherein the range endpoints of the potential overlapping range of the overlap detection facet in the target coordinate dimension are located within the potential overlapping range of the corresponding triangular facet in the target coordinate dimension, and the target coordinate dimension is one of the coordinate dimensions;
[0167] Each triangular facet is subjected to triangle overlap detection with the overlap detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, and based on the triangle overlap detection result of each triangular facet, the overlap detection result of the polygonal facet corresponding to each model surface of the virtual model is determined.
[0168] In an optional embodiment, based on the aforementioned scheme, the above-mentioned determination of the potential overlapping range of each triangular facet in each coordinate dimension can be achieved through the following steps: obtaining the vertex coordinates of each triangular facet, and determining the midpoint coordinates of each triangular facet based on the vertex coordinates of each triangular facet; determining the potential overlapping range of each triangular facet in each coordinate dimension based on the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet.
[0169] In an optional embodiment, based on the above-mentioned scheme, the above-mentioned acquisition of the vertex coordinates of each triangular facet and determination of the midpoint coordinates of each triangular facet based on the vertex coordinates of each triangular facet can be achieved through the following steps: obtaining the vertex coordinates of the facet to be processed; the facet to be processed is any facet among the triangular faces; based on the vertex coordinates of the facet to be processed, determining the coordinate mean of the three vertices of the facet to be processed in each coordinate dimension; based on the coordinate mean of the three vertices of the facet to be processed in each coordinate dimension, determining the midpoint coordinates of the facet to be processed.
[0170] In an optional embodiment, based on the aforementioned scheme, the above-mentioned determination of the potential overlapping range of each triangular facet in each coordinate dimension according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet can be achieved by the following steps: determining the distance between the midpoint and the vertex of each triangular facet according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet; determining the potential overlapping range of each triangular facet in each coordinate dimension according to the midpoint coordinates of each triangular facet and the distance between the midpoint and the vertex of each triangular facet.
[0171] In an optional embodiment, based on the above-mentioned scheme, the potential overlapping range of each triangular facet in each coordinate dimension is determined according to the coordinates of the midpoint of each triangular facet and the distance between the midpoint of each triangular facet and the vertex. This can be achieved by the following steps: comparing the distance between the midpoint of the facet to be processed and each vertex of the facet to be processed to determine the maximum distance between the midpoint of the facet to be processed and the vertex; the facet to be processed is any facet among the triangular facets; adding the coordinate value of the midpoint of the facet to be processed in each coordinate dimension to the maximum distance between the midpoint of the facet to be processed and the vertex to obtain the upper limit of the range of the facet to be processed in each coordinate dimension; subtracting the coordinate value of the midpoint of the facet to be processed in each coordinate dimension from the maximum distance between the midpoint of the facet to be processed and the vertex to obtain the lower limit of the range of the facet to be processed in each coordinate dimension; determining the potential overlapping range of the facet to be processed in each coordinate dimension according to the upper limit and lower limit of the range of the facet to be processed in each coordinate dimension.
[0172] In an optional embodiment, based on the above-mentioned scheme, the potential overlapping range includes an upper limit and a lower limit. The above-mentioned determination of the overlapping detection facets corresponding to each triangular facet according to the potential overlapping range of each triangular facet in each coordinate dimension can be achieved by the following steps: for each coordinate dimension, sorting the range endpoints corresponding to the potential overlapping range of each triangular facet to obtain the sorting results corresponding to each coordinate dimension; the range endpoints include an upper limit and a lower limit; according to the sorting results corresponding to each coordinate dimension, determining the candidate detection facet set corresponding to each triangular facet in each coordinate dimension; the candidate detection facet set includes triangular faces whose range endpoints are arranged between the upper limit and the lower limit of the range of the corresponding triangular facet; according to the candidate detection facet set corresponding to each triangular facet in each coordinate dimension, determining the overlapping detection facet corresponding to each triangular facet.
[0173] In an optional embodiment, based on the aforementioned scheme, the overlapping detection patch corresponding to each triangular facet is determined according to the candidate detection patch set corresponding to each triangular facet in each coordinate dimension. This can be achieved by the following steps: merging the candidate detection patch set corresponding to each triangular facet in each coordinate dimension to obtain the overlapping detection patch set of each triangular facet; determining the overlapping detection patch corresponding to each triangular facet according to the overlapping detection patch set of each triangular facet.
[0174] In an optional embodiment, based on the above-mentioned scheme, each triangular face of the virtual model corresponds to a unique serial number, and the overlapping detection facet set of each triangular face is used to determine the overlapping detection facet corresponding to each triangular face. This can be achieved by the following steps: comparing the serial number of the face to be processed with the serial numbers of each face in the overlapping detection facet set of the face to be processed; the face to be processed is any face among the triangular faces; based on the comparison result of the serial number of the face to be processed and the serial numbers of each face in the overlapping detection facet set of the face to be processed, performing a first filtering process on the overlapping detection facet set of the face to be processed; and determining the overlapping detection facet corresponding to the face to be processed based on the overlapping detection facet set after the first filtering process of the face to be processed.
[0175] In an optional embodiment, based on the aforementioned scheme, the overlap detection patch set of the face to be processed is subjected to a first filtering process according to the comparison result of the serial number of the face to be processed with the serial numbers of each face in the overlap detection patch set of the face to be processed. This can be achieved by the following steps: according to the comparison result of the serial number of the face to be processed with the serial numbers of each face in the overlap detection patch set of the face to be processed, the faces with serial numbers smaller than the face to be processed are filtered out from the overlap detection patch set of the face to be processed.
[0176] In an optional embodiment, based on the above-mentioned scheme, the overlapping detection patches corresponding to the face to be processed are determined according to the overlapping detection patch set after the face to be processed has been first filtered, which can be achieved by the following steps: determining the polygonal patches to which the face to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the face to be processed has been first filtered; obtaining the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs; the overlapping patch set includes polygonal patches corresponding to the surfaces of each model of the virtual model and the polygonal patches to which the face to be processed belongs, which have been detected to overlap; performing a second filtering process on the overlapping detection patch set after the face to be processed has been first filtered according to the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the face to be processed has been first filtered; determining the overlapping detection patch corresponding to the face to be processed according to the overlapping detection patch set after the face to be processed has been second filtered.
[0177] In an optional embodiment, based on the aforementioned scheme, according to the overlapping patch set corresponding to the polygonal patches to which the patch to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the patch to be processed has undergone the first filtering processing, a second filtering processing is performed on the overlapping detection patch set after the patch to be processed has undergone the first filtering processing. This can be achieved by the following steps: according to the overlapping patch set corresponding to the polygonal patches to which the patch to be processed belongs, the patches whose polygonal patches are located in the overlapping patch set are filtered out from the overlapping detection patch set after the patch to be processed has undergone the first filtering processing.
[0178] In an optional embodiment, based on the above-mentioned scheme, the following steps can also be performed: if it is detected that there is overlap between the face to be processed and the overlapping detection face corresponding to the face to be processed, the polygonal face to which the overlapping detection face corresponding to the face to be processed belongs is added to the overlapping face set corresponding to the polygonal face to which the face to be processed belongs.
[0179] In an optional embodiment, based on the above-mentioned scheme, the above-mentioned triangle overlap detection is performed on each triangular facet respectively with the overlapping detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, which can be achieved by the following steps: according to the vertex coordinates of the facet to be processed, an affine transformation matrix from the preset basic facet to the facet to be processed is constructed; the facet to be processed is any facet among the triangular faces; the shape of the preset basic facet is an equilateral right triangle and the right-angled sides are parallel to the coordinate axis; according to the inverse matrix of the affine transformation matrix and the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed, the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed after the inverse affine transformation are determined; according to the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed after the inverse affine transformation and the vertex coordinates of the preset basic facet, the overlapping state between the facet to be processed and the overlapping detection facet corresponding to the facet to be processed is determined.
[0180] In an optional embodiment, based on the above-mentioned scheme, the following steps may also be performed: if there is overlap between the polygonal patches corresponding to the surfaces of each model of the virtual model, control the adjustment of the UV layout of the virtual model; based on the adjusted UV layout, control the virtual model to perform texture mapping and render it into the user interface.
[0181] In an optional embodiment, based on the aforementioned scheme, the above-mentioned control and adjustment of the UV layout of the virtual model can be achieved through the following steps: determining the degree of UV overlap based on the overlap detection results of the polygonal facets corresponding to the surfaces of each model of the virtual model; determining the UV layout adjustment strategy based on the UV overlap degree; and controlling the adjustment of the UV layout of the virtual model based on the UV layout adjustment strategy.
[0182] In the above steps, by determining the potential overlapping range of each triangular facet in each coordinate dimension, and determining the overlapping detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension, the possible overlapping triangular facets (i.e., overlapping detection facets) can be preliminarily screened out, and further overlapping detection is performed on these possible overlapping triangular facets to obtain the information of the overlapping UV of the object. This can not only reduce the errors caused by human factors and ensure the detection accuracy, but also optimize the overlapping detection task volume, improve the overlapping detection efficiency, and reduce the server processing overhead.
[0183] The exemplary embodiments of the present disclosure also provide an electronic device capable of implementing the above-described overlap detection method. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as program code. The processor executes the executable instructions to perform the method of this exemplary embodiment. The electronic device may also include a display for displaying a graphical user interface.
[0184] Reference below Figure 10 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 10 The electronic device 1000 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0185] like Figure 10 As shown, the electronic device 1000 may include a processor 1010 , a memory 1020 , a bus 1030 , an I / O (input / output) interface 1040 , a network adapter 1050 , and a display 1060 .
[0186] Memory 1020 may include volatile memory, such as RAM 1021 and cache unit 1022, and non-volatile memory, such as ROM 1023. Memory 1020 may also include one or more program modules 1024. Such program modules 1024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program modules 1024 may include the modules described above.
[0187] The processor 1010 may include one or more processing units, for example: the processor 1010 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0188] The processor 1010 may be configured to execute executable instructions stored in the memory 1020 , such as executing any one or more method steps in this exemplary embodiment.
[0189] Exemplarily, the processor 1010 may perform the following steps:
[0190] For the virtual model to be tested, UV unfolding is performed to obtain polygonal patches corresponding to each surface of the virtual model, and the polygonal patches corresponding to each surface of the virtual model are divided into triangular patches;
[0191] Determine the potential overlapping range of each triangular facet in each coordinate dimension, and determine the overlap detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension; wherein the range endpoints of the potential overlapping range of the overlap detection facet in the target coordinate dimension are located within the potential overlapping range of the corresponding triangular facet in the target coordinate dimension, and the target coordinate dimension is one of the coordinate dimensions;
[0192] Each triangular facet is subjected to triangle overlap detection with the overlap detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, and based on the triangle overlap detection result of each triangular facet, the overlap detection result of the polygonal facet corresponding to each model surface of the virtual model is determined.
[0193] In an optional embodiment, based on the aforementioned scheme, the above-mentioned determination of the potential overlapping range of each triangular facet in each coordinate dimension can be achieved through the following steps: obtaining the vertex coordinates of each triangular facet, and determining the midpoint coordinates of each triangular facet based on the vertex coordinates of each triangular facet; determining the potential overlapping range of each triangular facet in each coordinate dimension based on the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet.
[0194] In an optional embodiment, based on the above-mentioned scheme, the above-mentioned acquisition of the vertex coordinates of each triangular facet and determination of the midpoint coordinates of each triangular facet based on the vertex coordinates of each triangular facet can be achieved through the following steps: obtaining the vertex coordinates of the facet to be processed; the facet to be processed is any facet among the triangular faces; based on the vertex coordinates of the facet to be processed, determining the coordinate mean of the three vertices of the facet to be processed in each coordinate dimension; based on the coordinate mean of the three vertices of the facet to be processed in each coordinate dimension, determining the midpoint coordinates of the facet to be processed.
[0195] In an optional embodiment, based on the aforementioned scheme, the above-mentioned determination of the potential overlapping range of each triangular facet in each coordinate dimension according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet can be achieved by the following steps: determining the distance between the midpoint and the vertex of each triangular facet according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet; determining the potential overlapping range of each triangular facet in each coordinate dimension according to the midpoint coordinates of each triangular facet and the distance between the midpoint and the vertex of each triangular facet.
[0196] In an optional embodiment, based on the above-mentioned scheme, the potential overlapping range of each triangular facet in each coordinate dimension is determined according to the coordinates of the midpoint of each triangular facet and the distance between the midpoint of each triangular facet and the vertex. This can be achieved by the following steps: comparing the distance between the midpoint of the facet to be processed and each vertex of the facet to be processed to determine the maximum distance between the midpoint of the facet to be processed and the vertex; the facet to be processed is any facet among the triangular facets; adding the coordinate value of the midpoint of the facet to be processed in each coordinate dimension to the maximum distance between the midpoint of the facet to be processed and the vertex to obtain the upper limit of the range of the facet to be processed in each coordinate dimension; subtracting the coordinate value of the midpoint of the facet to be processed in each coordinate dimension from the maximum distance between the midpoint of the facet to be processed and the vertex to obtain the lower limit of the range of the facet to be processed in each coordinate dimension; determining the potential overlapping range of the facet to be processed in each coordinate dimension according to the upper limit and lower limit of the range of the facet to be processed in each coordinate dimension.
[0197] In an optional embodiment, based on the above-mentioned scheme, the potential overlapping range includes an upper limit and a lower limit. The above-mentioned determination of the overlapping detection facets corresponding to each triangular facet according to the potential overlapping range of each triangular facet in each coordinate dimension can be achieved by the following steps: for each coordinate dimension, sorting the range endpoints corresponding to the potential overlapping range of each triangular facet to obtain the sorting results corresponding to each coordinate dimension; the range endpoints include an upper limit and a lower limit; according to the sorting results corresponding to each coordinate dimension, determining the candidate detection facet set corresponding to each triangular facet in each coordinate dimension; the candidate detection facet set includes triangular faces whose range endpoints are arranged between the upper limit and the lower limit of the range of the corresponding triangular facet; according to the candidate detection facet set corresponding to each triangular facet in each coordinate dimension, determining the overlapping detection facet corresponding to each triangular facet.
[0198] In an optional embodiment, based on the aforementioned scheme, the overlapping detection patch corresponding to each triangular facet is determined according to the candidate detection patch set corresponding to each triangular facet in each coordinate dimension. This can be achieved by the following steps: merging the candidate detection patch set corresponding to each triangular facet in each coordinate dimension to obtain the overlapping detection patch set of each triangular facet; determining the overlapping detection patch corresponding to each triangular facet according to the overlapping detection patch set of each triangular facet.
[0199] In an optional embodiment, based on the above-mentioned scheme, each triangular face of the virtual model corresponds to a unique serial number, and the overlapping detection facet set of each triangular face is used to determine the overlapping detection facet corresponding to each triangular face. This can be achieved by the following steps: comparing the serial number of the face to be processed with the serial numbers of each face in the overlapping detection facet set of the face to be processed; the face to be processed is any face among the triangular faces; based on the comparison result of the serial number of the face to be processed and the serial numbers of each face in the overlapping detection facet set of the face to be processed, performing a first filtering process on the overlapping detection facet set of the face to be processed; and determining the overlapping detection facet corresponding to the face to be processed based on the overlapping detection facet set after the first filtering process of the face to be processed.
[0200] In an optional embodiment, based on the aforementioned scheme, the overlap detection patch set of the face to be processed is subjected to a first filtering process according to the comparison result of the serial number of the face to be processed with the serial numbers of each face in the overlap detection patch set of the face to be processed. This can be achieved by the following steps: according to the comparison result of the serial number of the face to be processed with the serial numbers of each face in the overlap detection patch set of the face to be processed, the faces with serial numbers smaller than the face to be processed are filtered out from the overlap detection patch set of the face to be processed.
[0201] In an optional embodiment, based on the above-mentioned scheme, the overlapping detection patches corresponding to the face to be processed are determined according to the overlapping detection patch set after the face to be processed has been first filtered, which can be achieved by the following steps: determining the polygonal patches to which the face to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the face to be processed has been first filtered; obtaining the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs; the overlapping patch set includes polygonal patches corresponding to the surfaces of each model of the virtual model and the polygonal patches to which the face to be processed belongs, which have been detected to overlap; performing a second filtering process on the overlapping detection patch set after the face to be processed has been first filtered according to the overlapping patch set corresponding to the polygonal patches to which the face to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the face to be processed has been first filtered; determining the overlapping detection patch corresponding to the face to be processed according to the overlapping detection patch set after the face to be processed has been second filtered.
[0202] In an optional embodiment, based on the aforementioned scheme, according to the overlapping patch set corresponding to the polygonal patches to which the patch to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the patch to be processed has undergone the first filtering processing, a second filtering processing is performed on the overlapping detection patch set after the patch to be processed has undergone the first filtering processing. This can be achieved by the following steps: according to the overlapping patch set corresponding to the polygonal patches to which the patch to be processed belongs, the patches whose polygonal patches are located in the overlapping patch set are filtered out from the overlapping detection patch set after the patch to be processed has undergone the first filtering processing.
[0203] In an optional embodiment, based on the above-mentioned scheme, the following steps can also be performed: if it is detected that there is overlap between the face to be processed and the overlapping detection face corresponding to the face to be processed, the polygonal face to which the overlapping detection face corresponding to the face to be processed belongs is added to the overlapping face set corresponding to the polygonal face to which the face to be processed belongs.
[0204] In an optional embodiment, based on the above-mentioned scheme, the above-mentioned triangle overlap detection is performed on each triangular facet respectively with the overlapping detection facet corresponding to each triangular facet to obtain the triangle overlap detection result of each triangular facet, which can be achieved by the following steps: according to the vertex coordinates of the facet to be processed, an affine transformation matrix from the preset basic facet to the facet to be processed is constructed; the facet to be processed is any facet among the triangular faces; the shape of the preset basic facet is an equilateral right triangle and the right-angled sides are parallel to the coordinate axis; according to the inverse matrix of the affine transformation matrix and the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed, the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed after the inverse affine transformation are determined; according to the vertex coordinates of the overlapping detection facet corresponding to the facet to be processed after the inverse affine transformation and the vertex coordinates of the preset basic facet, the overlapping state between the facet to be processed and the overlapping detection facet corresponding to the facet to be processed is determined.
[0205] In an optional embodiment, based on the above-mentioned scheme, the following steps may also be performed: if there is overlap between the polygonal patches corresponding to the surfaces of each model of the virtual model, control the adjustment of the UV layout of the virtual model; based on the adjusted UV layout, control the virtual model to perform texture mapping and render it into the user interface.
[0206] In an optional embodiment, based on the aforementioned scheme, the above-mentioned control and adjustment of the UV layout of the virtual model can be achieved through the following steps: determining the degree of UV overlap based on the overlap detection results of the polygonal facets corresponding to the surfaces of each model of the virtual model; determining the UV layout adjustment strategy based on the UV overlap degree; and controlling the adjustment of the UV layout of the virtual model based on the UV layout adjustment strategy.
[0207] In the above steps, by determining the potential overlapping range of each triangular facet in each coordinate dimension, and determining the overlapping detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension, the possible overlapping triangular facets (i.e., overlapping detection facets) can be preliminarily screened out, and further overlapping detection is performed on these possible overlapping triangular facets to obtain the information of the overlapping UV of the object. This can not only reduce the errors caused by human factors and ensure the detection accuracy, but also optimize the overlapping detection task volume, improve the overlapping detection efficiency, and reduce the server processing overhead.
[0208] The bus 1030 is used to realize the connection between different components of the electronic device 1000 and may include a data bus, an address bus, and a control bus.
[0209] The electronic device 1000 can communicate with one or more external devices 1100 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 1040 .
[0210] The electronic device 1000 can communicate with one or more networks via the network adapter 1050. For example, the network adapter 1050 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. The network adapter 1050 can communicate with other modules of the electronic device 1000 via the bus 1030.
[0211] The electronic device 1000 may display a graphical user interface, etc., through the display 1060 .
[0212] although Figure 10 Not shown, other hardware and / or software modules may also be provided in the electronic device 1000, including but not limited to: a display, a microcode, a device driver, a redundant processor, an external disk drive array, a RAID (Redundant Arrays of Independent Disks) system, a tape drive, and a data backup storage system.
[0213] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0214] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure may be specifically implemented as the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system". Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0215] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An overlap detection method, characterized in that: The method comprises: Perform UV unfolding on the virtual model to be inspected to obtain polygonal patches corresponding to each surface of the virtual model, and then divide the polygonal patches corresponding to each surface of the virtual model into triangular patches; Determining the potential overlapping range of each triangular facet in each coordinate dimension, and determining the overlap detection facet corresponding to each triangular facet based on the potential overlapping range of each triangular facet in each coordinate dimension; wherein the range endpoints of the potential overlapping range of the overlap detection facet in the target coordinate dimension are located within the potential overlapping range of the corresponding triangular facet in the target coordinate dimension, and the target coordinate dimension is one of the coordinate dimensions; Each of the triangular facets is subjected to triangle overlap detection with the overlapping detection facet corresponding to each of the triangular facets to obtain the triangle overlap detection results of each of the triangular facets, and based on the triangle overlap detection results of each of the triangular facets, the overlapping detection results of the polygonal facets corresponding to each model surface of the virtual model are determined.
2. The method according to claim 1, characterized in that Determining the potential overlapping range of each of the triangular facets in each coordinate dimension includes: Obtaining the vertex coordinates of each triangular facet, and determining the midpoint coordinates of each triangular facet according to the vertex coordinates of each triangular facet; According to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet, the potential overlapping range of each triangular facet in each coordinate dimension is determined.
3. The method according to claim 2, characterized in that The acquiring the vertex coordinates of each triangular facet and determining the midpoint coordinates of each triangular facet according to the vertex coordinates of each triangular facet includes: Obtaining vertex coordinates of a face to be processed; the face to be processed is any face among the triangular face patches; Determine the coordinate mean of three vertices of the face to be processed in each coordinate dimension according to the vertex coordinates of the face to be processed; The coordinates of the midpoint of the face to be processed are determined according to the coordinate mean of the three vertices of the face to be processed in each coordinate dimension.
4. The method according to claim 2, characterized in that The determining, based on the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet, the potential overlapping range of each triangular facet in each coordinate dimension includes: Determine the distance between the midpoint and the vertex of each triangular facet according to the vertex coordinates of each triangular facet and the midpoint coordinates of each triangular facet; The potential overlapping range of each triangular facet in each coordinate dimension is determined according to the coordinates of the midpoint of each triangular facet and the distance between the midpoint and the vertex of each triangular facet.
5. The method according to claim 4, characterized in that Determining the potential overlapping range of each triangular facet in each coordinate dimension according to the midpoint coordinates of each triangular facet and the distance between the midpoint and the vertex of each triangular facet includes: Comparing the distances between the midpoint of a to-be-processed facet and each vertex of the to-be-processed facet to determine the maximum distance between the midpoint of the to-be-processed facet and the vertex; the to-be-processed facet is any facet among the triangular facets; Adding the coordinate value of the midpoint of the to-be-processed face in each coordinate dimension to the maximum distance between the midpoint of the to-be-processed face and the vertex, respectively, to obtain the upper limit of the range of the to-be-processed face in each coordinate dimension; Subtracting the coordinate value of the midpoint of the to-be-processed face in each coordinate dimension from the maximum distance between the midpoint of the to-be-processed face and the vertex, respectively, to obtain the lower limit of the range of the to-be-processed face in each coordinate dimension; According to the upper limit and lower limit of the range of the to-be-processed facets in each coordinate dimension, the potential overlapping range of the to-be-processed facets in each coordinate dimension is determined.
6. The method according to claim 1, characterized in that The potential overlap range includes an upper limit and a lower limit. Determining the overlap detection facets corresponding to the triangular facets according to the potential overlap range of the triangular facets in each coordinate dimension includes: For each of the coordinate dimensions, sorting the range endpoints corresponding to the potential overlapping range of each of the triangular facets to obtain a sorting result corresponding to each of the coordinate dimensions; the range endpoints include an upper limit and a lower limit; Determine, based on the sorting results corresponding to each coordinate dimension, a set of candidate detection facets corresponding to each triangular facet in each coordinate dimension; the set of candidate detection facets includes triangular facets whose range endpoints are arranged between an upper limit and a lower limit of a range of the corresponding triangular facet; The overlapping detection patches corresponding to each of the triangular patches are determined according to a set of candidate detection patches corresponding to each of the triangular patches in each coordinate dimension.
7. The method according to claim 6, characterized in that The determining, based on a set of candidate detection patches corresponding to each of the triangular patches in each coordinate dimension, an overlapping detection patch corresponding to each of the triangular patches includes: Merging candidate detection patch sets corresponding to the triangular patches in each coordinate dimension to obtain overlapping detection patch sets of the triangular patches; The overlapping detection patch corresponding to each of the triangular patches is determined according to the overlapping detection patch set of each of the triangular patches.
8. The method according to claim 7, characterized in that Each triangular facet of the virtual model corresponds to a unique serial number, and determining the overlapping detection facet corresponding to each triangular facet according to the overlapping detection facet set of each triangular facet includes: Comparing the serial number of the patch to be processed with the serial numbers of each patch in the overlap detection patch set of the patch to be processed; the patch to be processed is any patch in the triangular patches; performing a first filtering process on the overlap detection patch set of the to-be-processed patch according to a comparison result between the serial number of the to-be-processed patch and the serial numbers of each patch in the overlap detection patch set of the to-be-processed patch; Determine the overlapping detection patch corresponding to the to-be-processed patch according to the set of overlapping detection patches after the to-be-processed patch has been subjected to the first filtering process.
9. The method according to claim 8, characterized in that The step of performing a first filtering process on the overlap detection patch set of the to-be-processed patch based on a comparison result of the serial number of the to-be-processed patch with the serial numbers of each patch in the overlap detection patch set of the to-be-processed patch comprises: According to the comparison result of the serial number of the patch to be processed and the serial numbers of each patch in the overlap detection patch set of the patch to be processed, the patches with serial numbers smaller than the patch to be processed are filtered out from the overlap detection patch set of the patch to be processed.
10. The method according to claim 8, characterized in that The determining, based on the set of overlapping detection patches after the to-be-processed patch has been subjected to the first filtering process, the overlapping detection patches corresponding to the to-be-processed patch includes: Determine the polygonal patch to which the patch to be processed belongs and the polygonal patch to which each patch in the overlapping detection patch set after the patch to be processed has been subjected to the first filtering process; Obtaining a set of overlapping facets corresponding to the polygonal facets to which the facet to be processed belongs; the set of overlapping facets includes facets detected to be overlapping with the polygonal facets to which the facet to be processed belongs, among the polygonal facets corresponding to the surfaces of each model of the virtual model; performing a second filtering process on the overlapping detection patch set after the first filtering process of the patch to be processed, based on the overlapping patch set corresponding to the polygonal patch to which the patch to be processed belongs and the polygonal patches to which each patch in the overlapping detection patch set after the patch to be processed has undergone the first filtering process; The overlapping detection patch corresponding to the to-be-processed patch is determined according to the set of overlapping detection patches after the to-be-processed patch has been subjected to the second filtering process.
11. The method according to claim 10, characterized in that The second filtering process is performed on the overlapping detection patch set after the first filtering process of the face to be processed according to the overlapping patch set corresponding to the polygonal face to which the face to be processed belongs and the polygonal face to which each face in the overlapping detection patch set after the face to be processed has undergone the first filtering process, including: According to the overlapping patch set corresponding to the polygonal patch to which the patch to be processed belongs, the patches whose polygonal patches are located in the overlapping patch set are filtered out from the overlapping detected patch set after the patch to be processed has undergone the first filtering process.
12. The method according to claim 10, characterized in that The method further comprises: If overlap is detected between the patch to be processed and the overlapping detection patch corresponding to the patch to be processed, the polygonal patch to which the overlapping detection patch corresponding to the patch to be processed belongs is added to the overlapping patch set corresponding to the polygonal patch to which the patch to be processed belongs.
13. The method according to claim 1, wherein The performing triangle overlap detection on each of the triangular face patches and the overlap detection face patches corresponding to each of the triangular face patches to obtain the triangle overlap detection results of each of the triangular face patches includes: According to the vertex coordinates of the patch to be processed, an affine transformation matrix is constructed from a preset basic patch to the patch to be processed; the patch to be processed is any one of the triangular patches; the shape of the preset basic patch is an equilateral right triangle with the right-angled sides parallel to the coordinate axes; Determine the vertex coordinates of the overlap detection patch corresponding to the to-be-processed patch after inverse affine transformation according to the inverse matrix of the affine transformation matrix and the vertex coordinates of the overlap detection patch corresponding to the to-be-processed patch; The overlapping state between the patch to be processed and the overlapping detection patch corresponding to the patch to be processed is determined according to the vertex coordinates of the overlapping detection patch corresponding to the patch to be processed after inverse affine transformation and the vertex coordinates of the preset basic patch.
14. The method according to claim 1, wherein The method further comprises: If there is overlap between polygonal patches corresponding to the surfaces of each model of the virtual model, controlling to adjust the UV layout of the virtual model; Based on the adjusted UV layout, the virtual model is controlled to perform texture mapping and rendered into the user interface.
15. The method according to claim 14, characterized in that The controlling and adjusting the UV layout of the virtual model includes: Determining the UV overlap degree according to the overlap detection results of the polygonal patches corresponding to the surfaces of each model of the virtual model; Determining a UV layout adjustment strategy based on the UV overlap degree; According to the UV layout adjustment strategy, the UV layout of the virtual model is controlled and adjusted.
16. An overlap detection device, characterized in that: The device comprises: A UV unfolding module is used to perform UV unfolding on the virtual model to be detected to obtain polygonal patches corresponding to each surface of the virtual model, and to divide the polygonal patches corresponding to each surface of the virtual model into triangular patches; a patch determination module, configured to determine a potential overlapping range of each of the triangular patches in each coordinate dimension, and determine an overlap detection patch corresponding to each of the triangular patches based on the potential overlapping range of each of the triangular patches in each coordinate dimension; wherein an endpoint of the potential overlapping range of the overlap detection patch in the target coordinate dimension is located within the potential overlapping range of the corresponding triangular patch in the target coordinate dimension, where the target coordinate dimension is one of the coordinate dimensions; The overlapping detection module is used to perform triangle overlap detection on each of the triangular facets with the overlapping detection facets corresponding to each of the triangular facets, obtain the triangle overlap detection results of each of the triangular facets, and determine the overlapping detection results of the polygonal facets corresponding to each model surface of the virtual model based on the triangle overlap detection results of each of the triangular facets.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 15 is implemented.
18. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to perform the method according to any one of claims 1 to 15 by executing the executable instructions.