A method for instantiating a three-dimensional mesh model based on affine invariance
By adopting a 3D mesh model instantiation method based on affine covariance, the problem of insufficient geometric instantiation in 3D mesh model processing is solved, achieving lightweight storage and efficient rendering of the model, and improving the loading and rendering performance of large-scale scenes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA RAILWAY DESIGN GRP CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-23
Smart Images

Figure CN121883763B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer graphics and 3D data processing technology, specifically relating to a method for instantiating 3D mesh models based on affine covariance. Background Technology
[0002] With the rapid development of smart city, digital twin, and Building Information Modeling (BIM) technologies, the scale and complexity of 3D scenes are growing exponentially. These large-scale engineering scenes typically contain a large number of geometric models, resulting in extremely large 3D mesh model files. This not only puts enormous pressure on data storage but also severely restricts transmission efficiency in network environments, causing excessively long loading and parsing times for users and significantly impacting the user experience.
[0003] Geometry instantiation is one solution for lightweight modeling. Its core idea is to utilize repetitive components commonly found in a scene (such as identical beams, columns, pipes, valves, fasteners, etc.), storing the geometric mesh data only once as a prototype, and then using several lightweight transformation matrices (containing position, rotation, and scaling information) to describe its multiple occurrences in the scene. Figure 1 As shown. This technology can theoretically reduce data redundancy by several orders of magnitude, thereby significantly compressing file size, accelerating network transmission, and allowing efficient rendering of massive primitives by leveraging the hardware instantiation capabilities of GPUs.
[0004] However, in practical engineering applications, existing data export mechanisms and recognition algorithms often struggle to handle 3D mesh models effectively. Figure 1 The way this technology is fully utilized results in a large number of components that should be instantiated existing only as independent static meshes. Specifically, existing 3D mesh model processing faces the following core challenges:
[0005] 1. Lack of geometric instantiation: Due to limitations in the export mechanisms of modeling software (such as Revit and Tekla) or insufficient standardization in manual modeling, a large number of components with identical geometric shapes exist, such as standard-sized bolts, fasteners, and... Figure 2 The model shown was broken down into multiple independent triangular meshes during export. These meshes are geometrically identical, differing only in scene transformations (position, orientation). This not only results in a large amount of redundant vertex data consuming disk space and GPU memory, but also prevents hardware instantiation rendering, severely limiting the rendering frame rate.
[0006] 2. Insufficient instantiation within complex components: In existing modeling workflows, instantiation often stops at the overall level of complex devices, resulting in instance associations existing only between devices (e.g., ...). Figure 3The diagram shows the correspondence between the red component on the left and the blue component on the right, but ignores the reuse of sub-components within the device. In fact, these complex devices still contain a large number of sub-components with completely identical topologies, such as... Figure 3 As shown in the green box.
[0007] 3. Failure in affine similarity component identification: In engineering practice, a large number of parametric components exist, whose geometric characteristics often exhibit uniaxial or multiaxial dimensional variations. For example... Figure 4 As shown, bridge pile foundations of the same type have the same cross-sectional radius but vary in height due to terrain variations. Geometrically, these components belong to the category of affine similarity, differing only in the scaling axis. However, during geometry export in modeling software, these components are often exported as independent components, making them impossible to instantiate, store, and load. On the other hand, traditional identical matching algorithms cannot recognize such non-uniform scaling relationships, causing them to be treated as completely independent geometries, limiting file size optimization and rendering efficiency for large-scale scenes. Summary of the Invention
[0008] To address the problems existing in the prior art, this invention provides a method for instantiating three-dimensional mesh models based on affine covariance, which can be used to identify and instantiate similar or identical models.
[0009] Therefore, the present invention adopts the following technical solution:
[0010] A method for instantiating a 3D mesh model based on affine covariance includes the following steps:
[0011] S1, Geometric data extraction of the 3D mesh model to be identified:
[0012] get A set of entities in a 3D mesh model to be identified. , , For any one of the three-dimensional mesh models Represent its geometric information as a pair ,in, The vertex matrix of the 3D mesh model. For the topological index of the 3D mesh model;
[0013] S2, Geometric Normalization:
[0014] Based on the entity set obtained in S1 By translating, rotating, and non-uniformly scaling, each of the 3D mesh models to be identified is... A unified mapping to a whitened space with zero-centered, axis-aligned, and covariance-normalized space is obtained, yielding the corresponding... A collection of whitening space models , , and the affine transformation matrix;
[0015] S3, Feature Space Measurement and Clustering:
[0016] The set obtained based on S2 Calculate the different model feature descriptors specified by the user as grid similarity indicators, and set the corresponding tolerance threshold. , for the purpose of Clustering is performed on the whitening space models to obtain a set of similar models. , , Each category Recorded A similar whitening space model will classify... The first model is used as the representative model;
[0017] S4, instantiation replacement:
[0018] Similar model set obtained based on S3 Calculate each category For each whitening space model in the table, the corresponding restoration transformation matrix is obtained, resulting in a list of the corresponding restoration transformation matrices. Discard all vertex matrices and topological indices of non-representative models to obtain A whitening space model; the aforementioned List of whitening space models and their corresponding restoration transformation matrices Export and save to complete the instantiation of the 3D mesh model.
[0019] In step S1 above:
[0020] Vertex matrix This indicates that the 3D mesh model has The vertex, the first 3D coordinates of each vertex , ;
[0021] Topological index This indicates that the 3D mesh model has The triangular facet, the first Vertex index of each triangle , , , , .
[0022] In step S2 above:
[0023] The three-dimensional mesh model The vertex matrix after conversion to white space is The three-dimensional coordinates of the vertex are used This indicates that the topological index remains unchanged before and after whitening.
[0024] The affine transformation matrix Used to convert 3D mesh models Mapped to a centralized and normalized whitened space model The affine transformation matrix From the translation matrix Rotation matrix and non-uniform scaling matrix Composed of multiple components:
[0025] .
[0026] Obtain the translation matrix The specific steps are as follows:
[0027] Calculate a 3D mesh model center of mass :
[0028] ,
[0029] in, Let be the directed volume of the tetrahedron. This represents the total volume of the 3D mesh model. The center of mass of the tetrahedron;
[0030] The oriented volume of the subtetrahedron From the origin With 3D mesh model The The volume of a geometric tetrahedron composed of triangular facets is given by the formula:
[0031] ,
[0032] in, For the first The three vertices of a triangular facet;
[0033] The total volume of the three-dimensional mesh model The algebraic sum of the directed volumes of all subtetrahedrons is calculated using the following formula:
[0034] ,
[0035] The subtetrahedral centroid The calculation formula is:
[0036] ;
[0037] The centroid coordinates are obtained from the above calculations. ,structure Translation matrix :
[0038] .
[0039] Obtain the rotation matrix The specific steps are as follows:
[0040] Computational grid model covariance matrix :
[0041] ,
[0042] in, For 3D mesh model The The covariance matrix of the subtetrahedrons corresponding to the triangular facets is given by the formula:
[0043] ,
[0044] For the above covariance matrix Perform eigenvalue decomposition:
[0045] ,
[0046] in, , , which is the corresponding eigenvector matrix, whose column vectors are mutually orthogonal, forming the principal axis coordinate system describing the geometric distribution of the model; Let be an eigenvalue matrix, and satisfy . The magnitude of its eigenvalues represents the degree of dispersion of the three-dimensional mesh model along the corresponding principal axis direction;
[0047] The rotation matrix is constructed based on the results of eigenvalue decomposition, as shown in the following formula:
[0048] ,
[0049] Among them, if For the eigenvector corresponding to the smallest eigenvalue Take the opposite number, This indicates the expression for the determinant.
[0050] The non-uniform scaling matrix is constructed using the standard deviation of the eigenvalues. :
[0051] .
[0052] In step S3 above, the model feature descriptor includes:
[0053] (1) Standardized enclosure dimensions : Calculate the whitening space model The span along the whitening spatial coordinate axes, arranged in descending order:
[0054] ,
[0055] in,
[0056] Representing the whitening space model vertex matrix The maximum value in the first column vector;
[0057] Representing the whitening space model vertex matrix The minimum value in the first column vector;
[0058] Representing the whitening space model vertex matrix The maximum value in the second column vector;
[0059] Representing the whitening space model vertex matrix The minimum value in the second column vector;
[0060] Representing the whitening space model vertex matrix The maximum value in the third column vector;
[0061] Representing the whitening space model vertex matrix The minimum value in the third column vector;
[0062] constitute ;
[0063] constitute ;
[0064] (2) Points With face number As one of the indicators to ensure that the meshes are completely identical;
[0065] (3) Volume filling rate Total volume of the 3D mesh model Its minimum bounding rectangle volume The ratio:
[0066] ;
[0067] (4) Area fill rate Total grid area With the surface area of the enclosure The ratio:
[0068] ,
[0069] in,
[0070] ,
[0071] ,
[0072] ,
[0073] The Euclidean norm of a vector; The whitening space model is represented by the first... The coordinates of the first vertex of a triangular facet; The whitening space model is represented by the first... The coordinates of the second vertex of the triangular facet; The whitening space model is represented by the first... The coordinates of the third vertex of a triangular facet.
[0074] For any two whitening space models, the difference between all selected model feature descriptors is within the user-defined tolerance threshold if and only if the differences are within the user-defined tolerance threshold. If the two models are within the range, they are determined to be geometrically similar; otherwise, they are determined to be geometrically dissimilar.
[0075] The clustering adopts a greedy clustering strategy based on a distance threshold, and the specific steps are as follows:
[0076] (1) Initialization: Create an empty collection of categories. All whitened space models to be classified are marked as "to be processed", forming a set to be processed;
[0077] (2) Traversal and matching:
[0078] Take a whitening space model from the set to be processed. ;
[0079] Iterate through each existing category Its representative model and Perform similarity determination:
[0080] If it is determined to be geometrically similar, then... Join this category ;
[0081] If no similar category is found after iterating through all existing categories, then... Create a new category and will As a representative model of this category;
[0082] (3) Iterative Loop: Repeat the above process until all whitened spatial models to be classified are assigned to their respective categories, where each category , , , .
[0083] For category Arbitrary whitening space model in The formula for scene pose reconstruction using a representative model is:
[0084] ,
[0085] in, Whitening space model Relative to representative model The transformation restoration matrix is the inverse of its corresponding affine transformation matrix; Representative model The vertex matrix;
[0086] The list of reduction transformation matrices .
[0087] During the graphics rendering stage, for each category By uploading a representative model to the video memory once List of reduction transformation matrices The vertex transformation of each instantiated model is completed in real time in the shader using a single Draw Call.
[0088] Compared with the prior art, the present invention has the following beneficial effects:
[0089] 1. The method of this invention solves the problems of affine deformation and symmetry uncertainty that traditional methods cannot handle from a mathematical perspective, and realizes intelligent recognition of the geometric essence of engineering models.
[0090] 2. The method of the present invention is particularly suitable for large-scale building information modeling (BIM) and digital twin scenarios. By instantiating the model, it significantly reduces file storage size, network transmission bandwidth and model rendering times, thereby greatly improving the loading and rendering performance of the scene.
[0091] 3. Extreme Asset Compression: By identifying and merging affine variants, this invention can typically reduce the size of 3D model GLB files by 50% - 80%. For scenarios with long-distance pipelines, guardrails, and dense pile foundations, the compression rate can even reach over 90%.
[0092] 4. Leap in rendering performance: This invention can merge tens of thousands of independent Draw Call commands into a few Instanced Draw Call commands during image rendering; when using modern graphics APIs (Vulkan / Metal / DX12), it significantly reduces CPU submission overhead and improves the smoothness of browsing large scenes. Attached Figure Description
[0093] Figure 1 A schematic diagram showing that all identical models are labeled;
[0094] Figure 2 This is a schematic diagram showing only some identical models being labeled.
[0095] Figure 3 A schematic diagram showing that identical components within the model cannot be labeled;
[0096] Figure 4 A schematic diagram showing cylindrical piles of varying heights that cannot be marked;
[0097] Figure 5 This is a flowchart illustrating the method of the present invention, wherein, for ease of visual comparison, the models in the whitened space are arranged side by side;
[0098] Figure 6 This is a schematic diagram illustrating the effect of recognizing all identical models in an embodiment of the present invention;
[0099] Figure 7 This is a schematic diagram illustrating the effect of recognizing all identical components in an embodiment of the present invention;
[0100] Figure 8 This is a schematic diagram illustrating the effect of recognizing cylinders of different heights in an embodiment of the present invention;
[0101] Figures 1-4 and Figures 6-8 In the diagram, pink represents the selected model, and blue represents the same model that has been marked. Detailed Implementation
[0102] The technical solution of the invention will be clearly and completely described below with reference to the accompanying drawings.
[0103] like Figure 5 As shown, the present invention provides a method for instantiating a three-dimensional mesh model based on affine covariance, comprising the following steps:
[0104] S1, Geometric data extraction of the 3D mesh model to be identified:
[0105] get A set of entities in a 3D mesh model to be identified. , For any one of the three-dimensional mesh models Represent its geometric information as a pair ,in:
[0106] Vertex matrix of a 3D mesh model This indicates that the 3D mesh model has The vertex, the first 3D coordinates of each vertex , ;
[0107] Topological index of 3D mesh model This indicates that the 3D mesh model has The triangular facet, the first Vertex index of each triangle , , , , .
[0108] The method of this invention is for watertight, closed solid models (closed bodies / enclosed entities), that is, three-dimensional mesh models without openings or boundaries, where each triangular facet connects to form a completely closed shell, enclosing a three-dimensional entity with a non-zero volume. Accordingly, this invention is not applicable to models composed only of curved surfaces or thin shells, such as hemispheres, a cone without a bottom, etc.
[0109] S2, Geometric Normalization:
[0110] Based on the entity set obtained in S1 By translating, rotating, and non-uniformly scaling, each of the 3D mesh models to be identified is... A unified mapping to a whitening space with zero centering, axial alignment, and covariance normalization is obtained, resulting in the corresponding set of whitening space models. And a list of affine transformation matrices for transforming the original 3D mesh model to a whitened space model. .in:
[0111] 3D mesh model The vertex matrix after conversion to white space is The three-dimensional coordinates of the vertex are used This indicates that the topological index remains unchanged before and after whitening. An affine transformation matrix contains translation, rotation, and scaling information; a standard affine transformation matrix... The last line is always Used for arbitrary vertices of a 3D mesh model. Perform affine transformation:
[0112] ,
[0113] Right now:
[0114] .
[0115] The affine transformation matrix This describes the complete geometric transformation that maps a 3D mesh model from its original space to a whitened space; mathematically, the affine transformation matrix... From the translation matrix Rotation matrix and non-uniform scaling matrix Composed of multiple elements, to achieve geometric normalization, transformations typically follow the order of translation, rotation, and non-uniform scaling, i.e.:
[0116] ,
[0117] Through affine transformation matrix 3D mesh model Mapped to a centralized and normalized whitened space model The whitened space model is independent of translation, rotation, and scale.
[0118] Obtain the translation matrix Rotation matrix and non-uniform scaling matrix The specific steps are as follows:
[0119] (1) Translation matrix:
[0120] The translation matrix is used to translate the 3D mesh model entities to the origin of the whitening space, thereby eliminating their absolute positional deviation in the global coordinate system. To ensure that the positional reference is not affected by the quality of mesh discretization (such as local wiring density and aspect ratio of triangular patches), this invention abandons the vertex arithmetic mean method, which is easily affected by uneven mesh density distribution in the 3D mesh model, and instead uses the centroid based on geometric integrals as the translation reference. The core logic is that the distribution of vertices is only a discrete sampling of the geometric surface, and the integral method, by assigning corresponding metric weights to each geometric unit, fundamentally eliminates the calculation offset caused by vertex sampling deviations during discretization.
[0121] Using the divergence theorem, the volume integral of the 3D mesh model is transformed into a directed integral of a subtetrahedron bounded by the origin and the triangular facets of the 3D mesh model. (3D mesh model) center of mass The calculation formula is:
[0122] ,
[0123] in,
[0124] The directed volume of a tetrahedron refers to the volume originating from the coordinate origin. With 3D mesh model The Volume of a geometric tetrahedron composed of triangular facets This value is the directed volume, and its sign is determined by the orientation of the patch normal vector relative to the origin. For the first The three vertices of a triangular facet.
[0125] The total volume of the 3D mesh model represents the total volume of the model, calculated as the algebraic sum of the directed volumes of all sub-tetrahedrons. This algebraic superposition mechanism ensures that the final integral result retains only the effective volume inside the closed manifold.
[0126] The centroid of the sub-tetrahedron is the arithmetic mean of the coordinates of its four vertices. .
[0127] The centroid coordinates are obtained from the above calculations. ,structure Translation matrix :
[0128] ,
[0129] When the translation matrix Acting on the original vertex At that time, the coordinates of the translated vertex satisfy:
[0130] .
[0131] (2) Rotation matrix:
[0132] After eliminating positional differences using a translation matrix, the rotational deviation of the mesh is further eliminated by solving the rotation matrix. The goal is to align the principal axes of the model with the coordinate axes of the global coordinate system, thereby eliminating pose discrepancies. This involves obtaining the rotation matrix. The specific steps are as follows:
[0133] First, we introduce the covariance matrix. The covariance matrix describes the geometric distribution characteristics of a 3D mesh model in 3D space. It reflects the degree of dispersion (i.e., projection variance) of the 3D mesh model in various directions of space; for example, it represents the variance of a given unit direction vector. In the direction of dispersion It can be represented as:
[0134] ,
[0135] in, .
[0136] In this invention, the covariance matrix The volume integral form of the covariance matrix is used to determine the mass distribution information inside the object. First, the volume integral of the 3D mesh model is transformed into a coordinate system with the origin using the divergence theorem. The volume integral of the sub-tetrahedral formed by each triangular facet. 3D mesh model. The The three vertices of the triangular facet are The covariance matrix of the volume fraction of its corresponding subtetrahedron for:
[0137] ,
[0138] By analyzing the three-dimensional mesh model By traversing all the triangular faces, the covariance matrix of the 3D mesh model is obtained. :
[0139] ,
[0140] Then, for the above covariance matrix Perform feature decomposition to extract the principal orientation information of the model:
[0141]
[0142] in, , , which is the corresponding eigenvector matrix, whose column vectors are mutually orthogonal, forming the principal axis coordinate system describing the geometric distribution of the model; Let be an eigenvalue matrix, and satisfy... The magnitude of its eigenvalues represents the degree of dispersion of the three-dimensional mesh model along the corresponding principal axis.
[0143] Based on the eigenvalue decomposition results, the rotation matrix is constructed as follows:
[0144] ,
[0145] After rotation using the rotation matrix, the first principal axis of the model Align to global coordinate system Axis, Second Spindle Align to Axis, Third Spindle Mapped to axis.
[0146] To ensure the consistency of the right-hand screw rule of the coordinate system, if For the eigenvector corresponding to the smallest eigenvalue Take the opposite number, where, This indicates the expression for the determinant.
[0147] (3) Non-uniform scaling matrix:
[0148] To eliminate the influence of size, the dispersion of the 3D mesh model along the three principal axes is normalized, and a non-uniform scaling matrix is constructed using the standard deviation of the eigenvalues. :
[0149] .
[0150] S3, Feature Space Measurement and Clustering: A Set of Whitening Space Models Based on S2 Clustering is performed based on similarity judgment under a unified geometric benchmark. The specific operation is as follows:
[0151] S31, Constructing model feature descriptors:
[0152] To achieve high-confidence model recognition, multiple model feature descriptors were constructed, as follows:
[0153] (1) Standardized enclosure dimensions : Calculate the whitening space model The span along the whitening spatial coordinate axes, arranged in descending order:
[0154] ,
[0155] in,
[0156] Representing the whitening space model vertex matrix The maximum value in the first column vector;
[0157] Representing the whitening space model vertex matrix The minimum value in the first column vector;
[0158] Representing the whitening space model vertex matrix The maximum value in the second column vector;
[0159] Representing the whitening space model vertex matrix The minimum value in the second column vector;
[0160] Representing the whitening space model vertex matrix The maximum value in the third column vector;
[0161] Representing the whitening space model vertex matrix The minimum value in the third column vector;
[0162] constitute ;
[0163] constitute .
[0164] Box size This reflects the aspect ratio characteristics of the model's outer contour after normalization by the second-order inertial tensor.
[0165] (2) Points With face number As one of the indicators to ensure that the grid is completely identical.
[0166] (3) Volume filling rate Total volume of the 3D mesh model Its minimum bounding rectangle volume The ratio:
[0167] ;
[0168] Body fill rate It characterizes the solidity or spatial fullness of the model and is the core parameter for distinguishing hollow tubes from solid shafts.
[0169] (4) Area fill rate Total grid area With the surface area of the enclosure The ratio:
[0170] ,
[0171] in,
[0172] ,
[0173] ,
[0174] ,
[0175] The Euclidean norm of a vector ( Norm); The whitening space model is represented by the first... The coordinates of the first vertex of a triangular facet; The whitening space model is represented by the first... The coordinates of the second vertex of the triangular facet; The whitening space model is represented by the first... The coordinates of the third vertex of a triangular facet.
[0176] Area fill rate This reflects the degree of wrinkling and geometric complexity of the model's surface. When A significantly larger value usually indicates that the model has a complex internal structure or a surface texture that changes frequently.
[0177] S32, Similarity judgment:
[0178] Users specify different model feature descriptors as grid similarity metrics and set corresponding tolerance thresholds. .
[0179] For any two whitening space models and If and only if the differences between all selected model feature descriptors are within the user-defined tolerance threshold. If the models are within the specified range, they are considered geometrically similar; otherwise, they are considered geometrically dissimilar.
[0180] In one embodiment of the present invention, the determination logic is as follows:
[0181] Size consistency: ;
[0182] Topological consistency: and ;
[0183] Consistency of volume filling rate: ;
[0184] Area fill rate consistency: ;
[0185] The four model feature descriptors described in S31 are not mandatory. For example, if it is permissible to classify multiple sphere models with the same shape but different mesh densities into the same type of model and instantiate them, then the number of points can be... With face number tolerance threshold and Set it to infinity, while setting the tolerance thresholds of one or more other model feature descriptors to approach a certain value. They tend to identify the exact same model.
[0186] Furthermore, the model feature descriptors are not limited to the four items mentioned in S31. Any valid feature descriptors can be set as needed. More feature descriptors can enhance the confidence of similarity determination.
[0187] S33, Model Clustering:
[0188] A greedy clustering strategy based on distance thresholds is adopted to efficiently complete the task. The specific steps for clustering a whitened space model are as follows:
[0189] (1) Initialization: Create an empty collection of categories. All whitened spatial models to be classified are marked as "to be processed", forming a set to be processed.
[0190] (2) Traversal and matching:
[0191] Take a whitening space model from the set to be processed. ;
[0192] Iterate through each existing category Its representative model (defined as a category) The first model member, denoted as )and Perform the similarity determination operation described in S32:
[0193] If determined to be geometrically similar: ... Join this category ;
[0194] If the classification is geometrically dissimilar: after traversing all existing categories, if no similar categories are found, then it is considered geometrically dissimilar. Create a new category and will This serves as a representative model for this category.
[0195] (3) Iterative loop: Repeat the above process until all whitening space models to be classified are assigned to the corresponding categories.
[0196] After clustering, a set of similar models is obtained. , Each category Recorded A similar whitening space model , , , .
[0197] S4, Instantiation Replacement: After obtaining a set of similar models Next, the original 3D mesh model is converted into an instantiated lightweight representation. The specific steps are as follows:
[0198] S41, Calculation of the restoration transformation matrix:
[0199] The core of instantiation lies in how to accurately restore each whitening space model back to the original space based on the representative model in the S3 whitening space.
[0200] For category Arbitrary whitening space model in , The formula for scene pose reconstruction using a representative model is:
[0201] ,
[0202] in, Whitening space model Relative to representative model The transformation restoration matrix, due to the whitening space model It is independent of translation, rotation and scale, and its transformation restoration matrix is the inverse of its corresponding affine transformation matrix; Representative model The vertex matrix.
[0203] Since the affine transformation matrix is a non-singular matrix composed of translation, rotation, and non-uniform scaling, its inverse matrix must exist and be unique.
[0204] S42, Data Restructuring and Storage Optimization, the specific operations are as follows:
[0205] Discard the original vertex matrices and topological indices corresponding to all non-representative models in the whitening space model; for each category Create a list of reduction transformation matrices .
[0206] Through the above operations, A 3D mesh model is transformed into A whitening space model and its corresponding Composed of a number of reduction transformation matrices Export and store a list of reduction transformation matrices to complete the instantiation of the 3D mesh model.
[0207] During the graphics rendering stage, for each category By uploading a representative model to the video memory once List of reduction transformation matrices This allows for real-time vertex transformation of each instantiated model within the shader using a single Draw Call, significantly reducing the bandwidth pressure on the communication between the CPU and GPU. Through this instantiation process, the present invention can fully utilize affine covariance to compress redundant models in any 3D scene, significantly reducing model size.
[0208] Figures 6-8 The model loading results after using the method of the present invention are shown. It can be seen that all similar meshes are correctly assembled, all identical models are identified, all identical components are identified, and cylinders of different heights are identified.
Claims
1. A method for instantiating a 3D mesh model based on affine covariance, characterized in that, Includes the following steps: S1, Geometric data extraction of the 3D mesh model to be identified: get A set of entities in a 3D mesh model to be identified. , , For any one of the three-dimensional mesh models Represent its geometric information as a pair ,in, The vertex matrix of the 3D mesh model. For the topological index of the 3D mesh model; S2, Geometric Normalization: Based on the entity set obtained in S1 By translating, rotating, and non-uniformly scaling, each of the 3D mesh models to be identified is... A unified mapping to a whitened space with zero-centered, axis-aligned, and covariance-normalized space is obtained, yielding the corresponding... A collection of whitening space models , , and the affine transformation matrix; S3, Feature Space Measurement and Clustering: The set obtained based on S2 Calculate the different model feature descriptors specified by the user as grid similarity indicators, and set the corresponding tolerance threshold. , for the purpose of Clustering is performed on the whitening space models to obtain a set of similar models. , , Each category Recorded A similar whitening space model will classify... The first model is used as the representative model; S4, instantiation replacement: Similar model set obtained based on S3 Calculate each category For each whitening space model in the table, the corresponding restoration transformation matrix is obtained, resulting in a list of the corresponding restoration transformation matrices. Discard all vertex matrices and topological indices of non-representative models to obtain A whitening space model; the aforementioned List of whitening space models and their corresponding restoration transformation matrices Export and save to complete the instantiation of the 3D mesh model.
2. The method for instantiating a three-dimensional mesh model according to claim 1, characterized in that, In step S1: Vertex matrix This indicates that the 3D mesh model has The vertex, the first 3D coordinates of each vertex , ; Topological index This indicates that the 3D mesh model has The triangular facet, the first Vertex index of each triangle , , , , .
3. The method for instantiating a three-dimensional mesh model according to claim 2, characterized in that, In step S2: The three-dimensional mesh model The vertex matrix after conversion to white space is The three-dimensional coordinates of the vertex are used This indicates that the topological index remains unchanged before and after whitening. The affine transformation matrix Used to convert 3D mesh models Mapped to a centralized and normalized whitened space model The affine transformation matrix From the translation matrix Rotation matrix and non-uniform scaling matrix Composed of multiple components: 。 4. The method for instantiating a three-dimensional mesh model according to claim 3, characterized in that, Obtain the translation matrix The specific steps are as follows: Calculate a 3D mesh model center of mass : , in, Let be the directed volume of the tetrahedron. This represents the total volume of the 3D mesh model. The center of mass of the tetrahedron; The oriented volume of the subtetrahedron From the origin With 3D mesh model The The volume of a geometric tetrahedron composed of triangular facets is given by the formula: , in, For the first The three vertices of a triangular facet; The total volume of the three-dimensional mesh model The algebraic sum of the directed volumes of all subtetrahedrons is calculated using the following formula: , The subtetrahedral centroid The calculation formula is: ; The centroid coordinates are obtained from the above calculations. ,structure Translation matrix : 。 5. The method for instantiating a three-dimensional mesh model according to claim 4, characterized in that, Obtain the rotation matrix The specific steps are as follows: Computational grid model covariance matrix : , in, For 3D mesh model The The covariance matrix of the subtetrahedrons corresponding to the triangular facets is given by the formula: , For the above covariance matrix Perform eigenvalue decomposition: , in, , , which is the corresponding eigenvector matrix, whose column vectors are mutually orthogonal, forming the principal axis coordinate system describing the geometric distribution of the model; Let be an eigenvalue matrix, and satisfy . The magnitude of its eigenvalues represents the degree of dispersion of the three-dimensional mesh model along the corresponding principal axis direction; The rotation matrix is constructed based on the results of eigenvalue decomposition, as shown in the following formula: , Among them, if For the eigenvector corresponding to the smallest eigenvalue Take the opposite number, This indicates the expression for the determinant.
6. The method for instantiating a three-dimensional mesh model according to claim 5, characterized in that, The non-uniform scaling matrix is constructed using the standard deviation of the eigenvalues. : 。 7. The method for instantiating a three-dimensional mesh model according to claim 6, characterized in that, In step S3, the model feature descriptor includes: (1) Standardized enclosure dimensions : Calculate the whitening space model The span along the whitening spatial coordinate axes, arranged in descending order: , in, Representing the whitening space model vertex matrix The maximum value in the first column vector; Representing the whitening space model vertex matrix The minimum value in the first column vector; Representing the whitening space model vertex matrix The maximum value in the second column vector; Representing the whitening space model vertex matrix The minimum value in the second column vector; Representing the whitening space model vertex matrix The maximum value in the third column vector; Representing the whitening space model vertex matrix The minimum value in the third column vector; constitute ; constitute ; (2) Points With face number As one of the indicators to ensure that the meshes are completely identical; (3) Volume filling rate Total volume of the 3D mesh model Its minimum bounding rectangle volume The ratio: ; (4) Area fill rate Total grid area With the surface area of the enclosure The ratio: , in, , , , The Euclidean norm of a vector; The whitening space model is represented by the first... The coordinates of the first vertex of a triangular facet; The whitening space model is represented by the first... The coordinates of the second vertex of the triangular facet; The whitening space model is represented by the first... The coordinates of the third vertex of a triangular facet.
8. The method for instantiating a three-dimensional mesh model according to claim 7, characterized in that: For any two whitening space models, the difference between all selected model feature descriptors is within the user-defined tolerance threshold if and only if the differences are within the user-defined tolerance threshold. If the two models are within the range, they are determined to be geometrically similar; otherwise, they are determined to be geometrically dissimilar. The clustering adopts a greedy clustering strategy based on a distance threshold, and the specific steps are as follows: (1) Initialization: Create an empty collection of categories. All whitened space models to be classified are marked as "to be processed", forming a set to be processed; (2) Traversal and matching: Take a whitening space model from the set to be processed. ; Iterate through each existing category Its representative model and Perform similarity determination: If it is determined to be geometrically similar, then... Join this category ; If no similar category is found after iterating through all existing categories, then... Create a new category and will As a representative model of this category; (3) Iterative Loop: Repeat the above process until all whitened spatial models to be classified are assigned to their respective categories, where each category , , , .
9. The method for instantiating a three-dimensional mesh model according to claim 8, characterized in that: For category Arbitrary whitening space model in The formula for scene pose reconstruction using a representative model is: , in, Whitening space model Relative to representative model The transformation restoration matrix is the inverse of its corresponding affine transformation matrix; Representative model The vertex matrix; The list of reduction transformation matrices .
10. The method for instantiating a three-dimensional mesh model according to claim 9, characterized in that: During the graphics rendering stage, for each category By uploading a representative model to the video memory once List of reduction transformation matrices The vertex transformation of each instantiated model is completed in real time in the shader using a single Draw Call.
Citation Information
Patent Citations
BIM data lightweight method and system
CN116756796A
Method for transmitting reinforcing steel bar BIM model to engineering construction based on parameterized information
CN119066747A