A method, system, device and storage medium supporting lightweight processing and lossless compression of multi-source three-dimensional models

Through format compatibility inspection, geometric structure analysis and lossless compression technology, the lightweight and lossless compression problems of three-dimensional models are solved, efficient data processing and cross-platform compatibility are achieved, and storage and transmission costs are reduced, making it suitable for mobile devices and network-constrained environments.

CN119396785BActive Publication Date: 2025-08-26LUCULENT SMART TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510014482.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-08-26
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

The prior art cannot efficiently and accurately realize the lightweight processing and lossless compression of three-dimensional models, especially in the processing of multi-source three-dimensional models, which have data redundancy and compatibility problems.

Method used

Through format compatibility inspection, geometric structure analysis, texture characteristics and material attribute inspection, combined with curvature information and Euclidean distance, redundant vertices were removed, the model structure was simplified by using quadratic error measurement algorithm and edge folding technology, and lossless compression was performed using Draco compression algorithm and prediction coding technology.

Benefits of technology

Significantly reduce the size of three-dimensional model files, improve loading speed and real-time rendering efficiency, enhance cross-platform compatibility, reduce storage space requirements and data transmission energy consumption, and conform to the concept of green computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396785B_ABST
    Figure CN119396785B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for supporting lightweight processing and lossless compression of multi-source three-dimensional models, which relates to the field of three-dimensional technology, including: performing format compatibility check on the imported three-dimensional model, and analyzing the geometric structure, texture characteristics and material properties of the model; using a quadratic error metric algorithm and edge folding to simplify the geometric structure of the three-dimensional model, optimizing the simplified model through edge segmentation operations to obtain a lightweight model; using a data compression algorithm to compress the geometric data of the lightweight model, and compressing the texture data through predictive coding to complete the lossless compression of the three-dimensional model. The method of the present invention significantly improves the loading speed and real-time rendering efficiency by reducing the file size of the three-dimensional model and optimizing the texture compression algorithm. The lossless compression technology ensures that high-quality visual effects are maintained during the lightweight process, and the lightweight model reduces storage space requirements and also reduces energy consumption by reducing data transmission and processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional technology, and specifically to a method, system, device and storage medium that support lightweight processing and lossless compression of multi-source three-dimensional models. Background Art

[0002] In the field of 3D modeling and simulation, the application of 3D models is becoming increasingly widespread. However, due to the diversity (multi-source) and complexity of 3D model data sources, as well as the huge amount of model data, how to efficiently and accurately achieve lightweight processing and lossless compression of 3D models is a serious problem that continues to plague the entire industry. Therefore, lightweight processing and lossless compression technology for multi-source 3D models has emerged to address the above problems. Its main technical background includes:

[0003] 1. Lightweighting: By optimizing the model structure, reducing redundant information, and simplifying the geometry, the model size can be significantly reduced while maintaining its visual quality. This process involves various techniques such as geometry simplification, texture compression, and topology optimization.

[0004] 2. Lossless Compression: Compared to traditional lossy compression methods, lossless compression technology can effectively reduce the storage space occupied by the model while ensuring that all details of the 3D model are fully preserved. It uses efficient encoding algorithms such as arithmetic coding and more advanced adaptive coding technology, as well as intelligent analysis and reconstruction of model data.

[0005] 3. Multi-source compatibility: In order to achieve unified processing of 3D models from multiple sources, highly compatible parsing and conversion tools are designed and developed that can recognize and process 3D data of different formats and structures, ensuring accurate conversion and efficient processing of data.

[0006] Lightweight processing and lossless compression technology of multi-source 3D models are important technical directions to meet the current and future needs of 3D applications for efficient data processing, low-latency transmission, and high-fidelity presentation. They are of great significance for promoting the development of related industries. Summary of the Invention

[0007] In view of the above-mentioned problems, the present invention is proposed.

[0008] Therefore, the technical problem solved by the present invention is that the existing technology cannot efficiently and accurately achieve lightweight processing and lossless compression of three-dimensional models.

[0009] To solve the above technical problems, the present invention provides the following technical solutions: a method for supporting lightweight processing and lossless compression of multi-source 3D models, comprising: performing a format compatibility check on the imported 3D model and analyzing the geometric structure, texture characteristics and material properties of the model; the format compatibility check is divided into a file size structure check and a geometric data check, the geometric data check includes detecting and removing redundant and repeated vertices in the 3D model, reading all vertex data from the 3D model file and storing them in a list, each vertex is represented by a 3D coordinate (x, y, z), and traversing each pair of vertices v i and v j , calculate v i and v j The Euclidean distance d between ij ;

[0010] Curvature information is introduced as an auxiliary condition for vertex redundancy judgment. Redundant vertices in high curvature areas are retained as key vertices, and the curvature κ(v) of vertex v is calculated using the angle defect method:

[0011]

[0012] Where n represents the number of triangles adjacent to vertex v; θ i Represents the interior angle of vertex v in each adjacent triangle in its neighborhood;

[0013] Based on the Euclidean distance d ij and curvature κ(v), calculate for each pair of vertices v i and v j The weighted distance of:

[0014] d ij ′=d ij ×(1+α×|κ(v i )-κ(v j )|)

[0015] Among them, d ij ′ represents v i and v j The weighted distance d is the weighted distance of the curvature. α represents the weight coefficient of the curvature. ij ′ is less than the preset threshold, it is judged that v j It is v i Redundant vertices, v j Delete and update all j The associated face data, so that j The associated face data points to v i ;

[0016] The quadratic error metric algorithm and edge collapse are used to simplify the geometric structure of the 3D model. The simplified model is optimized through edge segmentation to obtain a lightweight model.

[0017] The geometric data of the lightweight model is compressed using a data compression algorithm, and the texture data is compressed through predictive coding to complete lossless compression of the three-dimensional model.

[0018] As an optimal solution for the method for supporting lightweight processing and lossless compression of multi-source three-dimensional models described in the present invention, the file size structure check includes automatically identifying the format of the model after the three-dimensional model is imported, reading the file extension as the basis for judging the model format, parsing the file header information, and if the file header information and the extension correspond to the same model format, it is judged that the identification is correct and marked; for model files of known formats, the expected size of the file is estimated according to the structure defined by the model format. If the actual size of the read file is different from the expected size, it is marked as a file size verification failure. If the actual size of the file is the same as the expected size, the file size verification is passed; after the file size verification is passed, the key data block verification is performed. The key data block includes vertex arrays, face data and texture coordinates. Under normal circumstances, the length and order of the data blocks in the three-dimensional model file are fixed. If the key data blocks are complete and arranged in the expected order, the key data block verification is passed. If there are data blocks missing or the order is wrong, it is marked as a key data block verification failure.

[0019] As a preferred solution of the method for supporting lightweight processing and lossless compression of multi-source three-dimensional models described in the present invention, the quadratic error metric algorithm introduces vertex curvature into the quadratic error metric as a determining factor for edge folding order, thereby reducing the number of vertices and faces of the model. The specific steps include reading a mesh file, obtaining original three-dimensional mesh information, and extracting mesh vertex and face data; traversing each vertex in the mesh, and calculating the quadratic error matrix of each vertex. The calculation of the quadratic error matrix is ​​based on the distance from the vertex to the adjacent plane, and is expressed as:

[0020]

[0021] Among them, Δ(v) represents the quadratic error value of vertex v; v represents the homogeneous coordinate vector of vertex [v x v y v z 1] T ; p represents the coefficient vector of the plane equation; T represents the transposed matrix; p∈planes(v) represents the coefficient vector of all plane equations adjacent to vertex v;

[0022] Add up the basic quadratic surfaces and use matrix Q to represent the quadratic error matrix of the entire plane set. The simplified expression is:

[0023]

[0024] Among them, K p is the quadratic error matrix corresponding to the coefficient vector p of the plane equation:

[0025]

[0026] Where p = [a, b, c, d] T The coefficient vector representing the plane equation ax+by+cz+d=0;

[0027] While calculating the quadratic error matrix, the mesh internal vertices and boundary vertices are distinguished, the Gaussian curvature of the internal vertices and boundary vertices is calculated, and the Gaussian curvature of each edge is calculated. The Gaussian curvature of the vertex is introduced into the quadratic error matrix, and the edge folding operation is performed based on the calculated quadratic error and curvature information.

[0028] As a preferred solution of the method for supporting lightweight processing and lossless compression of multi-source three-dimensional models described in the present invention, the edge folding includes, when selecting edge folding, introducing the Gaussian curvature of the vertex as part of the folding cost based on the geometric error. For edges with vertices v1 and v2, the quadratic error matrix after merging the vertices is expressed as:

[0029] Q new =Q1+Q2

[0030] Among them, Q1 represents the quadratic error matrix of vertex v1; Q new Represents the new vertex v new The quadratic error matrix of vertex v2; Q2 represents the quadratic error matrix of vertex v2; v new Represents the new vertex generated after merging;

[0031] Generate a new vertex v after calculating the fold bar The position of , so that the quadratic error is minimized:

[0032] v bar =argmin v (v T Q new v)

[0033] Among them, argmin v Indicates that the selection can make (v T Q new v) minimum vertex position; the new vertex v bar Substituting into the quadratic error expression, calculating the folding error as the folding cost, introducing curvature information as the folding criterion, the total cost is expressed as:

[0034]

[0035] After folding, vertex v bar The length of the side to the adjacent point is l new The range is preset to (l min , l max );

[0036] When D is greater than or equal to the preset cost threshold D ε , if the length of the newly generated edge exists l new <l min or l new >l max In the case of , no edge folding is performed;

[0037] When D is less than the preset cost threshold D ε And all newly generated edges have length l new ∈(l min , l max ), perform edge folding operation;

[0038] The steps of edge folding are: select an edge e(v1,v2) as the basic geometric element of folding; merge the vertices v1 and v2 at both ends of the edge into a new fixed point v bar , and delete the original vertices v1 and v2;

[0039] Calculate the new vertex v after merging bar The quadratic error matrix Q bar and the new vertex position to minimize the folding error; after the folding is completed, all other vertices connected to the original vertices v1 and v2 are connected to v bar Reconnect and adjust all triangles associated with the deleted vertices v1 and v2 so that the model maintains a triangular mesh structure and completes the edge collapse operation.

[0040] As a preferred solution of the method for supporting lightweight processing and lossless compression of multi-source three-dimensional models described in the present invention, the edge segmentation operation includes calculating the average side length l of all sides of the three-dimensional mesh model. avg , set the edge segmentation threshold l T , traverse each edge of the three-dimensional grid, when the edge length l≤l T No edge splitting operation is performed; when the edge length l>l T When the edge is split, the midpoint coordinates of the current edge are calculated and the midpoint coordinates are used as the split point v split , get the vertex coordinates of the triangle where the current edge is located and mark it as the split vertex, delete the triangle where the current edge is located, and pass the split point v split Add new triangles to the split vertices to complete the edge splitting operation; if there are edges that have not been traversed, continue the traversal operation; if all edges have been traversed, end the traversal operation, save the mesh information and output the three-dimensional mesh model.

[0041] As a preferred solution of the method for supporting lightweight processing and lossless compression of multi-source three-dimensional models described in the present invention, the lossless compression includes: using the Draco compression algorithm to compress the simplified geometric data; during the compression process, encoding the mesh based on the Edgebreaker algorithm, encoding the triangular faces in a spiral form, and tracking the visited vertices and faces to ensure that all geometric information is losslessly retained; after the compression is completed, the compressed geometric data file is output and the relevant mesh information is saved; conventional compression processing is performed on the texture data of the model, the texture image is divided into multiple color blocks of a fixed size of 16 bytes, conventional compression operations are performed, and predictive coding is used to further reduce the volume of the texture data, the compression rate is calculated, and the final image size is determined; the compressed texture data is combined with the geometric data to form a complete compressed model data file, completing the lossless compression of the three-dimensional model.

[0042] A system for supporting lightweight processing and lossless compression of multi-source three-dimensional models using any of the methods described in the present invention, wherein: a compatibility check module checks the file size structure and geometric data of an imported three-dimensional model and removes redundant and repeated vertices in the three-dimensional model; a lightweight module introduces the curvature of the vertex into the quadratic error measure as a determining factor for the edge folding order, performs edge folding and edge splitting operations, simplifies the geometric structure of the three-dimensional model, and obtains a lightweight model; a compression module compresses the geometric data and texture data of the lightweight model, combines the compressed texture data with the geometric data to form a complete compressed model data file, and completes the lossless compression of the three-dimensional model.

[0043] A computer device comprises: a memory and a processor; the memory stores a computer program, comprising: the steps of implementing any one of the methods of the present invention when the processor executes the computer program.

[0044] A computer-readable storage medium stores a computer program thereon, comprising: steps of implementing any one of the methods of the present invention when the computer program is executed by a processor.

[0045] The present invention significantly improves loading speed and real-time rendering efficiency by reducing 3D model file size and optimizing texture compression algorithms, making it particularly suitable for mobile devices and network-constrained environments. Lossless compression technology ensures high-quality visuals during the lightweighting process, while also enhancing cross-platform compatibility and supporting import and export in multiple formats. Lightweight models not only reduce storage space requirements and costs but also align with the principles of green computing and sustainable development by reducing energy consumption during data transmission and processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 An edge segmentation flow chart of a method for supporting lightweight processing and lossless compression of multi-source 3D models provided by one embodiment of the present invention;

[0048] Figure 2 A schematic diagram of edge folding supporting lightweight processing and lossless compression of multi-source 3D models provided by one embodiment of the present invention;

[0049] Figure 3 A simplified geometric preview image before testing of a method for supporting lightweight processing and lossless compression of multi-source 3D models provided in a second embodiment of the present invention;

[0050] Figure 4 A simplified geometric preview diagram of a method for supporting lightweight processing and lossless compression of multi-source 3D models provided in a second embodiment of the present invention;

[0051] Figure 5 A second embodiment of the present invention provides a method for supporting lightweight processing and lossless compression of multi-source three-dimensional models, showing a comparison of the results, appearance, and features after lightweight processing. DETAILED DESCRIPTION

[0052] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.

[0053] Example 1, reference Figure 1-Figure 2 , as one embodiment of the present invention, provides a method for supporting lightweight processing and lossless compression of multi-source 3D models, comprising:

[0054] S1: Check the format compatibility of the imported 3D model and analyze the model's geometric structure, texture characteristics, and material properties.

[0055] Import 3D models from various sources into the processing system and perform format compatibility checks to ensure the integrity and correctness of the model data. Common 3D model formats include OBJ, FBX, STL, PLY, etc. When importing a model, the system automatically identifies the model format and performs preliminary parsing to check the integrity of the model file, including file header information, data block length and sequence, to ensure that the model data is not lost or damaged.

[0056] Specifically, the format compatibility check is divided into file size structure check and geometric data check. The file size structure check includes automatically identifying the model format after the 3D model is imported, reading the file extension as the basis for judging the model format, and parsing the file header information. If the file header information and the extension correspond to the same model format, it is judged that the recognition is correct and marked.

[0057] Each 3D model format has a unique file header or identifier. The system can identify the file format by reading the first few bytes of the file and checking the file header or magic number.

[0058] For example:

[0059] OBJ files are stored in text format, usually using v, vt, vn, etc. to identify vertices, texture coordinates, normals and other data. The file header will start with these keywords.

[0060] FBX files are stored in binary or ASCII format. The header of the binary format file usually contains the words KaydaraFBXBinary, and the system can identify it through this identifier.

[0061] STL files also have two formats: text and binary. The text format usually starts with "solid", while the binary format is identified by an 80-byte file header followed by the number of faces.

[0062] For model files of known formats, the expected file size is estimated based on the structure defined by the model format. For example, the size of an STL binary file should be an 80-byte file header + a 4-byte face count + per-face data (50 bytes * face count). If the file size does not match the calculated size, data loss or corruption may occur. If the actual file size read differs from the expected size, the file size verification is marked as failed. If the actual file size matches the expected size, the file size verification passes.

[0063] After the file size verification is passed, the key data block verification is performed. The key data block includes vertex arrays, face data and texture coordinates. Under normal circumstances, the length and order of data blocks in the 3D model file are fixed. If the key data blocks are complete and arranged in the expected order, the key data block verification is passed. If there are data blocks missing or the order is wrong, it is marked as a key data block verification failure.

[0064] Furthermore, the purpose of geometric data checking is to detect and remove redundant and repeated vertices in the 3D model to optimize the data structure and provide a more accurate data basis for geometric simplification.

[0065] Traditional methods for vertex redundancy detection rely solely on geometric distance (Euclidean distance) to determine vertex duplication, ignoring the geometric characteristics of the region in which the vertices reside. Vertices in certain high-curvature regions are crucial for geometric simplification and should not be removed simply because they are close. Therefore, introducing curvature information as an auxiliary condition for vertex redundancy detection can more accurately retain key vertices.

[0066] Read all vertex data from the 3D model file and store them in a list. Each vertex is represented by a 3D coordinate (x, y, z). Traverse each pair of vertices v i and v j , calculate v i and v j The Euclidean distance d between ij .

[0067] Curvature information is introduced as an auxiliary condition for vertex redundancy judgment. Redundant vertices in high curvature areas are retained as key vertices, and the curvature κ(v) of vertex v is calculated using the angle defect method:

[0068]

[0069] Where n represents the number of triangles adjacent to vertex v; θ i represents the interior angle of vertex v in each adjacent triangle in its neighborhood.

[0070] Based on the Euclidean distance d ij and curvature κ(v), calculate for each pair of vertices v i and v j The weighted distance of:

[0071] d ij ′=d ij ×(1+α×|κ(v i )-κ(v j )|)

[0072] Among them, d ij ′ represents v i and v jThe weighted distance d is the weighted distance of the curvature. α represents the weight coefficient of the curvature. ij ′ is less than the preset threshold, it is judged that v j It is v i Redundant vertices, v j Delete and update all j The associated face data, so that j The associated face data points to v i .

[0073] The weighted distance takes into account the geometric features of vertices. If the curvature difference between two vertices is large, even if the geometric distance between them is small, the system will not regard them as redundant vertices, thereby retaining the key feature points.

[0074] In addition to vertex checking, surface data continuity check is also required, surface data is read, and the length l of each edge is calculated. ij and curvature information κ e (e ij ), the curvature information is estimated by the mean curvature of the vertices on the edge or the rate of change of the normal vector of the adjacent face.

[0075] Detection of non-closed meshes based on edge length and curvature:

[0076] Pairing Condition=(e ij is paired)AND(l ij <∈ l )AND(|κ e (e ij )|<∈ κ )

[0077] Among them, e ij represents an edge; ∈ l Indicates the maximum allowable value of the side length; ∈ κ Indicates the maximum allowable curvature difference.

[0078] If the edge length and curvature are within the allowed range and the edges are correctly paired, the edge is considered legal. If abnormal edge length or curvature is detected, it may indicate the existence of a non-closed mesh or other abnormal structure.

[0079] By incorporating the characteristics of 3D model data and leveraging the curvature and quadratic error information calculated during geometry simplification, integrity checks are not only more accurate but also more efficient. Optimization measures ensure that the model's geometry is fully checked and repaired before geometry simplification and texture optimization, improving the quality and effectiveness of subsequent processing.

[0080] S2: The quadratic error metric algorithm and edge collapse are used to simplify the geometric structure of the 3D model. The simplified model is optimized through edge segmentation to obtain a lightweight model.

[0081] The quadratic error metric (QEM) algorithm can effectively maintain the characteristics of high curvature areas of the mesh model, keep the mesh geometric structure, and eliminate narrow and long triangles. The simplified model has better visual effects, and the simplification accuracy is higher at a high simplification rate.

[0082] The quadratic error metric algorithm introduces the curvature of the vertex into the quadratic error metric as the determining factor of the edge folding order, reducing the number of vertices and faces of the model. The specific steps include reading the mesh file, obtaining the original three-dimensional mesh information, and extracting the vertex and face data of the mesh.

[0083] Traverse each vertex in the mesh and calculate the quadratic error matrix of each vertex. The calculation of the quadratic error matrix is ​​based on the distance from the vertex to the adjacent plane, expressed as:

[0084]

[0085] Among them, Δ(v) represents the quadratic error value of vertex v; v represents the homogeneous coordinate vector of vertex [v x v y v z 1] T ; p represents the coefficient vector of the plane equation; T represents the transposed matrix; p∈planes(v) represents the coefficient vector of all plane equations adjacent to vertex v.

[0086] Summing the elementary quadratic surfaces, we can use a matrix to represent the quadratic error of the entire set of planes:

[0087]

[0088] Among them, K p is the quadratic error matrix corresponding to the coefficient vector p of the plane equation:

[0089]

[0090] Where p = [a, b, c, d] T The coefficient vector representing the plane equation ax+by+cz+d=0.

[0091] While calculating the quadratic error matrix, distinguish between the inner and outer vertices of the mesh, calculate the Gaussian curvature of the inner and outer vertices, and calculate the Gaussian curvature of each edge. The Gaussian curvature of the vertex is introduced into the quadratic error matrix. According to the calculated quadratic error and curvature information, the edge with smaller error and lower curvature is selected for folding. When folding the edge, the position v of the new vertex is calculated. newMinimize the value of the total quadratic error matrix.

[0092] Furthermore, when selecting edge folding, not only the geometric error is considered, but also the Gaussian curvature of the vertex is introduced as part of the folding cost to better preserve the geometric features of the model.

[0093] When selecting edge folding, on the basis of geometric error, the Gaussian curvature of the vertex is introduced as part of the folding cost. For the edges with vertices v1 and v2, the quadratic error matrix after merging the vertices is expressed as:

[0094] Q new =Q1+Q2

[0095] Among them, Q1 represents the quadratic error matrix of vertex v1; Q new Represents the new vertex v new The quadratic error matrix of vertex v2; Q2 represents the quadratic error matrix of vertex v2; v new Represents the new vertex generated after merging.

[0096] Generate a new vertex v after calculating the fold bar The position of , so that the quadratic error is minimized:

[0097] v bar =argmin v (v T Q new v)

[0098] Among them, argmin v Indicates that the selection can make (v T Q new v) Minimum vertex position.

[0099] The new vertex v bar Substituting into the quadratic error expression, calculating the folding error as the folding cost, introducing curvature information as the folding criterion, the total cost is expressed as:

[0100]

[0101] After folding, vertex v bar The length of the side to the adjacent point is l new The range is preset to (l min , l max ).

[0102] If the geometric error is small, it means that the folding operation has little effect on the geometric shape of the model, and the folding operation can be considered. However, when the curvature of the vertex is high, the folding operation should be performed with caution to avoid losing key features.

[0103] Therefore, the geometric error, vertex curvature and edge length limit are comprehensively considered to determine whether the two vertices v1 and v2 need to be folded. This can not only reduce the number of vertices in the model and improve the simplification efficiency, but also effectively retain important geometric features and structures.

[0104] When D is greater than or equal to the preset cost threshold D ε , if the length of the newly generated edge exists l new <l min or l new >l max In the case of , no edge folding is performed;

[0105] When D is less than the preset cost threshold D ε And all newly generated edges have length l new ∈(l min , l max ), perform edge folding operation;

[0106] The steps of edge folding are: select an edge e(v1,v2) as the basic geometric element of folding; merge the vertices v1 and v2 at both ends of the edge into a new fixed point v bar , and delete the original vertices v1 and v2;

[0107] Calculate the new vertex v after merging bar The quadratic error matrix Q bar and the new vertex position to minimize the folding error; after the folding is completed, all other vertices connected to the original vertices v1 and v2 are connected to v bar Reconnect and adjust all triangles associated with the deleted vertices v1 and v2 so that the model maintains the triangle mesh structure and completes the edge folding operation. Adjust all triangles associated with the deleted vertices v1 and v2 so that the model maintains the triangle mesh structure and completes the edge folding operation. The effect of edge folding is as follows: Figure 2 shown.

[0108] Furthermore, Figure 1 As shown, the edge segmentation operation includes calculating the average edge length l of all edges of the 3D mesh model avg , set the edge segmentation threshold l T , traverse each edge of the three-dimensional grid, when the edge length l≤l T No edge splitting operation is performed.

[0109] It should be noted that Figure 1 The TargetLength in the code is the edge segmentation threshold l. T ,EdgeLength represents one of the edges selected during the traversal process.

[0110] When side length l>l TWhen the edge is split, the midpoint coordinates of the current edge are calculated and the midpoint coordinates are used as the split point v split , get the vertex coordinates of the triangle where the current edge is located and mark it as the split vertex, delete the triangle where the current edge is located, and pass the split point v split Add new triangles to the split vertices to complete the edge splitting operation.

[0111] If there are untraversed edges, the traversal operation continues; if all edges have been traversed, the traversal operation ends, the mesh information is saved, and the three-dimensional mesh model is output.

[0112] S3: Use data compression algorithms to compress the geometric data of the lightweight model, and compress the texture data through predictive coding to complete lossless compression of the 3D model.

[0113] Furthermore, the simplified geometric data is compressed using the Draco compression algorithm. Before executing the Draco compression, the simplified geometric data is first preprocessed to ensure that all vertex coordinates of the model are normalized into a unified coordinate system to reduce the numerical range and improve the compression efficiency.

[0114] Based on the simplified vertex data, a KD-tree structure is constructed. A KD-tree is a spatial partitioning data structure that efficiently organizes and indexes point data in three-dimensional space. During the construction process, vertex data is organized in a way that minimizes intersection and partitioning errors by adaptively selecting partitioning planes. This process facilitates more efficient encoding of point data during subsequent compression.

[0115] All vertices are rearranged based on the constructed KD-tree. By placing spatially adjacent points in adjacent positions in the encoded sequence, redundant information can be reduced and encoding efficiency can be further improved.

[0116] The triangular faces are encoded in a spiral form, starting from a certain triangular face and spirally expanding along the mesh surface. Each visited triangular face is encoded in sequence, marking the vertices and faces that have been visited to avoid repeated encoding and ensure that no geometric information is missed during the compression process.

[0117] During the encoding process, the coordinates of the vertices are quantized to further reduce the amount of data by converting the floating-point coordinate values ​​into discrete integer values. The quantized vertex coordinates are combined with the topological encoding results to generate the final compressed data packet.

[0118] Furthermore, the texture data of the model is subjected to conventional compression processing, and the texture image is divided into multiple color blocks of a fixed size of 16 bytes, and conventional compression operations are performed.

[0119] For each color block Bi Predictive coding is performed using linear prediction, which uses the weighted average of several adjacent color blocks to predict the value of the current color block:

[0120] B 预测 =w1×B i-1 +w2×B i-2 +…+w n ×B i-n

[0121] Among them, B i-n Indicates color block B i Adjacent color blocks; w represents the weight coefficient;

[0122] The difference between the actual color block and the predicted value is calculated. Since the prediction error values ​​are usually small and concentrated, they will be compressed in the next encoding step.

[0123] The prediction error is quantized and its value is mapped to a discrete integer range. The quantized prediction error data is encoded using entropy coding to generate a compressed data packet. The overall compression ratio after prediction coding is calculated. The compression ratio is obtained by dividing the original pixel size by the compressed pixel block size. According to the compression ratio result, the weight coefficient and quantization step size in the prediction model are fine-tuned to ensure the optimal compression ratio while maintaining image quality.

[0124] The compressed texture data is combined with the geometric data to form a complete compressed model data file, completing the lossless compression of the 3D model.

[0125] On the other hand, this embodiment also provides a system that supports lightweight processing and lossless compression of multi-source three-dimensional models, which includes: a compatibility check module, which checks the file size structure and geometric data of the imported three-dimensional model, and removes redundant and repeated vertices in the three-dimensional model; a lightweight module, which introduces the curvature of the vertex into the quadratic error measure as a determining factor of the edge folding order, performs edge folding and edge splitting operations, simplifies the geometric structure of the three-dimensional model, and obtains a lightweight model; a compression module, which compresses the geometric data and texture data of the lightweight model, combines the compressed texture data with the geometric data to form a complete compressed model data file, and completes the lossless compression of the three-dimensional model.

[0126] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0127] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0128] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0129] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0130] Example 2, reference Figure 3-Figure 5 , which is an embodiment of the present invention, provides a method for supporting lightweight processing and lossless compression of multi-source three-dimensional models. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through simulation experiments.

[0131] In a power plant project, the application of the lightweight processing and lossless compression method of the present invention can significantly improve work efficiency and data management. The following is a three-dimensional case study of a power plant to illustrate the specific application and effect of the present invention:

[0132] In power plant projects, a large amount of 3D model data needs to be processed, including building structures, equipment layouts, piping systems, etc. These model data usually contain a large number of vertices, patches, textures, and material information, resulting in a large file size, which is not conducive to storage, transmission, and sharing. First, collect the original 3D model data of the power plant project, mainly including Revit, Sketchup and other format files. Analyze the geometric structure, material, texture and other properties of the power plant model. Apply the vertex simplification algorithm to reduce the number of vertices in the model and reduce the complexity. Take the test model file WM0270 as an example for testing. The 3D model geometry preview before simplification is as follows: Figure 3 As shown, the simplified geometry preview is as follows Figure 4 The test data is shown in Table 1.

[0133] Table 1 WM0270 test data table

[0134]

[0135]

[0136] Optimize textures and materials, using compression algorithms to reduce texture file size. Use the lossless compression algorithm presented in this paper to compress the lightweight model data. Maintain data integrity and accuracy during compression, ensuring the original model can be fully restored after decompression.

[0137] Table 2 Experimental data table

[0138]

[0139] As shown in Tables 1 and 2, this invention significantly reduces the file size of a 3D power plant model through lightweight processing and lossless compression, lowering storage costs. The compressed model file transfer speed is faster, reducing network bandwidth usage and transmission time. The lightweight model loads faster, improving user experience and work efficiency. This provides strong support for multi-source data integration and collaborative work in 3D power plant projects.

[0140] like Figure 5 The figure below shows a comparison of the results, appearance, and features of a lightweight 3D model. The lossless compression algorithm employed by this invention efficiently compresses the geometry, material, texture, and other information of the 3D model. Unlike lossy compression, this lossless compression technology fully restores the integrity and accuracy of the original model data during the decompression process, guaranteeing the model's quality and usability. By optimizing performance and incorporating parallel computing technology, this invention maintains high performance when processing large-scale 3D models, meeting the demands of practical applications.

[0141] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for lightweight processing and lossless compression of multi-source 3D models, characterized in that: include: Perform format compatibility checks on imported 3D models and analyze the model's geometry, texture characteristics, and material properties; The format compatibility check is divided into file size structure check and geometric data check. The geometric data check includes detecting and removing redundant and repeated vertices in the 3D model, reading all vertex data from the 3D model file and storing them in a list. Each vertex is represented by a 3D coordinate (x, y, z), and traversing each pair of vertices v i and v j , calculate v i and v j The Euclidean distance d between ij ; Curvature information is introduced as an auxiliary condition for vertex redundancy judgment. Redundant vertices in high curvature areas are retained as key vertices, and the curvature κ(v) of vertex v is calculated using the angle defect method: Where n represents the number of triangles adjacent to vertex v; θ i Represents the interior angle of vertex v in each adjacent triangle in its neighborhood; Based on the Euclidean distance d ij and curvature κ(v), calculate for each pair of vertices v i and v j The weighted distance of: d ij ′=d ij ×(1+α×|κ(v i )-k(v j )|) Among them, d ij ′ represents v i and v j The weighted distance d is the weighted distance of the curvature. α represents the weight coefficient of the curvature. ij ′ is less than the preset threshold, it is judged that v j It is v i Redundant vertices, v j Delete and update all j The associated face data, so that j The associated face data points to v i ; The quadratic error metric algorithm and edge collapse are used to simplify the geometric structure of the 3D model. The simplified model is optimized through edge segmentation to obtain a lightweight model. The geometric data of the lightweight model is compressed using a data compression algorithm, and the texture data is compressed through predictive coding to complete lossless compression of the three-dimensional model.

2. The method for lightweight processing and lossless compression of a multi-source 3D model according to claim 1, wherein: The file size and structure check includes automatically identifying the model format after the 3D model is imported, reading the file extension as the basis for determining the model format, parsing the file header information, and determining that the identification is correct and marking it if the file header information and the extension correspond to the same model format; For model files of known formats, the expected file size is estimated based on the structure defined in the model format. If the actual file size read is different from the expected size, the file size verification is marked as failed. If the actual file size is the same as the expected size, the file size verification passes. After the file size verification is passed, the key data block verification is performed. The key data block includes vertex arrays, face data and texture coordinates. Under normal circumstances, the length and order of data blocks in the 3D model file are fixed. If the key data blocks are complete and arranged in the expected order, the key data block verification is passed. If there are data blocks missing or the order is wrong, it is marked as a key data block verification failure.

3. The method for lightweight processing and lossless compression of a multi-source 3D model according to claim 2, wherein: The quadratic error metric algorithm introduces vertex curvature into the quadratic error metric as a determining factor for edge folding order, thereby reducing the number of vertices and faces of the model. The specific steps include reading a mesh file, obtaining original three-dimensional mesh information, and extracting mesh vertex and face data. Traverse each vertex in the mesh and calculate the quadratic error matrix of each vertex. The calculation of the quadratic error matrix is ​​based on the distance from the vertex to the adjacent plane, expressed as: Among them, Δ(v) represents the quadratic error value of vertex v; v represents the homogeneous coordinate vector of vertex [v x v y v z 1] T ; p represents the coefficient vector of the plane equation; T represents the transposed matrix; p∈planes(v) represents the coefficient vector of all plane equations adjacent to vertex v; Add up the basic quadratic surfaces and use matrix Q to represent the quadratic error matrix of the entire plane set. The simplified expression is: Among them, K p is the quadratic error matrix corresponding to the coefficient vector p of the plane equation: Where p = [a, b, c, d] T The coefficient vector representing the plane equation ax+by+cz+d=0; While calculating the quadratic error matrix, the mesh internal vertices and boundary vertices are distinguished, the Gaussian curvature of the internal vertices and boundary vertices is calculated, and the Gaussian curvature of each edge is calculated. The Gaussian curvature of the vertex is introduced into the quadratic error matrix, and the edge folding operation is performed based on the calculated quadratic error and curvature information.

4. The method for lightweight processing and lossless compression of a multi-source 3D model according to claim 3, wherein: The edge folding includes, when selecting edge folding, introducing the Gaussian curvature of the vertex as part of the folding cost based on the geometric error. For the edges with vertices v1 and v2, the quadratic error matrix after merging the vertices is expressed as: Q new =Q1+Q2 Among them, Q1 represents the quadratic error matrix of vertex v1; Q new Represents the new vertex v new The quadratic error matrix of vertex v2; Q2 represents the quadratic error matrix of vertex v2; v new Represents the new vertex generated after merging; Generate a new vertex v after calculating the fold bar The position of , so that the quadratic error is minimized: v bar =argmin v (v T Q new v) Among them, argmin v Indicates that the selection can make (v T Q new v) minimum vertex position; The new vertex v bar Substituting into the quadratic error expression, calculating the folding error as the folding cost, introducing curvature information as the folding criterion, the total cost is expressed as: After folding, vertex v bar The length of the side to the adjacent point is l new The range is preset to (l min , l max ); When D is greater than or equal to the preset cost threshold D ε , if the length of the newly generated edge exists l new <l min or l new >l max In the case of , no edge folding is performed; When D is less than the preset cost threshold D ε And all newly generated edges have length l new ∈(l min , l max ), perform edge folding operation; The steps of edge folding are: select an edge e(v1,v2) as the basic geometric element of folding; merge the vertices v1 and v2 at both ends of the edge into a new fixed point v bar , and delete the original vertices v1 and v2; Calculate the new vertex v after merging bar The quadratic error matrix Q bar and the new vertex position to minimize the folding error; after the folding is completed, all other vertices connected to the original vertices v1 and v2 are connected to v bar Reconnect and adjust all triangles associated with the deleted vertices v1 and v2 so that the model maintains a triangular mesh structure and completes the edge collapse operation.

5. The method for lightweight processing and lossless compression of a multi-source 3D model according to claim 4, characterized in that: The edge segmentation operation includes calculating the average edge length l of all edges of the three-dimensional mesh model. avg , set the edge segmentation threshold l T , traverse each edge of the three-dimensional grid, when the edge length l≤l T No edge splitting operation is performed; When side length l>l T When the edge is split, the midpoint coordinates of the current edge are calculated and the midpoint coordinates are used as the split point v split , get the vertex coordinates of the triangle where the current edge is located and mark it as the split vertex, delete the triangle where the current edge is located, and pass the split point v split Add new triangles to the split vertices to complete the edge splitting operation; If there are untraversed edges, the traversal operation continues; if all edges have been traversed, the traversal operation ends, the mesh information is saved, and the three-dimensional mesh model is output.

6. The method for lightweight processing and lossless compression of a multi-source 3D model according to claim 5, characterized in that: The lossless compression includes compressing the simplified geometric data using the Draco compression algorithm. During the compression process, the mesh is encoded based on the Edgebreaker algorithm, the triangular faces are encoded in a spiral form, and the visited vertices and faces are tracked to ensure that all geometric information is losslessly preserved. After the compression is completed, the compressed geometric data file is output and the relevant mesh information is saved. Perform conventional compression on the model's texture data, splitting the texture image into multiple 16-byte color blocks, performing conventional compression operations, and using predictive coding to further reduce the size of the texture data. Calculate the compression ratio and determine the final image size. The compressed texture data is combined with the geometric data to form a complete compressed model data file, completing the lossless compression of the 3D model.

7. A system for supporting lightweight processing and lossless compression of multi-source 3D models using the method according to any one of claims 1 to 6, characterized in that: include, Compatibility check module, which checks the file size structure and geometric data of the imported 3D model and removes redundant and duplicate vertices in the 3D model; The lightweight module introduces the vertex curvature into the quadratic error measure as the determining factor of the edge folding order, performs edge folding and edge splitting operations, simplifies the geometric structure of the 3D model, and obtains a lightweight model; as well as, The compression module compresses the geometric data and texture data of the lightweight model, combines the compressed texture data with the geometric data to form a complete compressed model data file, and completes the lossless compression of the three-dimensional model.

8. A computer device comprising: memory and processor; The memory stores a computer program, characterized in that when the processor executes the computer program, the steps of the method for supporting lightweight processing and lossless compression of multi-source three-dimensional models as described in any one of claims 1-6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for supporting lightweight processing and lossless compression of multi-source three-dimensional models as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • BIM model lightweight method

    CN118821284A