A method and system for calculating the combined feature coding of the inner cavity and outer shape of a three-dimensional model
By voxelizing the 3D model, filling the inner cavity and performing Boolean difference operations, segmenting the inner cavity model, calculating the shape features and using D2 encoding, the problem of difficulty in utilizing the inner cavity structure features in the existing technology is solved, and fast and accurate retrieval of the 3D model is achieved.
Patent Information
- Application Number
- CN202411392156.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Existing 3D model retrieval methods are unable to effectively utilize the internal cavity structural features of parts, resulting in inaccurate and inefficient retrieval.
The 3D model is voxelized, posture-consistent, cavity filling and Boolean difference operations are used to segment the cavity model, calculate the shape features of the outer shape and the cavity entity, and express them using D2 coding to combine them into an overall feature coding.
It achieves fast and accurate recognition and retrieval of three-dimensional models, and improves the expression efficiency and retrieval accuracy of part structural features.
Smart Images

Figure CN119379766B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer-aided design, and in particular to a method for calculating the combined feature coding of an inner cavity shape of a three-dimensional model. Background Art
[0002] With the widespread application of Computer Aided Design (CAD) in the manufacturing industry, 3D CAD models have become one of the fundamental data formats in modern manufacturing. As manufacturing continues to progress, the number of CAD part models is also increasing. Currently, the CAD parts database Trace-Parts alone contains over 100 million mechanical parts. Rapid and accurate retrieval of part models is of great significance for the design of new parts and their manufacturing processes.
[0003] However, current methods for retrieving 3D part models often rely on keyword descriptions. This is effective for parts with features such as function and type, but it is often difficult to describe and retrieve part structures through textual descriptions. Part structure is a crucial factor in achieving part function and influencing the manufacturing process. Therefore, retrieving part models with similar structures by inputting a part model (similar to image search, content-based retrieval) is crucial for quickly and accurately retrieving target parts. The key to implementing this retrieval method lies in how to represent the part's structural features, that is, how to encode the 3D model structure.
[0004] Currently, the main methods for characterizing 3D model structures include statistical shape features, topological structure graphs, projection graphs, function transformations, and deep learning-based encoding methods. These retrieval methods often treat the 3D model's outer shape as a whole. However, the internal cavity of a mechanical part also plays an important role in its functionality and processing, and is a crucial component of the part's structure. Therefore, a combined feature encoding and calculation method for the internal cavity and external shape of a 3D model is proposed. This method accurately represents the reasonable structural features of 3D models with internal cavities, facilitating the rapid and accurate recognition of 3D models. Summary of the Invention
[0005] In view of this, the present invention proposes a method and system for calculating the combined feature coding of the inner cavity and outer shape of a three-dimensional model that not only considers the external features of the part, but also fully considers the inner cavity structure and distribution conditions, and more effectively represents the overall structural characteristics of the part.
[0006] In one aspect, the present invention provides a method for calculating a combined feature encoding of an inner cavity shape of a three-dimensional model, comprising the following steps:
[0007] S1: 3D model voxelization, converting the 3D model of the part into a primitive voxel model;
[0008] S2: The posture of the parts is unified to remove the influence of the placement of the original voxel model on the structural characteristics;
[0009] S3: Filling the inner cavity of the original voxel model: completely filling the inner cavity of the original voxel model to obtain a voxel model without depressions; performing a Boolean difference operation between the voxel model after the inner cavity is filled and the original voxel model of the part to obtain the inner cavity model of the part; and taking the voxel model after the inner cavity is filled as the outer shape entity;
[0010] S4: Lumen connectivity domain analysis, dividing the obtained lumen model into several lumen entities;
[0011] S5: shape feature calculation;
[0012] S6: Combined structural feature coding, combining the shape features of the outer shape entity and the shape features of several inner cavity entities to form the overall features of the three-dimensional part.
[0013] Based on the above technical solution, preferably, the content of step S1 is: constructing the world coordinate system and X, Y and Z axes of the part; in three-dimensional space, the voxel model is represented by the following equation: t = f(x, y, z), where f(·) represents a continuous distribution in space; (x, y, z) is the coordinate in the world coordinate system, corresponding to the point on the three-dimensional model of the part; t represents the mass of the voxel, and t = 0 indicates that the voxel is empty.
[0014] Preferably, the content of step S2 is: using the second-order central moment matrix C to represent the original voxel model, making the voxel uniformly distributed in the interior and having a side length of l, v = V i +[xyz] T , V i It is the voxel of the three-dimensional model of the part; v represents the voxel V i The corresponding point on the 3D model of the part; x, y, z∈[-l / 2, l / 2]; the center of mass of the original voxel model N is the number of voxels in the original voxel model.
[0015] Further preferably, the content of step S3 is: traversing each voxel in the X-axis, Y-axis and Z-axis directions of the world coordinate system respectively, and calculating the maximum depth and minimum depth of each voxel position of the part in each YZ plane, XZ plane and XY plane; after traversing the three axial directions and three planes, completely filling the internal space of the original voxel model in the X, Y and Z directions to obtain a voxel model with the inner cavity completely filled; performing a Boolean difference operation on the voxel model after the inner cavity is completely filled and the original voxel model, subtracting the part corresponding to the original voxel model from the voxel model after the inner cavity is completely filled, and the remaining voxel model part is the inner cavity model of the part formed by filling the inner cavity, and the inner cavity model is a whole.
[0016] More preferably, the specific content of step S4 is: marking the interconnected voxels in the inner cavity model with the same label, marking the non-connected voxels with different labels, and dividing the inner cavity model into several non-connected inner cavity entities by setting different labels; the original voxel model of the part is represented as a Boolean operation result of an outer shape entity without concave shape and several inner cavity entities.
[0017] Further preferably, to determine whether the voxels in the endocardial model are interconnected, a local coordinate system is established with the voxel to be marked as a reference, and the origin of the local coordinate system coincides with the center of mass of the voxel to be marked; the x-axis of the local coordinate system is defined as the center of mass of the voxel to be marked from left to right horizontally through the center of mass; the y-axis of the local coordinate system is defined as the center of mass of the voxel to be marked from back to front horizontally, and the z-axis of the local coordinate system is defined as the center of mass of the voxel to be marked from bottom to top vertically; for the voxel to be marked, if the labels of the voxels adjacent to the negative semi-axis of the x-axis, the negative semi-axis of the y-axis, and the positive semi-axis of the z-axis of the local coordinate system are all empty voxels, then the voxel to be marked is assigned as Empty voxel, and connected with adjacent empty voxels; if the labels of the voxels adjacent to the negative semi-axis of the x-axis, the negative semi-axis of the y-axis, and the positive semi-axis of the z-axis in the local coordinate system are not all empty voxels, then the empty voxel with the smallest label among the voxels adjacent to the negative semi-axis of the x-axis, the negative semi-axis of the y-axis, or the positive semi-axis of the z-axis is assigned to the label of the current voxel to be labeled; if the labels of the voxels adjacent to the negative semi-axis of the x-axis, the negative semi-axis of the y-axis, and the positive semi-axis of the z-axis in the local coordinate system are different and are not empty voxels, it means that the current voxel to be labeled has no empty voxels connected to it, and a new label is assigned to the current voxel to be labeled.
[0018] Further preferably, the specific content of step S5 is: calculating the shape features of the obtained outer shape entity and several inner cavity entities respectively, calculating the shape features of the outer shape entity obtained in step S3 and several inner cavity entities obtained in step S4 respectively, and calculating the percentage position and volume of the center of mass of the outer shape entity and the inner cavity entity in the three-dimensional model; obtaining the structural feature codes corresponding to the shape features, the percentage position and volume of the center of mass in the three-dimensional model.
[0019] More preferably, the specific content of step S6 is: combining the structural feature codes corresponding to the outer shape entity and the inner cavity entity, and arranging the combined structural feature codes in sequence according to the order of outer shape entity first, then inner cavity entity, and the distance from the center of mass of the three-dimensional model from large to small.
[0020] More preferably, the shape characteristics of the outer shape entity and the plurality of inner cavity entities are expressed using D2 coding.
[0021] On the other hand, the present invention also provides a three-dimensional model inner cavity shape joint feature coding calculation system, including a processor and a storage medium, the storage medium stores the above-mentioned three-dimensional model inner cavity shape joint feature coding calculation method, and the processor is used to execute the method stored in the storage medium.
[0022] The present invention provides a method and system for calculating the combined feature coding of the inner cavity shape of a three-dimensional model, which has the following beneficial effects compared with the prior art:
[0023] (1) The present invention does not simply regard the internal space of a three-dimensional part or all the cavity areas as a whole. Instead, the internal area of the three-dimensional part is axially filled and Boolean operations are performed based on the voxel model to obtain the filled voxel model and the voxel model of the cavity part, respectively obtaining shape features and recombining them into a unified form of structural feature coding;
[0024] (2) The shape features of the outer shape entity and several inner cavity entities are expressed using D2 coding. By taking two different points on the surface of the entity at random and repeatedly obtaining the distance distribution between the two points, the shape features of the outer shape entity and the cavity entity are expressed, which is conducive to reading and storing the content of the structural features in a coded form. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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.
[0026] Figure 1A schematic diagram of a three-dimensional model filling and cavity thereof of a method and system for calculating the inner cavity and outer shape of a three-dimensional model according to the present invention;
[0027] Figure 2 The local coordinate system of the voxels to be marked in the method and system for calculating the inner cavity shape of a three-dimensional model of the present invention;
[0028] Figure 3 A schematic diagram of a flow chart of a method for calculating a combined feature coding of an inner cavity shape of a three-dimensional model and a system for coding structural features of the system according to the present invention;
[0029] Figure 4 A schematic diagram of a structure of a three-dimensional model inner cavity shape joint feature coding calculation method and system structure feature coding;
[0030] Figure 5 It is a schematic diagram of an embodiment of a method and system for calculating the combined feature coding of the inner cavity shape of a three-dimensional model of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0032] like Figure 1 As shown, on the one hand, the present invention provides a method for calculating the combined feature coding of the inner cavity shape of a three-dimensional model, comprising the following steps:
[0033] S1: 3D model voxelization, converting the 3D model of the part into a primitive voxel model.
[0034] The content of step S1 is: construct the world coordinate system and X, Y and Z axes of the part; in three-dimensional space, the voxel model is represented by the following equation: t = f(x, y, z), where f(·) represents a continuous distribution in space; (x, y, z) are coordinates in the world coordinate system, corresponding to points on the three-dimensional model of the part; t represents the mass of the voxel, and when t = 0, it means that the voxel is empty.
[0035] S2: The posture of the parts is unified to remove the influence of the placement of the original voxel model on the structural features.
[0036] Assuming that mass is uniformly distributed in a 3D model, some parameters are dependent solely on the model's geometry and generally remain unchanged during model transformations. The eigenvalues of the second-order central moments remain unchanged during model rotation and can be used to characterize the model. Therefore, the present invention uses the second-order central moments to represent the original voxel model.
[0037] The second-order central moment matrix C is used to represent the original voxel model, and the voxel is a cube with uniform internal mass distribution and side length l, v = V i +[xyz] T , V i It is the voxel of the three-dimensional model of the part; v represents the voxel V i The corresponding point on the 3D model of the part; x, y, z∈[-l / 2, l / 2]; the center of mass of the original voxel model N is the number of voxels in the original voxel model, then
[0038] S3: Filling the inner cavity of the original voxel model. Completely fill the inner cavity of the original voxel model to obtain a voxel model without depressions. Perform a Boolean difference operation between the voxel model after the inner cavity is filled and the original voxel model of the part to obtain the inner cavity model of the part. The voxel model after the inner cavity is filled is used as the outer shape entity.
[0039] The specific content is: traverse each voxel in the X-axis, Y-axis and Z-axis directions of the world coordinate system respectively, and calculate the maximum depth and minimum depth of each voxel position of the part on each YZ plane, XZ plane and XY plane; after traversing the three axial directions and three planes, completely fill the internal space of the original voxel model in the X, Y and Z directions to obtain a voxel model with a completely filled inner cavity; perform a Boolean difference operation on the voxel model after the inner cavity is completely filled and the original voxel model, subtract the part corresponding to the original voxel model from the voxel model after the inner cavity is completely filled, and the remaining voxel model part is the inner cavity model of the part formed by filling the inner cavity, and the inner cavity model is a whole.
[0040] The process of this step is illustrated as follows. There is a point on the XY plane that corresponds to the projection of multiple points at different distances from the XY plane in the Z-axis direction. The entities corresponding to the movements along the positive and negative directions of the Z-axis are the boundaries of the inner cavity at the corresponding positions, which are also the characteristic points between the maximum and minimum depths of the inner cavity.
[0041] S4: Analysis of the connected domain of the inner cavity, dividing the obtained inner cavity model into several inner cavity entities.
[0042] The rules for connected domain analysis are as follows: If a voxel's 6-neighborhood (i.e., the six adjacent locations above, below, front, back, left, and right of the voxel) is determined, the two voxels are considered connected. Two different voxels connected to the same voxel are also connected. If a voxel is not adjacent to any connected voxel of the other voxel, the two voxels are considered disconnected.
[0043] The specific content is: the interconnected voxels in the inner cavity model are marked with the same label, and the non-connected voxels are marked with different labels. By setting different labels, the inner cavity model is divided into several non-connected inner cavity entities; the original voxel model of the part is represented as the Boolean operation result of an outer shape entity without concave shapes and several inner cavity entities.
[0044] Reference Figure 2 To determine whether the voxels in the lumen model are interconnected, a local coordinate system is established with the current voxel to be marked as the reference. The origin of the local coordinate system coincides with the center of mass of the voxel to be marked. The x-axis of the local coordinate system is defined as the center of mass of the voxel to be marked from left to right; the y-axis of the local coordinate system is defined as the center of mass of the voxel to be marked from back to front; and the z-axis of the local coordinate system is defined as the center of mass of the voxel to be marked from bottom to top:
[0045] For the voxel to be labeled, if the labels of the voxels adjacent to the negative x-axis, the negative y-axis, and the positive z-axis of the local coordinate system are all empty voxels, then the voxel to be labeled is assigned as an empty voxel and is connected to the adjacent empty voxels.
[0046] If the labels of the voxels adjacent to the negative x-axis, the negative y-axis, and the positive z-axis in the local coordinate system are not all empty voxels, then the empty voxel with the smallest label among the voxels adjacent to the negative x-axis, the negative y-axis, or the positive z-axis is assigned to the label of the current voxel to be labeled;
[0047] If the labels of the voxels adjacent to the negative x-axis, the negative y-axis, and the positive z-axis of the local coordinate system are different and are not empty voxels, it means that the voxel to be labeled has no empty voxels connected to it, and a new label is assigned to the voxel to be labeled.
[0048] S5: Shape feature calculation.
[0049] The specific content is: calculate the shape features of the obtained outer shape entity and several inner cavity entities respectively, calculate the shape features of the outer shape entity obtained in step S3 and several inner cavity entities obtained in step S4 respectively, and calculate the percentage position and volume of the center of mass of the outer shape entity and the inner cavity entity in the three-dimensional model; obtain the structural feature coding corresponding to the shape features, the percentage position and volume of the center of mass in the three-dimensional model.
[0050] like Figure 3 As shown, in one embodiment, the shape characteristics of the outer shape entity and the plurality of inner cavity entities are expressed using D2 coding.
[0051] S6: Combined structural feature coding, combining the shape features of the outer shape entity and the shape features of several inner cavity entities to form the overall features of the three-dimensional part.
[0052] The specific content is: combine the structural feature codes corresponding to the outer shape entity and the inner cavity entity, and arrange the combined structural feature codes in order of outer shape entity first, inner cavity entity second, and the distance from the center of mass of the three-dimensional model from large to small.
[0053] On the other hand, the present invention also provides a three-dimensional model inner cavity shape joint feature coding calculation system, including a processor and a storage medium, the storage medium stores the above-mentioned three-dimensional model inner cavity shape joint feature coding calculation method, and the processor is used to execute the method stored in the storage medium.
[0054] The following is an embodiment of the present invention, which is used to illustrate the method of sampling and joint feature coding to describe the inner cavity structure.
[0055] S101: Input the 3D model of the casting, such as Figure 5 As shown in (a), the length direction is the X-axis direction, the height direction is the Z-axis direction, and the thickness direction is the Y-axis direction.
[0056] S102: Perform posture consistency processing on the input three-dimensional model of the casting, calibrate it to the standard posture, and adjust the direction of the casting through posture transformation. Figure 5 As shown in (b), the X-axis direction of the casting is the longest, the Y-axis direction is the second longest, and the Z-axis direction is the shortest. After the posture adjustment, the casting's length direction is the X-axis direction, the height direction is the Y-axis direction, and the thickness direction is the Z-axis direction.
[0057] S103: voxelize the three-dimensional model of the casting, such as Figure 5 As shown in (c).
[0058] S104: Fill the inner cavity of the casting. Figure 5As shown in (d), the yellow part is the voxel after the inner cavity is filled, which together with the original 3D model form a complete outer contour. Based on this filled voxel structure, characteristic parameters such as the D2 eigenvector and the center of mass position are calculated for the outer contour of the voxel result.
[0059] S105: Extract the voxels corresponding to the inner cavity from the complete voxel structure, such as Figure 5 As shown in (e).
[0060] S106: Segment the independent voxels through connected domain analysis and use different colors to mark them. Figure 5 As shown in (f).
[0061] S107: Sequentially number each inner cavity entity according to the order of the projection coordinates of each independent inner cavity entity on the X-axis from small to large, and combine them in the order of appearance feature code - first inner cavity feature code - second inner cavity feature code - ... to obtain a combined structural feature code.
[0062] D2 encoding is usually a 64-bit array, but the length can also be customized. It usually uses a line graph to describe the array formed by the size of the feature points in two dimensions.
[0063] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for calculating the combined feature coding of the inner cavity and outer shape of a three-dimensional model, characterized in that: The steps include: S1: 3D model voxelization, converting the 3D model of the part into a primitive voxel model; S2: The posture of the parts is unified to remove the influence of the placement of the original voxel model on the structural characteristics; S3: Filling the inner cavity of the original voxel model: completely filling the inner cavity of the original voxel model to obtain a voxel model without depressions; performing a Boolean difference operation between the voxel model after the inner cavity is filled and the original voxel model of the part to obtain the inner cavity model of the part; and taking the voxel model after the inner cavity is filled as the outer shape entity; Step S3 comprises the following steps: traversing each voxel in the X-axis, Y-axis, and Z-axis directions of the world coordinate system, respectively, and calculating the maximum depth and minimum depth of each voxel position of the part in each YZ plane, XZ plane, and XY plane; after traversing the three axial directions and three planes, completely filling the interior space of the original voxel model in the X-axis, Y-axis, and Z-axis directions to obtain a voxel model with a completely filled inner cavity; performing a Boolean difference operation between the voxel model with the completely filled inner cavity and the original voxel model, subtracting the portion corresponding to the original voxel model from the voxel model with the completely filled inner cavity; the remaining voxel model portion is the inner cavity model of the part formed by filling the inner cavity, and the inner cavity model is a whole; S4: Lumen connectivity domain analysis, dividing the obtained lumen model into several lumen entities; S5: shape feature calculation; S6: Combined structural feature coding, combining the shape features of the outer shape entity and the shape features of several inner cavity entities to form the overall features of the three-dimensional part.
2. The method for calculating the inner cavity and outer shape joint feature coding of a three-dimensional model according to claim 1, characterized in that: The content of step S1 is: construct the world coordinate system and X, Y and Z axes of the part; in three-dimensional space, the voxel model is represented by the following equation: t = f(x, y, z), where f(·) represents a continuous distribution in space; (x, y, z) are coordinates in the world coordinate system, corresponding to points on the three-dimensional model of the part; t represents the mass of the voxel, and when t = 0, it means that the voxel is empty.
3. The method for calculating the inner cavity shape joint feature coding of a three-dimensional model according to claim 2, characterized in that: The content of step S2 is: use the second-order central moment matrix C to represent the original voxel model, let the voxel be a cube with uniform internal mass distribution and side length l, v = V i +[xyz] T , V i It is the voxel of the three-dimensional model of the part; v represents the voxel V i The corresponding point on the 3D model of the part; x, y, z∈[-l / 2, l / 2]; the center of mass of the original voxel model N is the number of voxels in the original voxel model.
4. The method for calculating the inner cavity shape joint feature coding of a three-dimensional model according to claim 1, characterized in that: The specific content of step S4 is: mark the interconnected voxels in the inner cavity model with the same label, mark the non-connected voxels with different labels, and divide the inner cavity model into several non-connected inner cavity entities by setting different labels; the original voxel model of the part is represented as the Boolean operation result of the outer shape entity without concave shape and several inner cavity entities.
5. The method for calculating the combined feature coding of the inner cavity shape of a three-dimensional model according to claim 4 is characterized in that: To determine whether the voxels in the lumen model are interconnected, a local coordinate system is established with the current voxel to be marked as the reference, and the origin of the local coordinate system coincides with the center of mass of the voxel to be marked; the x-axis of the local coordinate system is defined as passing through the center of mass of the voxel to be marked horizontally from left to right; the y-axis of the local coordinate system is defined as passing through the center of mass of the voxel to be marked horizontally from back to front; and the z-axis of the local coordinate system is defined as passing through the center of mass of the voxel to be marked vertically from bottom to top; For the voxel to be labeled currently, if the labels of the voxels adjacent to the negative x-axis, the negative y-axis, and the positive z-axis in the local coordinate system are all empty voxels, then the voxel to be labeled currently is assigned as an empty voxel and is connected to the adjacent empty voxels; if the labels of the voxels adjacent to the negative x-axis, the negative y-axis, and the positive z-axis in the local coordinate system are not all empty voxels, then the empty voxel with the smallest label among the voxels adjacent to the negative x-axis, the negative y-axis, or the positive z-axis is assigned to the label of the voxel to be labeled currently; if the labels of the voxels adjacent to the negative x-axis, the negative y-axis, and the positive z-axis in the local coordinate system are different and are not empty voxels, then it means that the voxel to be labeled currently has no empty voxels connected to it, and a new label is assigned to the voxel to be labeled currently.
6. The method for calculating the inner cavity shape joint feature coding of a three-dimensional model according to claim 4, characterized in that: The specific content of step S5 is: calculating the shape features of the obtained outer shape entity and several inner cavity entities respectively, calculating the shape features of the outer shape entity obtained in step S3 and several inner cavity entities obtained in step S4 respectively, and calculating the percentage position and volume of the center of mass of the outer shape entity and the inner cavity entity in the three-dimensional model; obtaining the structural feature codes corresponding to the shape features, the percentage position and volume of the center of mass in the three-dimensional model.
7. The method for calculating the inner cavity shape joint feature coding of a three-dimensional model according to claim 6, characterized in that: The specific content of step S6 is: combining the structural feature codes corresponding to the outer shape entity and the inner cavity entity, and arranging the combined structural feature codes in order of outer shape entity first, inner cavity entity second, and distance from the centroid of the three-dimensional model from large to small.
8. The method for calculating the combined feature coding of the inner cavity and outer shape of a three-dimensional model according to claim 6, characterized in that: The shape features of the outer shape entity and the plurality of inner cavity entities are expressed using D2 coding.
Citation Information
Patent Citations
A mesoscopic structure reconstruction method based on pixel features of concrete CT images
CN109087396A
Point cloud representation generation method and device of three-dimensional point cloud, equipment and storage medium
CN115170632A