Grid data processing method, system and equipment of three-dimensional virtual model and medium

By extracting features, assigning probabilities, and calculating edge connection probabilities from the mesh data of a 3D model, a simplified set of triangles is generated, which solves the problems of slow loading and feature loss in 3D model processing, and achieves efficient and lightweight processing and high-efficiency operation.

CN120997443APending Publication Date: 2025-11-21SHANGHAI UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511078425.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In the existing 3D model processing technology, the original mesh data is loaded slowly, the vertex processing is unreasonable, resulting in the loss of key features of the model and inaccurate calculation of triangle probability, which cannot meet the needs of high-precision application scenarios.

Method used

By receiving raw grid data, performing feature extraction and probability assignment, constructing an extended graph, calculating edge connection probabilities, filtering candidate triangle sets, performing feature encoding and probability classification, generating a simplified triangle set, and transmitting it to the target device.

Benefits of technology

It achieves efficient and lightweight processing, reduces model data volume, improves operating efficiency, and ensures key geometric and topological features of the model, making it suitable for high-response-speed scenarios such as virtual assembly and simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997443A_ABST
    Figure CN120997443A_ABST
Patent Text Reader

Abstract

The invention provides a grid data processing method, system and device of a three-dimensional virtual model and a medium, and belongs to the technical field of three-dimensional virtual model processing, and the method specifically comprises the following steps: receiving original grid data; performing feature extraction and probability distribution on the vertex set; constructing an expansion graph through a k-nearest neighbor algorithm, calculating an edge connection probability, and multiplying the original adjacency matrix by the attention weight matrix to generate a simplified adjacency matrix; and performing feature coding and probability classification on the candidate triangle set, filtering and correcting non-manifold edges to obtain a simplified triangle set, and transmitting the simplified triangle set to target equipment. According to the invention, the lightweight processing of the original grid data is realized. On the premise that key geometric and topological characteristics of the model are not affected, the operation efficiency of the model on the target equipment is improved, the loading time is shortened, the display fluency is improved, and powerful support is provided for application of the three-dimensional model in scenes with high model response speed requirements such as virtual assembly, analogue simulation and real-time rendering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of three-dimensional virtual model processing technology, specifically relating to a method, system, device, and medium for processing mesh data of three-dimensional virtual models. Background Technology

[0002] In computer graphics and 3D modeling, mesh simplification is a key technique aimed at reducing the number of faces and vertices in a 3D model while preserving its appearance and shape as much as possible. This not only improves rendering efficiency and reduces computational resource requirements but also facilitates data transfer and storage. Raw mesh data typically consists of a large number of vertices, edges, and faces; directly using this data for processing or display can consume significant computational resources.

[0003] In the 3D model processing workflow of related technologies, loading the original mesh data into memory is often slow due to unreasonable resource allocation, resulting in inefficient use of computing resources. This is especially true when processing large-scale models, where excessively long loading times severely impact work efficiency. Simultaneously, in the vertex processing stage, vertex sampling methods fail to effectively extract vertex features and make appropriate selections based on model importance. For example, some methods may simply randomly sample vertices or rely solely on simple geometric rules, leading to the loss of key model features and severe model deformation in subsequent processing, failing to meet the requirements of applications demanding high model accuracy. Furthermore, the lack of consideration for the multimodal distribution of vertices fails to reflect the importance of vertices within the model.

[0004] Existing methods for feature encoding and probability calculation of triangle sets lack depth and accuracy. They typically only perform single-layer processing, resulting in inaccurate probability calculations and an inability to accurately select triangles useful to the model. Summary of the Invention

[0005] This invention provides a method for processing mesh data of 3D virtual models, achieving efficient and lightweight processing of raw mesh data. It significantly reduces the model's data volume, improving the model's running efficiency on target devices, reducing loading time, and enhancing display smoothness without affecting key geometric and topological features. This provides strong support for the application of 3D models in scenarios with high requirements for model response speed, such as virtual assembly, simulation, and real-time rendering.

[0006] The methods include: S101: Receive raw mesh data containing vertex coordinates, edges and faces, and cache the raw mesh data in the form of a vertex set; S102: Perform feature extraction and probability allocation on the vertex set, and randomly select a subset of the vertex set as sampling vertices according to the probability distribution; S103: Based on the sampling vertices and edge connection relationships of the subset, an extended graph is constructed using the k-nearest neighbor algorithm, edge connection probabilities are calculated, the original adjacency matrix is ​​multiplied by the attention weight matrix to generate a simplified adjacency matrix, and candidate triangle sets are extracted from the non-zero elements of the simplified adjacency matrix and the initial inclusion probability is calculated. S104: Perform feature encoding and probability classification on the candidate triangle set, filter and correct non-manifold edges to obtain a simplified triangle set; S105: Transmit the simplified triangle set and subsets into a standard grid format to the target device.

[0007] It should be further explained that step S101 specifically includes: By parsing the data header of the original mesh data, it is compared with the actual stored vertex coordinates, edge connection table, and face index table one by one, and data segments with missing fields are marked and skipped. A hash table is used to record the coordinates (x, y, z) of each vertex. If the same coordinate is recorded multiple times, only the vertex index of the first occurrence is retained. The degree of each vertex is counted by traversing the edge connection table, and vertices with a degree of 0 are filtered out and removed. Based on the spatial distribution of vertex coordinates, vertices are divided into multiple cubic spatial blocks, and the number of vertices in each block is controlled to be an integer multiple of the GPU thread bundle size; The partitioned vertex coordinates, edge connection indices, and face information are arranged in ascending order of vertex indices and converted into continuous vertex coordinates, edge indices, and face indices, taking advantage of the GPU's merged memory access feature.

[0008] It should be further noted that the feature extraction in step S102 calculates vertex features through the DevConv layer, using the following formula:

[0009] For each vertex The coordinate differences of the neighboring vertices are linearly transformed, and the maximum value is aggregated to generate the feature vector.

[0010] It should be further noted that in step S103, the attention weights are calculated by generating edge connection probabilities through a sparse self-attention layer: (2) Candidate edge generation will use the original adjacency matrix According to the attention weight matrix Multiply to generate a simplified adjacency matrix.

[0011] It should be further explained that step S103 specifically includes: The connection relationship between the vertex subset and the original edge is verified, and valid edges that connect both vertices of the vertex subset are selected, while invalid edges that cross subsets are excluded. Based on the effective edges, an improved k-nearest neighbor algorithm is used to construct an extended graph in the vertex subset, where the spatial distance between vertices and the geometric features of edges are considered simultaneously when selecting nearest neighbors; When calculating edge connectivity probabilities in the extended graph, the geometric constraints of the edges are defined to adjust the attention weights and generate a simplified adjacency matrix that includes geometric confidence. Extract a set of candidate triangles from the non-zero elements of the simplified adjacency matrix, eliminate candidates that contain invalid edges or geometrically conflicting edges, and calculate the initial inclusion probability based on the spatial synergy of adjacent triangles.

[0012] It should be further explained that step S104 specifically includes: Perform geometric validity checks on the candidate triangle set and remove invalid triangles whose three sides cannot form a closed triangle or have repeated sides; Extract the adjacency and spatial features of the candidate triangles to generate an initial feature description; The feature description is updated through three-layer iterative processing. In each layer of processing, the mean angle between the normal vectors of adjacent triangles or the mean angle between the normal vectors of adjacent features is introduced to adjust the feature weights. Based on the updated feature description, the final inclusion probability of each triangle is calculated through the Softmax layer. Triangles with probabilities lower than a preset threshold are filtered out, and triangles sharing edges are merged or isolated edges are deleted based on the retention status of adjacent triangles.

[0013] It should be further explained that step S105 specifically includes: Perform data integrity checks on the simplified triangle set and vertex subset, checking whether all triangle vertex indices exist in the vertex subset, and excluding invalid triangles with out-of-bounds indices. The verified triangle set and vertex subset are converted into OBJ mesh format, where vertex coordinates are stored in order and triangle faces reference vertices by index; Standard grid data is compressed into blocks to generate compressed data packets with block indexes; Compressed data packets are transmitted via the I / O interface, with a CRC checksum appended during transmission. If the receiving end fails to verify the data, it requests a retransmission of the corresponding data block.

[0014] This application also provides a mesh data processing system for a three-dimensional virtual model, the system comprising: The loading control module is used to receive raw mesh data containing vertex coordinates, edges and faces, cache the raw mesh data in the form of a vertex set, and transmit it to the point sampling module; The point sampling module is used to extract features and assign probabilities to the vertex set. It randomly selects a subset of the vertex set as sampling vertices according to the probability distribution and transmits them to the edge prediction module. The edge prediction module constructs an extended graph based on the sampling vertices and edge connection relationships of a subset using the k-nearest neighbor algorithm, calculates the edge connection probability, multiplies the original adjacency matrix with the attention weight matrix to generate a simplified adjacency matrix, extracts a set of candidate triangles from the non-zero elements of the simplified adjacency matrix and calculates the initial inclusion probability, and then transmits it to the face classification module. The face classification module is used to perform feature encoding and probability classification on the candidate triangle set, filter and correct non-manifold edges, and obtain a simplified triangle set. The storage and transmission module is used to transmit the simplified triangle set and subsets into a standard grid format to the target device.

[0015] According to another embodiment of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of a mesh data processing method for the three-dimensional virtual model.

[0016] According to another embodiment of this application, a storage medium is also provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the mesh data processing method for the three-dimensional virtual model.

[0017] As can be seen from the above technical solutions, the present invention has the following advantages: The mesh data processing method for 3D virtual models provided by this invention loads the original mesh data and caches it according to the vertex sequence. Features are extracted from the original vertex set, and a reasonable data distribution is generated by using a fully connected layer to form inclusion probabilities. A subset is then randomly selected based on this distribution. This method reduces the amount of data and alleviates the computational burden of subsequent processing steps while preserving the key geometric features of the model. The random selection method ensures the randomness and rationality of sampling, allowing the key features of the model to be preserved. An extended graph is constructed using the k-nearest neighbor algorithm, effectively avoiding isolated vertices and maintaining the integrity of the model's topology. By calculating edge connection probabilities, a simplified adjacency matrix is ​​generated, and candidate triangle sets and initial inclusion probabilities are extracted, further narrowing the data processing scope, improving processing efficiency, and ensuring that the model's topology and geometry are not severely affected while reducing the number of edges.

[0018] The candidate triangle set is iteratively updated using feature encoding, and the final inclusion probability is calculated using a Softmax layer. This accurately selects triangles that contribute significantly to the model's geometry and topology, effectively reducing the model's data volume. Non-manifold edges are corrected based on adjacency relationships to ensure the quality of the simplified model's surface and avoid issues such as cracks and overlaps. Data is transmitted to the target device via I / O interfaces, enabling the transfer of model data from the processing end to the user end, allowing the lightweight model to function effectively in real-world applications. Attached Figure Description

[0019] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A flowchart illustrating the mesh data processing method for a 3D virtual model; Figure 2 A simplified diagram of a folded triangle; Figure 3 Simplified flowchart for triangle folding; Figure 4 This is a schematic diagram of mesh data processing for a 3D virtual model. Figure 5 This is a schematic diagram of an electronic device. Detailed Implementation

[0021] The mesh data processing method for 3D virtual models provided by this invention can solve the real-time interaction bottleneck problem caused by the large amount of data in high-precision 3D models in digital twin systems. The method does not destroy key assembly features during simplification and does not cause defects such as topological mismatch. By constructing a differentiable feature perception network to dynamically identify key areas such as mating surfaces and positioning holes in the model, and combining incremental topology optimization algorithms to achieve differentiated simplification under assembly semantic guidance, the method reduces the amount of model data while ensuring the geometric accuracy of assembly parameters, and eliminates problems such as virtual posture adjustment errors and motion interference detection failures caused by oversimplification. This provides high-fidelity, low-latency digital twin model support for industrial equipment.

[0022] The following describes in detail the mesh data processing method for the three-dimensional virtual model involved in this application. Specific details, such as particular system structures and techniques, are presented for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details.

[0023] It should be understood that, when used in this specification, terms include indicating the presence of a described feature, integral, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. The terms include, encompass, have, and variations thereof mean including but not limited to, unless otherwise specifically emphasized.

[0024] The statements such as "one embodiment" or "some embodiments" described in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the statements such as "in one embodiment," "in some embodiments," "in other embodiments," and "in still other embodiments" in this application do not necessarily refer to the same embodiment, but rather mean one or more, but not all, embodiments, unless otherwise specifically emphasized.

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

[0026] Please see Figure 1 The diagram shows a flowchart of a mesh data processing method for a 3D virtual model in a specific embodiment. The method includes: S101: Receives raw mesh data containing vertex coordinates, edges and faces, and caches the raw mesh data in the form of a vertex set.

[0027] In some embodiments, the storage module acts as a data receiving entry point, acquiring the raw mesh data of the 3D model through a data interface. This data includes the model's vertex coordinates, edge connectivity, and face information. After acquiring the data, the storage module temporarily stores it in a cache space according to the vertex order, so that the subsequent calculation and control module can quickly retrieve and transmit the data. During this process, the data storage format and order must follow specific specifications to ensure data integrity and accessibility.

[0028] This embodiment is based on the principles of computer storage and data transmission. The storage module uses its own storage medium to provide temporary storage space for the original mesh data. The computing control module communicates with the storage module through a bus protocol. When data needs to be transmitted, it retrieves the data from the cache according to the vertex set and transmits it to the point sampling module according to the predetermined data reading logic.

[0029] In some specific embodiments, step S101 specifically includes the following steps: S1011: By parsing the data header of the original mesh data, which records information such as the number of vertices, edges, and faces, the data header is compared with the actual stored vertex coordinates, edge connection table, and face index table one by one. Data segments with missing fields are marked and skipped to prevent invalid data from entering the subsequent processing flow.

[0030] Fields may include, but are not limited to: vertices without coordinates, edges without connected vertex indexes, and faces without three vertex indexes.

[0031] S1012: A hash table is used to record the coordinates (x, y, z) of each vertex. If the same coordinate is recorded multiple times, only the vertex index of the first occurrence is retained to remove duplicate vertices. The degree of each vertex is counted by traversing the edge connection table, that is, the number of edges connected to the vertex. Vertices with a degree of 0 are filtered out and removed to reduce the amount of processing of invalid vertices in subsequent calculations.

[0032] S1013: Based on the spatial distribution of vertex coordinates, such as the minimum / maximum values ​​of the x, y, and z axes, vertices are divided into multiple cubic spatial blocks. The number of vertices in each block is controlled to be an integer multiple of the GPU thread bundle size, which facilitates GPU parallel computing.

[0033] S1014: The segmented vertex coordinates, edge connection indices, and face information are arranged in ascending order by vertex index, and converted into continuous vertex coordinates, edge indices, and face indices. By utilizing the GPU's merged memory access feature, the data reading latency is reduced and the data acquisition efficiency of the point sampling module is improved.

[0034] As can be seen, the data integrity verification algorithm in this embodiment compares the data header information, namely the number of vertices, edges, and faces, with the actual length of the stored vertex coordinate array. If the lengths do not match, the data is determined to be missing.

[0035] In this embodiment, a hash table can be built using vertex coordinates (x, y, z) as the key. When the key is repeated, only the index of the first vertex is retained, achieving duplicate detection with an O(1) time complexity. The edge connection array is traversed, and the degree of each vertex is counted, that is, the number of edges that the vertex is the starting or ending point of. Vertices with a degree of 0 are determined to be isolated vertices.

[0036] This embodiment provides a stable and orderly data foundation, which facilitates rapid retrieval and transmission, reduces confusion and errors during data reading and transmission, and improves data processing efficiency.

[0037] S102: Perform feature extraction and probability allocation on the vertex set, and randomly select a subset of the vertex set as sampling vertices according to the probability distribution.

[0038] In some embodiments, feature extraction is performed using GPU parallel computing units. Specifically, the DevConv layer linearly transforms the coordinate differences of the neighboring vertices of each vertex, and the maximum values ​​are aggregated to generate the feature vector of that vertex.

[0039] The feature vectors are processed by a fully connected layer to generate a probability for each vertex. The probabilities of all vertices together constitute a multimodal distribution. Based on this probability distribution, the calculation control module randomly selects a subset of vertices from the original vertex set to form a vertex subset, which is then transmitted to the edge prediction module.

[0040] As can be seen, this embodiment leverages the powerful parallel computing capabilities of the GPU to efficiently process a large amount of vertex data. The convolutional layers extract local features for each vertex by calculating its neighborhood information; the fully connected layers then assign probabilities to vertices based on these extracted features, with the probability reflecting the likelihood of a vertex being retained in the lightweight model. Random sampling based on probability distributions ensures that more important vertices are more likely to be retained, thus reducing the number of vertices while preserving the model's key features. This effectively reduces the number of vertices and the amount of data without losing the model's main geometric features, avoiding feature loss or distortion caused by fixed sampling rules.

[0041] S103: Based on the sampling vertices and edge connection relationships of the subset, an extended graph is constructed using the k-nearest neighbor algorithm, edge connection probabilities are calculated, the original adjacency matrix is ​​multiplied by the attention weight matrix to generate a simplified adjacency matrix, candidate triangle sets are extracted from the non-zero elements of the simplified adjacency matrix, and the initial inclusion probability is calculated.

[0042] In some embodiments, an extended graph is constructed in a subset of vertices based on the k-nearest neighbor algorithm to avoid the occurrence of isolated vertices and ensure the integrity of the model's topology.

[0043] The GPU is used to perform sparse matrix operations and self-attention calculations to generate edge connection probabilities. The original adjacency matrix and the attention weight matrix are multiplied according to a specific rule to obtain a simplified adjacency matrix. A set of candidate triangles is extracted from the non-zero elements of the simplified adjacency matrix, and an initial inclusion probability is calculated for each candidate triangle for subsequent filtering. The set of candidate triangles and their initial probabilities are then transmitted to the face classification module.

[0044] The k-nearest neighbor algorithm in this embodiment constructs an expanded graph by finding the k nearest neighbors of each vertex, ensuring reasonable connections between vertices. Sparse matrix operations and self-attention calculation are used to quantify the probability of edge connections between vertices, generating edge connection probabilities. The multiplication operation between the original adjacency matrix and the attention weight matrix can filter and simplify the original edge connection relationships based on the edge connection probabilities, resulting in a simplified adjacency matrix. Candidate triangles are extracted from the simplified adjacency matrix, and initial probabilities are calculated.

[0045] In this way, by constructing an extended graph and calculating edge connection probabilities, the number of edges can be reduced while maintaining the model's topological structure and geometry, avoiding model distortion caused by unreasonable edge connections. Simplifying the extraction of the adjacency matrix and candidate triangles further narrows the data processing scope and improves the efficiency of subsequent face classification.

[0046] S104: Perform feature encoding and probability classification on the candidate triangle set, filter and correct non-manifold edges to obtain the simplified triangle set.

[0047] In some embodiments, the GPU is used to perform graph convolution and classification inference operations. First, the features of the triangles are iteratively updated using TriConv layers. During the update process, the relative position encoding is generated by concatenating the maximum / minimum edge vectors and centroid coordinates of the triangles to enhance the representation of the triangle features. The features are then processed through three TriConv layers and a Softmax layer to calculate the final inclusion probability of each triangle. The calculation control module filters out triangles with low inclusion probabilities and retains triangles with higher probabilities based on a preset threshold. Based on the adjacency relationships of the triangles, non-manifold edges are corrected to ensure the continuity and rationality of the model surface, thereby obtaining a simplified set of triangles.

[0048] This embodiment utilizes graph convolution operations to continuously optimize the feature representation of triangles by aggregating and updating neighborhood information. Relative position encoding, combined with the triangle's own geometric information, enables the model to better distinguish the features of different triangles. A combination of three TriConv layers and a Softmax layer performs in-depth processing and probabilistic classification of triangle features, obtaining the final probability of each triangle retained in the simplified model. Threshold-based filtering and non-manifold edge correction select suitable triangles from the candidate triangles and repair anomalies in the model's topology, resulting in the final simplified triangle set. This further reduces the model's data volume while maintaining the integrity of its shape and structure. Non-manifold edge correction ensures the quality of the simplified model's surface, avoiding issues such as cracks and overlaps.

[0049] S105: Transmit the simplified triangle set and subsets into a standard grid format to the target device.

[0050] This embodiment serializes the simplified triangle set and vertex subset obtained from the previous steps according to a standard mesh format, that is, converts the data into a format that the target device can recognize and parse. After serialization, the data is transmitted to the target device through the I / O interface. During the transmission process, the corresponding communication protocol is followed to ensure that the data is delivered to the target device accurately.

[0051] Here, the data is serialized into a standard mesh format, ensuring the compatibility and universality of the lightweight model across different devices and software, facilitating loading, display, and further processing on target devices. Through I / O interface transmission, model data is transferred from the processing end to the user end, enabling the lightweight model to function in real-world applications such as 3D visualization and virtual assembly.

[0052] In one embodiment of the present invention, based on step S103, the following will provide a possible embodiment and its specific implementation will be described in a non-limiting manner. Step S103 specifically includes: S1031: Verify the connection relationship between the vertex subset and the original edge, filter out valid edges that connect both ends of the vertex subset, and exclude edges that cross subsets or are invalid.

[0053] S1032: Based on effective edges, an improved k-nearest neighbor algorithm is used to construct an extended graph in the vertex subset. When selecting nearest neighbors, the spatial distance between vertices and the geometric features of edges are considered simultaneously. The geometric features of edges may include edge length and orientation consistency.

[0054] S1033: When calculating edge connectivity probabilities in an extended graph, the geometric constraints of the edges are defined to adjust the attention weights and generate a simplified adjacency matrix that includes geometric confidence.

[0055] Geometric constraints involve minimum side length thresholds and maximum angle deviations.

[0056] S1034: Extract a set of candidate triangles from the non-zero elements of the simplified adjacency matrix, eliminate candidates containing invalid edges or geometrically conflicting edges, and calculate the initial inclusion probability based on the spatial synergy of adjacent triangles.

[0057] It should be noted that step S103 involves traversing the original edge connection relationships and checking whether both vertices of each edge are in the vertex subset, that is, the vertex index exists in the index list of the vertex subset at the same time.

[0058] If one of the vertices is not present, it is marked as an invalid edge and removed to ensure that the edges of the expanded graph are only associated with the currently sampled vertex, thus avoiding interference from cross-subset edges.

[0059] This embodiment, based on the traditional k-NN algorithm, first calculates the Euclidean distance from each vertex in the vertex subset to other vertices, and simultaneously calculates the directional consistency of the edges. Here, the cosine of the angle between the vector and the average vector of the vertex's neighborhood is considered. The weighted sum of the distance and directional consistency scores is used as the comprehensive score for nearest neighbor selection. Vertices that are close in distance and have the same direction are selected as nearest neighbors to avoid redundant connections caused by relying solely on distance.

[0060] In calculating attention weights, in addition to vertex feature similarity, geometric constraints on edges are introduced: if the edge length is less than a preset minimum length threshold or the directional deviation between the edge and its neighboring edges exceeds a preset angle, the attention weight of that edge is reduced; finally, the adjusted weights are multiplied by the original adjacency matrix to generate a simplified adjacency matrix, where the weights of non-zero elements represent the confidence of edge connections.

[0061] Combining the above step S1034, when extracting candidate triangles from the non-zero elements of the simplified adjacency matrix, we check whether all three sides of the triangle are valid sides, that is, the two vertices are within the vertex subset and there is no geometric conflict. This can be understood as the three sides not being able to form a closed triangle, and candidates that do not meet the conditions are eliminated. Then, we traverse the candidate triangles and count the number of their adjacent triangles, that is, the number of sides shared with other candidate triangles. The more sides shared, the higher the initial inclusion probability.

[0062] Step S1031 of this embodiment effectively removes cross-subset or invalid edges by verifying the connection relationship between the vertex subset and the original edge, ensuring that subsequent processing is based on accurate and relevant edge information and avoiding simplification errors caused by incorrect or irrelevant edges. Step S1032 uses an improved k-nearest neighbor algorithm that comprehensively considers the spatial distance of vertices and the geometric features of edges, making the expanded graph construction more consistent with the actual geometric shape of the model, enhancing the structural rationality and connectivity of the simplified model, and improving the quality of model simplification. Step S1033 introduces geometric constraints to adjust attention weights, ensuring that the edge connection probability calculation considers geometric rationality, effectively avoiding the generation of edges that do not meet geometric requirements, and improving the geometric accuracy and visual effect of the simplified model. Step S1034, when extracting the candidate triangle set from the simplified adjacency matrix, triangles with invalid or conflicting edges are removed, and the initial probability is calculated based on spatial synergy, ensuring that the candidate triangle set is of high quality and highly reliable.

[0063] In one embodiment of the present invention, based on step S104, the following will provide a possible embodiment and its specific implementation will be described in a non-limiting manner. Step S104 specifically includes: S1041: Perform geometric validity checks on the candidate triangle set and remove invalid triangles whose three sides cannot form a closed triangle or have repeated sides; S1042: Extract the adjacency features and spatial features of candidate triangles to generate initial feature descriptions; It should be noted that the adjacency features can be the number of adjacent triangles or the difference rate of shared side lengths, while the spatial features can be the centroid coordinates and the normal vector direction angle.

[0064] S1043: The feature description is updated through three-layer iterative processing. The mean angle between the normal vectors of the adjacent triangles is introduced in each layer of processing to adjust the feature weights. S1044: Based on the updated feature description, calculate the final inclusion probability of each triangle through the Softmax layer, filter triangles with probabilities lower than a preset threshold, and merge triangles with shared edges or delete isolated edges according to the retention status of adjacent triangles.

[0065] It should be noted that this embodiment iterates through the edge information of candidate triangles, checks whether the length of each edge satisfies the condition that the sum of any two sides of the triangle is greater than the third side, and counts the occurrence frequency of each edge in the candidate set, eliminating triangles that violate the rules to ensure that the triangles processed subsequently are all valid geometric units. The adjacency feature is achieved by counting the number of adjacent triangles between the candidate triangle and other triangles in the extended graph, and calculating the difference rate of its side length with the triangle at the other end of the shared edge; the spatial feature is achieved by calculating the average coordinates of the three vertices of the triangle and the cross product of the three edge vectors, and then converting them into the angle with the x-axis.

[0066] Optionally, in the three-layer iterative processing of step S1043, the first layer calculates and collects the normal vectors of all adjacent triangles based on the initial features and calculates the average value of their included angles; the second layer generates intermediate features by adjusting the proportion of collaborative parameters and adjacent parameters; the third layer adjusts the feature weights of features with large differences in normal vector direction angles according to the intermediate features to obtain the updated feature description.

[0067] In this embodiment, the Softmax layer maps the updated feature description to a probability value between 0 and 1, with higher probabilities indicating that the feature should be retained. During filtering, triangles with probabilities below the threshold are removed. When correcting non-manifold edges, if an edge is shared by only one retained triangle, the edge is either merged or deleted based on the normal direction of the adjacent retained triangle.

[0068] This embodiment effectively removes invalid triangles (those whose sides cannot form a closed triangle or have repeated edges) by performing geometric validity checks on the candidate triangle set. This improves the quality and reliability of the triangle set. Adjacency and spatial features of candidate triangles are extracted to generate initial feature descriptions, reflecting the triangles' positions, shapes, and relationships within the model, thus improving the accuracy of model simplification. The feature descriptions are updated through a three-layer iterative process, and the mean angle between the normal vectors of adjacent triangles is introduced to adjust feature weights, gradually refining and optimizing the feature representation of triangles. Based on the updated feature descriptions, the final inclusion probability of each triangle is calculated using a Softmax layer, and triangles sharing edges are merged or isolated edges are deleted based on the retention status of adjacent triangles. This achieves precise triangle selection and ensures the connectivity and integrity of the simplified model. By filtering out low-probability triangles and performing reasonable merging or deletion operations based on adjacency relationships, the number of triangles in the model is effectively reduced, lowering model complexity and improving the simplification effect and running efficiency.

[0069] In one embodiment of the present invention, based on step S105, the following will provide a possible embodiment and its specific implementation will be described in a non-limiting manner. Step S105 specifically includes: S1051: Perform data integrity checks on the simplified triangle set and vertex subset, check whether all triangle vertex indices exist in the vertex subset, and exclude invalid triangles with out-of-bounds indices; S1052: Convert the verified triangle set and vertex subset into OBJ mesh format, where vertex coordinates are stored in order and triangle faces reference vertices by index; S1053: Compress standard grid data into blocks to generate compressed data packets with block indexes; S1054: Transmits compressed data packets via the I / O interface, attaches a CRC checksum during transmission, and requests retransmission of the corresponding data block if the receiving end fails the checksum verification.

[0070] This embodiment vertex index verification is performed on the simplified triangle set and vertex subset to ensure the validity of the triangle vertex indexes and avoid issues such as index out-of-bounds errors. This guarantees data consistency and accuracy. Converting the verified triangle set and vertex subset into OBJ mesh format improves data organization efficiency and readability. Block compression of standard mesh data effectively reduces data volume and improves transmission efficiency. Attaching a CRC checksum when transmitting compressed data packets through the I / O interface effectively detects data integrity during transmission, ensuring data accuracy and improving transmission reliability and efficiency.

[0071] Furthermore, as a refinement and extension of the specific implementation method of the above-mentioned three-dimensional virtual model mesh data processing embodiment, in order to fully explain the specific implementation process in this embodiment, the three-dimensional virtual model mesh data processing method can also use a triangle folding algorithm to process the three-dimensional virtual model, perform lightweight processing on the three-dimensional virtual model of the entire assembly unit, and reduce the data volume of the model. For example... Figure 2 and Figure 3 As shown, the model is lightweighted using the triangle folding method.

[0072] The triangle folding method in this embodiment refers to the deletion of geometric information using triangular faces as basic elements during the simplification process of the model. As shown in the figure, the triangles formed by the three points Vi, Vj, and Vk of the source model are merged into one point, thereby deleting its adjacent triangles. The size of the simplified model does not change, ensuring the consistency of the simplification.

[0073] The specific steps for implementing the triangle folding method are as follows: S301: Traverse the model to be simplified and the relationships between its points; S302: Classify the points in the model into boundary points and non-boundary points; S303: Calculate the cost of triangle folding based on the error matrix; S304: Based on the folding cost information of the triangle, differentiate to determine the reasonable existence of the new vertex. If it does not exist, replace it with a new vertex. S305: Calculate the folding error of each triangle and sort them. Fold the triangle with the smallest folding error to obtain the new vertex position. S306: If the simplification requirement is met, end the algorithm; if the requirement is not met, go to step S305 and continue simplification.

[0074] Once the algorithm iteration is complete, the constructed 3D assembly line scene will run more smoothly on the network without any lag, thus improving the model responsiveness of the entire production line model and having almost no impact on the virtual-real interaction effect.

[0075] This embodiment obtains the vertex coordinates, edge connections, and face topology of the model through traversal, avoiding the omission of key geometric features. Boundary points are located on the surface edges of the model and directly affect the model's outline, requiring special protection to avoid topological distortion after simplification; non-boundary points are located inside the model and can be simplified appropriately. After classification, the folding strategy can be adjusted accordingly to ensure boundary integrity. The error matrix quantifies the degree of influence of triangle folding on the model's geometry; the higher the folding cost, the greater the model deformation after folding the triangle. The error matrix guides the folding order, prioritizing the folding of triangles with lower costs to preserve key features.

[0076] By differentiating the folding cost function, we find new vertex positions that minimize the folding error. If the calculated new vertex positions cause geometric distortion, we reselect vertex positions to ensure the topology of the folded model is reasonable. We sort the vertex positions by folding error from smallest to largest, prioritizing triangles with the least impact on the model, gradually reducing model complexity and ensuring minimal loss of geometric features during simplification. After each fold, we update vertex positions and adjacency relationships to provide accurate data for subsequent iterations.

[0077] By reducing the proportion of triangles by a preset number, the simplified result ensures that it meets data volume requirements while preserving key model features. Explicitly classifying boundary and non-boundary points, a higher error weight is applied to boundary points during folding to avoid boundary deformation, thus preserving the model outline better than traditional indiscriminate folding. Instead of using fixed mapping rules, the optimal new vertex position is calculated through differentiation, allowing for adaptive adjustment of the folded vertex positions, reducing geometric distortion, and making it suitable for lightweighting complex surface models.

[0078] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0079] The following are embodiments of a mesh data processing system for a three-dimensional virtual model provided in this disclosure. This system and the mesh data processing methods for three-dimensional virtual models described above belong to the same inventive concept. For details not described in detail in the embodiments of the mesh data processing system for three-dimensional virtual models, please refer to the embodiments of the mesh data processing methods for three-dimensional virtual models described above.

[0080] like Figure 4 As shown, the system includes: The loading control module 201 is used to receive raw mesh data containing vertex coordinates, edges and faces, cache the raw mesh data in the form of a vertex set, and transmit it to the point sampling module.

[0081] The point sampling module 202 is used to extract features and assign probabilities to the vertex set. It randomly selects a subset of the vertex set as sampling vertices according to the probability distribution and transmits them to the edge prediction module.

[0082] The edge prediction module 203 constructs an extended graph based on the sampling vertices and edge connection relationships of the subset using the k-nearest neighbor algorithm, calculates the edge connection probability, multiplies the original adjacency matrix with the attention weight matrix to generate a simplified adjacency matrix, extracts a set of candidate triangles from the non-zero elements of the simplified adjacency matrix and calculates the initial inclusion probability, and transmits it to the face classification module.

[0083] The face classification module 204 is used to perform feature encoding and probability classification on the candidate triangle set, filter and correct non-manifold edges, and obtain a simplified triangle set.

[0084] The storage and transmission module 205 is used to transmit the simplified triangle set and subsets into a standard grid format to the target device.

[0085] As an implementation method for the mesh data processing system of a 3D virtual model, it receives raw mesh data, including vertex coordinates, edge connectivity, and face information. The loading control module caches the data by vertex set and uses the bus to transmit the data to the point sampling module.

[0086] The point sampling module is implemented by using the GPU to perform graph neural network inference in parallel.

[0087] Here you can enter: the original vertex set The feature extraction method involves calculating vertex features using the DevConv layer, with the following formula: (1) Among them, the GPU processes each vertex The coordinate differences of neighboring vertices are linearly transformed, and the maximum value is aggregated to generate a feature vector. The GPU generates a probability distribution for each vertex through a fully connected layer, forming a multimodal distribution. Based on the probability distribution, a subset is randomly selected from the vertex set. The data is then transmitted to the edge prediction module via the bus. The output here is a subset of sampled vertices. and its characteristics.

[0088] The hardware implementation of the edge prediction module is based on GPU-based sparse matrix operations and self-attention calculations. The input is... And the original edge connection relationships. The processing flow is as follows: 1) Neighborhood expansion: GPUs utilize the k-nearest neighbor algorithm (k-NN) in... Building an extended graph Avoid isolated vertices.

[0089] 2) Attention weight calculation: The GPU generates edge connection probabilities through a sparse self-attention layer: (2) 3) Candidate edge generation: The GPU generates the original adjacency matrix. According to the attention weight matrix Multiply to generate a simplified adjacency matrix.

[0090] 4) Candidate triangle construction: The GPU starts from... Extracting candidate triangle sets from non-zero elements And calculate the initial inclusion probability. .

[0091] The output is: a set of candidate triangles. and its initial probability.

[0092] The hardware implementation of the face classification module is as follows: GPU performs graph convolution and classification inference.

[0093] Input: a set of candidate triangles The processing flow is as follows: 1) Feature Encoding: The GPU iteratively updates the triangle features through the TriConv layer: (3) Among them, relative position encoding It is generated by splicing together the maximum / minimum side vectors of the triangle and the coordinates of the centroid.

[0094] 2) Probabilistic Classification: The GPU calculates the final containment probability of each triangle through three TriConv layers and a Softmax layer. .

[0095] 3) Filtering and Correction: Calculate the filtering function of the control module. The triangle is obtained, and the non-manifold edges are corrected based on the adjacency relationship.

[0096] Output: The simplified set of triangles .

[0097] Storage and transfer module will and Serialized into a standard mesh format (such as OBJ) and transmitted to the target device via the I / O interface.

[0098] It should be noted that in this embodiment, the initialization phase loads the raw data into memory and allocates GPU computing resources. Point sampling, edge prediction, and then face classification are executed sequentially, with intermediate data transmitted in real time via the bus. If a module times out, the computing control module restarts that module and reallocates resources.

[0099] This embodiment achieves high-precision mesh simplification in a single traversal for the first time by working collaboratively with a graph neural network and a sparse self-attention mechanism. Through the probabilistic sampling and classification mechanism of the neural network, computational complexity is reduced and efficiency is improved while maintaining the topological structure. The edge prediction module based on sparse attention weights forces the simplified edge connections to inherit the original topological relationships by combining the original adjacency matrix with dynamic attention weights. This method effectively avoids the non-manifold errors caused by ignoring original connectivity in traditional methods, while supporting real-time processing of large-scale meshes. Feature encoding of candidate triangles is performed through the TriConv layer, combined with a multi-task loss function, dynamically filtering low-quality triangles while retaining key geometric features, ensuring the visual fidelity of the simplified mesh. End-to-end training supports task-driven optimization. By adjusting the loss function, simplified meshes focused on preserving specific geometric properties can be generated, overcoming the limitations of traditional methods that rely solely on fixed heuristic rules. A distributed lightweight architecture is proposed, supporting multi-server collaborative computing. By transmitting mesh blocks to computing nodes for parallel point sampling and edge prediction, and then aggregating them to the main server for global filtering, the processing speed is linearly related to the mesh size, making it suitable for large-scale digital twin scenarios.

[0100] like Figure 5 As shown, this application also provides an electronic device, including a display module 103, a memory 102, a processor 101, and a computer program stored in the memory and executable on the processor 101. When the processor 101 executes the program, it implements the steps of a mesh data processing method for a three-dimensional virtual model.

[0101] In embodiments of the present invention, electronic devices include, but are not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments described and / or claimed herein.

[0102] In this embodiment, processor 101 may be implemented using at least one of an application-specific integrated circuit, a programmable logic device, a field-programmable gate array, a processor, a controller, a microcontroller, a microprocessor, or an electronic unit designed to perform the functions described herein. In some cases, such an implementation may be implemented within a controller. For software implementation, implementations such as processes or functions may be implemented with separate software modules that allow the performance of at least one function or operation. Software code may be implemented by a software application (or program) written in any suitable programming language, and the software code may be stored in memory and executed by the controller.

[0103] The display module 103 is used to display information input by the user or information provided to the user. The display module 103 may include a display panel, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like.

[0104] The memory 102 can be used to store software programs and various data. The memory 102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0105] This application also provides a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the mesh data processing method for the three-dimensional virtual model.

[0106] The storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0107] In a storage medium, a readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0108] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing mesh data of a three-dimensional virtual model, characterized in that, The methods include: S101: Receive raw mesh data containing vertex coordinates, edge and face information, and cache the raw mesh data in the form of a vertex set; S102: Perform feature extraction and probability allocation on the vertex set, and randomly select a subset of the vertex set as sampling vertices according to the probability distribution; S103: Based on the sampling vertices and edge connection relationships of the subset, an extended graph is constructed using the k-nearest neighbor algorithm, edge connection probabilities are calculated, the original adjacency matrix is ​​multiplied by the attention weight matrix to generate a simplified adjacency matrix, and candidate triangle sets are extracted from the non-zero elements of the simplified adjacency matrix and the initial inclusion probability is calculated. S104: Perform feature encoding and probability classification on the candidate triangle set, filter and correct non-manifold edges to obtain a simplified triangle set; S105: Transmit the simplified triangle set and subsets into a standard grid format to the target device.

2. The mesh data processing method for a three-dimensional virtual model according to claim 1, characterized in that, Step S101 specifically includes: Parse the header of the raw mesh data and compare it with the actual stored vertex coordinates, edge connection table, and face index table one by one, marking and skipping data segments with missing fields; A hash table is used to record the coordinates (x, y, z) of each vertex. If the same coordinate is recorded multiple times, only the vertex index of the first occurrence is retained. The degree of each vertex is counted by traversing the edge connection table, and vertices with a degree of 0 are filtered out and removed. Based on the spatial distribution of vertex coordinates, vertices are divided into multiple cubic spatial blocks, and the number of vertices in each block is controlled to be an integer multiple of the GPU thread bundle size; The partitioned vertex coordinates, edge connection indices, and face information are arranged in ascending order of vertex indices and converted into continuous vertex coordinates, edge indices, and face indices, taking advantage of the GPU's merged memory access feature.

3. The mesh data processing method for a three-dimensional virtual model according to claim 1, characterized in that, The feature extraction in step S102 calculates vertex features using the DevConv layer, with the following formula: For each vertex The coordinate differences of the neighboring vertices are linearly transformed, and the maximum value is aggregated to generate the feature vector.

4. The mesh data processing method for a three-dimensional virtual model according to claim 1, characterized in that, In step S103, the attention weights are calculated by generating edge connection probabilities through a sparse self-attention layer: (2) Candidate edge generation will use the original adjacency matrix According to the attention weight matrix Multiply to generate a simplified adjacency matrix.

5. The mesh data processing method for a three-dimensional virtual model according to claim 1, characterized in that, Step S103 specifically includes: The connection relationship between the vertex subset and the original edge is verified, and valid edges that connect both vertices of the vertex subset are selected, while invalid edges that cross subsets are excluded. Based on the effective edges, an improved k-nearest neighbor algorithm is used to construct an extended graph in the vertex subset, where the spatial distance between vertices and the geometric features of edges are considered simultaneously when selecting neighbors; When calculating edge connectivity probabilities in the extended graph, the geometric constraints of the edges are defined to adjust the attention weights and generate a simplified adjacency matrix that includes geometric confidence. Extract a set of candidate triangles from the non-zero elements of the simplified adjacency matrix, eliminate candidates that contain invalid edges or geometrically conflicting edges, and calculate the initial inclusion probability based on the spatial synergy of adjacent triangles.

6. The mesh data processing method for a three-dimensional virtual model according to claim 1, characterized in that, Step S104 specifically includes: Perform geometric validity checks on the candidate triangle set and remove invalid triangles whose three sides cannot form a closed triangle or have repeated sides; Extract the adjacency and spatial features of the candidate triangles to generate an initial feature description; The feature description is updated through three-layer iterative processing. In each layer of processing, the mean angle between the normal vectors of the adjacent triangles is introduced to adjust the feature weights. Based on the updated feature description, the final inclusion probability of each triangle is calculated through the Softmax layer. Triangles with probabilities lower than a preset threshold are filtered out, and triangles sharing edges are merged or isolated edges are deleted based on the retention status of adjacent triangles.

7. The mesh data processing method for a three-dimensional virtual model according to claim 1, characterized in that, Step S105 specifically includes: Perform data integrity checks on the simplified triangle set and vertex subset, checking whether all triangle vertex indices exist in the vertex subset, and excluding invalid triangles with out-of-bounds indices. Convert the verified triangle set and vertex subset into OBJ mesh format, where vertex coordinates are stored in order and triangle faces reference vertices by index; Standard grid data is compressed into blocks to generate compressed data packets with block indexes; Compressed data packets are transmitted via the I / O interface, with a CRC checksum appended during transmission. If the receiving end fails to verify the data, it requests a retransmission of the corresponding data block.

8. A mesh data processing system for a three-dimensional virtual model, characterized in that, The method is used to implement the mesh data processing method for a three-dimensional virtual model as described in any one of claims 1 to 7; The system includes: The loading control module is used to receive raw mesh data containing vertex coordinates, edges and faces, cache the raw mesh data in the form of a vertex set, and transmit it to the point sampling module; The point sampling module is used to extract features and assign probabilities to the vertex set. It randomly selects a subset of the vertex set as sampling vertices according to the probability distribution and transmits them to the edge prediction module. The edge prediction module constructs an extended graph based on the sampling vertices and edge connection relationships of a subset using the k-nearest neighbor algorithm, calculates the edge connection probability, multiplies the original adjacency matrix with the attention weight matrix to generate a simplified adjacency matrix, extracts a set of candidate triangles from the non-zero elements of the simplified adjacency matrix and calculates the initial inclusion probability, and then transmits it to the face classification module. The face classification module is used to perform feature encoding and probability classification on the candidate triangle set, filter and correct non-manifold edges, and obtain a simplified triangle set. The storage and transmission module is used to transmit the simplified triangle set and subsets into a standard grid format to the target device.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the mesh data processing method for the three-dimensional virtual model as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the mesh data processing method for the three-dimensional virtual model as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Colored lamp geometric feature recognition method based on graph neural network

    CN120912909A

  • A color lamp geometric feature recognition method based on a graph neural network

    CN120912909B