Blender-based mortise and tenon block product automatic generation of parts list method and system
By generating multi-view depth maps and stitching fingerprint maps from 3D models rotated to a normalized pose, and combining weighted and texture verification, the problem of errors in parts list statistics in existing technologies is solved, and accurate identification and list generation of manual parts are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies, when identifying left- or right-handed parts, suffer from misjudgment of topological signatures due to repetitive local geometric information, leading to errors in parts list statistics.
By analyzing the 3D model configured with a mirror modifier, the centroids of the original geometry and the mirror geometry are calculated and rotated to a normalized pose. Multi-view depth maps are generated and stitched together to form a fingerprint map. The chiral mirror relationship is identified by comparing and flipping two-dimensional images. By combining the local geometric complexity of the 3D surface with the information saliency weighting, non-critical information is filtered out, and surface visual feature texture fingerprint map verification is added.
It improves the accuracy of parts list statistics, enhances the ability to identify complex chiral parts, and ensures the accuracy of parts identification and the completeness of the list.
Smart Images

Figure CN121482053B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image analysis, and in particular to a method and system for automatically generating parts lists for mortise and tenon building block products based on Blender. Background Technology
[0002] Currently, with the rapid development of digital design and intelligent manufacturing technologies, 3D computer-aided design software is widely used in product development, virtual assembly, and production. 3D digital models are the core bridge connecting design intent and the final physical product; the completeness and accuracy of their data directly determine the efficiency and cost of subsequent production and assembly processes.
[0003] In related technologies, direct comparison based on the topological signatures of geometric objects can achieve automatic differentiation and statistical analysis of parts in a 3D model. This method collects tens of thousands of key feature points on the surface of the 3D model and calculates the local geometric descriptor (such as curvature, normal direction, and neighborhood relationships) for each point. Finally, this massive amount of local geometric information is encoded into a unique high-dimensional feature vector, i.e., the topological signature, using a specific algorithm. When it is necessary to determine whether two geometric objects are the same part, only the distance between their respective topological signature vectors needs to be calculated. If the distance is less than a preset threshold, they are determined to be the same part.
[0004] However, when a part's overall structure exhibits chirality (i.e., left-right symmetry) but contains a large number of repetitive, non-chiristic basic structural units (e.g., a structure filled with a uniform array of holes), most of the local geometric descriptors collected by the algorithm are highly similar or even completely identical. This massive amount of repetitive information creates overwhelming noise when generating the final topological signature, diluting the key geometric information that truly reflects the overall chirality. This can lead to a pair of left- and right-chirly parts, which should be strictly distinguishable, having topological signatures that are very close in distance in vector space, even falling within the threshold of being misclassified as the same part, ultimately causing statistical errors in the parts list. Summary of the Invention
[0005] This application provides a method and system for automatically generating parts lists for mortise and tenon building block products based on Blender, which is used to improve the accuracy of automatically generating parts lists from 3D design models.
[0006] The first aspect of this application provides a method for automatically generating parts lists for mortise and tenon block products based on Blender, the method comprising:
[0007] The process involves analyzing a 3D model configured with a mirror modifier to obtain both the original geometry and the mirror geometry generated by the mirror modifier. The original and mirror centroids of the original and mirror geometry are calculated, and the original and mirror geometry are moved so that their original and mirror centroids are located at the origin of the 3D model's coordinate system. Based on the volume distribution of the original and mirror geometry, the corresponding inertia tensors are calculated, and the original and mirror geometry are rotated to a preset normalized pose according to the eigenvectors of the inertia tensors. Multiple preset projection viewpoints and mirror projection viewpoints are set on the virtual spheres of the original and mirror geometry, centered on the origin of the coordinate system. Original and mirror 2D depth maps are generated at each of these viewpoints. These multiple 2D depth maps and mirror 2D depth maps are then stitched together according to a preset spatial layout to form an original fingerprint map and a mirror fingerprint map. When pixel data comparison reveals inconsistencies between the original and mirror fingerprint maps, and the fingerprint maps are flipped, the process is repeated. Figure 1 When the time comes, the mirrored geometry is identified as a chiral mirrored part, and a chiral mirrored part entry is created in the part statistics list.
[0008] In the above embodiments, the geometry is first rotated to a uniform, normalized orientation using an inertial tensor, and the problem of 3D shape comparison is transformed into the analysis of a 2D fingerprint image composed of stitched depth maps from multiple perspectives. This fingerprint image macroscopically represents the outline and structural layout of the part, thus avoiding the shortcomings of topological signature methods in related technologies, which dilute or even obscure key chiral features due to the collection of massive amounts of repetitive local geometric information. Finally, by comparing the 2D images through flipping, chiral mirror relationships can be identified, enabling the identification of complex chiral parts containing a large number of repetitive elements and improving the accuracy of parts list statistics.
[0009] In conjunction with some embodiments of the first aspect, in some embodiments, multiple two-dimensional depth maps and mirrored two-dimensional depth maps are respectively stitched together according to a preset spatial layout to form an original fingerprint map and a mirrored fingerprint map, specifically including:
[0010] Based on the local geometric complexity of the 3D surface at the corresponding viewpoint, an original local geometric complexity map and a mirrored local geometric complexity map are generated simultaneously. High-complexity regions in both maps are assigned low weight values, and low-complexity regions are assigned high weight values, thus generating an original saliency-weighted mask and a mirrored saliency-weighted mask, respectively. Multiple original 2D depth maps are concatenated with multiple original saliency-weighted masks and pixel-level weighted calculations are performed to generate an original fingerprint map. Simultaneously, multiple mirrored 2D depth maps are concatenated with multiple mirrored saliency-weighted masks and pixel-level weighted calculations are performed to generate a mirrored fingerprint map.
[0011] In the above embodiments, by establishing an inverse relationship between the local geometric complexity and information saliency of the 3D surface, high weights are assigned to smooth, large, low-complexity regions, while low weights are assigned to highly complex regions with intricate details. When this weight (saliency-weighted mask) is used for pixel-level weighted calculation with the depth map, it can adaptively suppress local details on the model surface that are prone to causing interference (such as decorative textures and dense mortise and tenon structures), while strengthening macroscopic contour features that define the core shape of the part. This results in the final generated fingerprint image filtering out non-critical information and more fundamentally expressing the overall structure of the part, thereby improving the accuracy of subsequent chiral part recognition.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, based on the local geometric complexity of the three-dimensional surface at the corresponding viewpoint, the original local geometric complexity map and the mirrored local geometric complexity map are generated simultaneously, specifically including:
[0013] Locate the 3D surface point corresponding to each pixel in the 2D depth map on the 3D model surface; determine a neighborhood of a preset size on the 3D model surface centered on the 3D surface point; collect the 3D surface normal vectors of multiple sampling points within the neighborhood to form a normal vector set; perform principal component analysis on the normal vector set to determine the three principal directions of the normal vector distribution, and calculate the first, second, and third eigenvalues corresponding to the three principal directions respectively; calculate the ratio between the third eigenvalue and the sum of the first, second, and third eigenvalues to obtain the geometric complexity; write the geometric complexity value as the pixel value to the corresponding pixel position in the new 2D map, and generate a local geometric complexity map after traversing all pixels of the 2D depth map.
[0014] In the above embodiments, principal component analysis is performed on the set of normal vectors in the local neighborhood of the 3D model surface, and the complexity concept is transformed into a precise quantitative index using the ratio of its minimum eigenvalue to the sum of eigenvalues. Since this index has a natural discriminative effect on the responses to different geometric features such as flat regions, edges, and corners, it can be measured objectively and stably. Finally, by mapping this index point by point to pixel values, a local geometric complexity map that quantitatively reveals the details and abrupt changes of the model surface structure is generated, achieving accurate two-dimensional digitization of 3D surface features and improving the accuracy of subsequent chirality recognition.
[0015] In conjunction with some embodiments of the first aspect, in some embodiments, after rotating the original geometry and the mirror geometry to a preset normalized pose based on the eigenvectors of the inertia tensor, the method further includes:
[0016] If, among the three eigenvalues calculated from the inertial tensor, the difference between two eigenvalues is less than a preset symmetry judgment threshold, the symmetry plane defined by the eigenvectors corresponding to the two eigenvalues is identified. All three-dimensional vertices of the original geometry and the mirror geometry are then vertically projected onto the symmetry plane to obtain the original two-dimensional projection point set and the mirror two-dimensional projection point set, respectively. In the original two-dimensional projection point set and the mirror two-dimensional projection point set, the unique original reference point and the mirror reference point farthest from the origin of the coordinate system are calculated and determined, respectively. The calibration vectors pointing from the origin of the coordinate system to the original reference point and the mirror reference point are calculated, respectively. The original geometry and the mirror geometry are then subjected to axisymmetric rotation, respectively, so that the calibration vectors are aligned with the preset reference coordinate axis in the symmetry plane.
[0017] In the above embodiments, the attitude uncertainty caused by rotational symmetry is first determined by utilizing the eigenvalues of the inertial tensor. Then, the three-dimensional vertices are projected onto the symmetry plane, and a unique geometrically farthest point is determined in this two-dimensional space as a stable anchor point to eliminate ambiguity. Finally, this anchor point is aligned to a preset direction through axisymmetric rotation, thereby avoiding the ambiguity problem during the attitude normalization of symmetrical parts, ensuring that any part can be converged to an absolutely unique standard attitude, and improving the accuracy of subsequent chirality recognition.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after calculating and determining the unique original reference point and mirror reference point farthest from the origin of the coordinate system, the method further includes:
[0019] When calculating multiple original reference points farthest from the origin, these points are combined into a set of original candidate reference points. In the 3D models of the original geometry and the mirror geometry, all recessed mortise structures are identified and located. According to preset geometric rules, the original reference mortise structure and the mirror reference mortise structure are determined from all mortise structures. In the set of original candidate reference points, the candidate reference point with the closest projection distance to the geometric center of the original reference mortise structure on the plane of symmetry is selected and determined as the unique original reference point.
[0020] In the above embodiments, when the orientation cannot be uniquely determined due to multiple candidate reference points generated by symmetry, the functional features of the part (mortise structure) are introduced as a higher-level judgment criterion. A unique reference mortise structure is determined among all mortise structures according to preset geometric rules, and an absolutely stable spatial anchor point is constructed. Then, by calculating the projection distance, this anchor point resolves the ambiguity in the selection of the original candidate reference points. This avoids the orientation uncertainty introduced by symmetry, ensures the consistency of the reference for subsequent comparisons, and ultimately improves the accuracy of chiral part identification.
[0021] In conjunction with some embodiments of the first aspect, in some embodiments, all recessed mortise structures are identified and located in the three-dimensional models of the original geometry and the mirrored geometry, specifically including:
[0022] The surface of the 3D model is decomposed into multiple discrete surface basic units. All surface basic units are traversed, and the arithmetic mean of the 3D coordinates of all vertices constituting each surface basic unit is calculated to determine the geometric center of the unit. The centroid surface vector pointing from the origin of the coordinate system to the geometric center of the unit is calculated. The dot product of the centroid surface vector and the surface normal vector of the surface basic unit is calculated. When the dot product is less than a preset concavity threshold, the corresponding surface basic unit is marked as a concave unit. Among all concave units, a connected component analysis algorithm is applied to group all concave units that are adjacent to each other in the topology through shared edges or shared vertices into tessellations. All boundary vertices adjacent to non-concave units are identified, forming an opening profile. The arithmetic mean of the 3D coordinates of all vertices on the opening profile is calculated to determine the geometric center of the corresponding tessellation.
[0023] In the above embodiments, the basic units of the depressions were screened by using the dot product of the centroid surface vector and the normal vector. Then, connected component analysis was used to integrate these discrete units into a mortise structure with practical engineering significance. Finally, by locating the geometric center of the opening profile, a stable quantitative anchor point was given to the structure, which can capture and distinguish the key structural differences of chiral parts, providing a reliable basis for subsequent matching.
[0024] In conjunction with some embodiments of the first aspect, in some embodiments, when pixel data comparison reveals that the original fingerprint image is inconsistent with the mirrored fingerprint image and the flipped fingerprint image is inconsistent with the mirrored fingerprint image... Figure 1 When a mirrored geometry is identified as a chiral mirrored part and a chiral mirrored part entry is created in the part statistics list, the following is also included:
[0025] When surface visual features are identified on the original and mirrored geometries, additional original and mirrored texture fingerprints are generated to characterize the surface visual features, using the same preset projection viewpoint and spatial layout as when the original and mirrored fingerprints were generated. The original texture fingerprint is then horizontally flipped to obtain a flipped texture fingerprint. When the flipped texture fingerprint is found to be inconsistent with the mirrored texture fingerprint by comparing pixel data, the chiral mirror relationship is corrected to an independent asymmetric relationship. An independent asymmetric part entry is generated in the part statistics list to replace the chiral mirrored part entry.
[0026] In the above embodiments, by adding a texture fingerprint verification checkpoint based on surface visual features on top of the determined geometric chirality, a two-dimensional flipping operation is used to simulate a mirror-symmetric transformation, and the transformation result is compared pixel-level with the texture fingerprint of the real mirror part. Once an inconsistency is found, the pseudo-chirality relationship caused by asymmetric texture or color can be identified, correcting potential misjudgments that rely solely on geometric analysis, ensuring the final confirmation of the independence of the part, and thus improving the accuracy of automatically generating a parts list from the 3D design model.
[0027] In a second aspect, embodiments of this application provide an automatic parts list generation system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the automatic parts list generation system to perform the method described in the first aspect and any possible implementation thereof.
[0028] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on an automatic parts list generation system, cause the automatic parts list generation system to perform the method described in the first aspect and any possible implementation thereof.
[0029] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an automatic parts list generation system, cause the automatic parts list generation system to perform the method described in the first aspect and any possible implementation thereof.
[0030] It is understood that the automatic parts list generation system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the Blender-based method for automatically generating parts lists for mortise and tenon building block products provided in the embodiments of this application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.
[0031] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0032] 1. This application first utilizes inertia tensors to rotate the geometry to a unified, normalized orientation, and transforms the 3D shape comparison problem into the analysis of a 2D fingerprint image composed of stitched depth maps from multiple perspectives. This fingerprint image macroscopically represents the outline and structural layout of the part, thus avoiding the shortcomings of related technologies where topological signature methods are diluted or even obscured by the collection of massive amounts of repetitive local geometric information. Finally, through 2D image flipping comparison, chiral mirror relationships can be identified, enabling the identification of complex chiral parts containing a large number of repetitive elements and improving the accuracy of parts list statistics.
[0033] 2. This application establishes an inverse relationship between the local geometric complexity and information saliency of a 3D surface, assigning high weight to smooth, large, low-complexity regions and low weight to highly complex regions with intricate details. When performing pixel-level weighted calculations of this weight (saliency-weighted mask) with the depth map, it adaptively suppresses easily interfering local details on the model surface (such as decorative textures and dense mortise and tenon structures) while strengthening macroscopic contour features that define the core shape of the part. This results in a fingerprint image that filters out non-critical information, more fundamentally expressing the overall structure of the part, thereby improving the accuracy of subsequent chiral part recognition.
[0034] 3. This application introduces the functional features (mortise and tenon structure) of the part as a higher-level judgment criterion when the pose cannot be uniquely determined due to multiple candidate reference points generated by symmetry. A unique reference mortise and tenon structure is determined among all mortise and tenon structures according to preset geometric rules, and an absolutely stable spatial anchor point is constructed. Then, by calculating the projection distance, this anchor point resolves the ambiguity in the selection of the original candidate reference points. This avoids the pose uncertainty introduced by symmetry, ensures the consistency of the reference for subsequent comparisons, and ultimately improves the accuracy of chiral part identification. Attached Figure Description
[0035] Figure 1 This is a flowchart illustrating a method for automatically generating a parts list for mortise and tenon building block products based on Blender, as described in this application.
[0036] Figure 2 This is a flowchart illustrating the method logic of the automatic parts list generation method for mortise and tenon building block products based on Blender in this application embodiment.
[0037] Figure 3 This is another flowchart illustrating the method for automatically generating a parts list for mortise and tenon building block products based on Blender in this application embodiment;
[0038] Figure 4 This is an exemplary hardware structure diagram of an automatic parts list generation system in the embodiments of this application. Detailed Implementation
[0039] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0040] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0041] In related technologies, parts are distinguished by directly performing geometric registration on the 3D models, that is, attempting to completely overlap one model with another through rotation and translation. If perfect overlap is not possible, the sum of the nearest point distances on the two surfaces is calculated as a measure of difference. However, when this method is applied to chiral parts (i.e., left and right mirror images of each other), inherent ambiguity arises. Since chiral parts cannot be overlapped simply through rotation and translation, the algorithm calculates a non-zero difference value. However, this difference value alone cannot determine whether the non-overlap is due to the two being distinct independent parts or because they conform to the expected chiral mirror relationship. This lack of ability to effectively identify the special transformation relationship of mirror symmetry often leads the algorithm to misclassify chiral parts as independent parts or fail to group them effectively, resulting in statistical errors in the parts list.
[0042] In this embodiment, the geometry is first rotated to a uniform, normalized orientation using an inertial tensor, establishing an unambiguous benchmark for subsequent comparisons and avoiding interference from inconsistent initial positions and orientations. More importantly, the complex problem of 3D geometry comparison is reduced in dimensionality by generating depth maps from multiple preset viewpoints and stitching them together to form a 2D fingerprint, macroscopically encoding 3D geometric features into 2D image information. The horizontal flipping operation of the 2D image is used to accurately simulate mirror transformations in 3D space. By comparing whether the original flipped fingerprint and the fingerprint of the mirrored geometry are completely identical at the pixel level, a chiral mirror relationship can be directly determined. This method avoids the ambiguity caused by the difficulty in identifying mirror symmetry in related technologies, ultimately improving the automation level and accuracy of parts list generation.
[0043] Figure 1 This is a flowchart illustrating a method for automatically generating a parts list for mortise and tenon building block products based on Blender, as described in this application, including the following steps:
[0044] S101. Analyze the 3D model configured with the mirror modifier to obtain the original geometry and the mirror geometry generated by the mirror modifier.
[0045] Among them, a 3D model represents the digital representation of an object in computer 3D space, described by data structures such as vertices, edges, and faces; a mirror modifier is a procedural function in 3D modeling software (such as Blender and 3ds Max) that can generate a virtual copy that is completely symmetrical to the part directly edited by the user in real time according to a set plane of symmetry, thereby simplifying the design process of symmetrical models; the original geometry represents the part of the 3D mesh data that the designer directly creates and edits during the modeling process; and the mirror geometry refers to the part of the 3D mesh data that is automatically calculated and generated by the mirror modifier based on symmetry relationships, serving as a mirror copy of the original geometry.
[0046] Specifically, upon receiving the user's design files and before performing any geometric analysis, the overall structure in the design software (an object with a modifier) is transformed into two physically independent entities (the original geometry and the mirrored geometry) that can be analyzed separately. The 3D model's data is accessed via a programming interface (API), iterating through the list of objects in the model. When a mirror modifier is detected on an object, a virtual operation of applying or evaluating the modifier is performed, forcing the software to calculate the final, complete mesh containing both the original and mirrored parts based on the modifier's parameters (primarily the position and orientation of the mirror plane).
[0047] Subsequently, based on the information from the mirror plane, all vertices of the complete mesh are divided: vertices located on one side of the plane and the faces they form are classified as original geometry, while those located on the other side are classified as mirror geometry, thus loading them into memory as two independent data structures.
[0048] In some embodiments, this model analysis and geometry separation process can be implemented in a variety of ways:
[0049] Optionally, a method based on a specific software API can be used: the target 3D model file is loaded into the corresponding modeling software environment via a script (such as a Python script), for example, loading a .blend file in Blender; the objects in the scene are traversed via the API, and the modifier stack is checked to see if a modifier of type Mirror exists; if it exists, a function in the API is called, such as a temporary evaluated version of bpy.ops.object.modifier_apply() or object.to_mesh(), to generate a temporary mesh data block with the modifier applied, and according to the mirror axis information recorded in the mirror modifier, the vertices of the temporary mesh are divided into two independent vertex sets and face sets, which constitute the original geometry and the mirror geometry, respectively.
[0050] It is understandable that other methods can be used to achieve the above analysis and separation, such as using a plugin to directly complete the separation and export the results within the 3D software; this is not limited here.
[0051] S102. Calculate the original centroid and mirror centroid of the original geometry and the mirror geometry respectively, and move the original geometry and the mirror geometry so that the original centroid and the mirror centroid are located at the origin of the coordinate system of the 3D model.
[0052] The centroid refers to the equilibrium point of the geometry in space. For a 3D mesh composed of discrete vertices, the centroid coordinates are usually obtained by calculating the arithmetic mean of the coordinates of all vertices, representing the center position of the geometric distribution of the object. The original centroid and the mirror centroid represent the centroids that belong to the original geometry and the mirror geometry, respectively. The origin of the coordinate system of the 3D model is the point where the X, Y, and Z axes intersect in 3D space, with coordinates (0, 0, 0).
[0053] Specifically, this eliminates positional differences of objects in 3D space (translation invariance), ensuring that subsequent rotation and comparison operations are performed around a common, meaningful center point. Theoretically, calculating the centroid is an integral of the object's volume, but in computer graphics, it's usually simplified to summing the coordinates of all vertices constituting the object and dividing by the total number of vertices. For example, for a geometry with N vertices, the centroid C(Cx, Cy, Cz) is calculated as: Cx = (Σxi) / N, Cy = (Σyi) / N, Cz = (Σzi) / N. After calculating the original centroid C_orig and the mirror centroid C_mir, the coordinates of each vertex V_orig in the original geometry are updated to V_orig - C_orig; simultaneously, the coordinates of each vertex V_mir in the mirror geometry are updated to V_mir - C_mir. Through this vector subtraction operation, the two geometric objects, regardless of their previous location in space, will be translated so that their respective geometric centers coincide with the origin of the coordinate system (0, 0, 0).
[0054] In some embodiments, this centroid calculation and translation operation can be implemented in a variety of ways:
[0055] Optionally, the vertex averaging method can be used: create an accumulator vector (initially 0, 0, 0) and a vertex counter for the target geometry (such as the original geometry); traverse each vertex in the geometry mesh data and accumulate the (x, y, z) coordinates into the accumulator vector; after the traversal, divide each component of the accumulator vector by the total number of vertices to obtain the centroid coordinates; traverse all vertices again and subtract the centroid coordinates from the coordinates of each vertex.
[0056] It is understandable that other methods can be used to calculate the centroid, such as calculating the weighted average of voxel centers for voxelized models, which is not limited here.
[0057] S103. Based on the volume distribution of the original geometry and the mirror geometry, calculate the corresponding inertia tensor respectively, and rotate the original geometry and the mirror geometry to the preset normalized posture according to the eigenvector of the inertia tensor.
[0058] Among them, volume distribution represents the distribution of all material elements constituting a three-dimensional object in space, determining the object's rotational characteristics; the inertia tensor is a 3x3 symmetric matrix that describes the rotational inertia of a rigid body around its center of mass, i.e., the object's resistance to rotation in different directions, and can be regarded as the mathematical expression of the object's volume distribution; the eigenvectors (specifically referring to the eigenvectors of the inertia tensor) are the three mutually orthogonal vectors corresponding to the inertia tensor, defining the object's three principal inertial axes, i.e., the three axes on which the object can rotate most stably; the preset normalized pose refers to the standard alignment pose defined by humans for ease of comparison, derived from common knowledge and engineering practice in the fields of computer graphics and robotics, with the aim of ensuring that any object, regardless of its initial orientation, can eventually be aligned to a unified and unambiguous pose. The preset rule is to align the principal inertial axis with the smallest inertia (the axis around which the object is most likely to rotate) to the Z-axis of the world coordinate system, and align the axis with the largest inertia to the X-axis.
[0059] Specifically, the rotational differences of objects in 3D space are eliminated (rotation invariance), allowing two objects with the same shape but different orientations to be rotated to the same standard pose for comparison. After the object is moved to the origin, the inertia tensor is calculated, typically approximated by decomposing the object into a large number of tiny tetrahedrons (composed of mesh surface triangles and the origin) and accumulating their inertia tensors. After obtaining a 3x3 inertia tensor matrix, eigenvalue decomposition is performed using a standard linear algebra algorithm (such as the Jacobi iteration method), resulting in three eigenvalues and three corresponding eigenvectors. These three eigenvectors constitute the object's intrinsic coordinate system. Subsequently, a rotation matrix is constructed according to a predefined normalized pose rule. The rotation matrix rotates the object's intrinsic coordinate system, composed of eigenvectors, to align with the world coordinate system (X, Y, Z). For example, finding the eigenvector V_max corresponding to the largest eigenvalue and the eigenvector V_min corresponding to the smallest eigenvalue, the rotation matrix rotates V_max to the (1, 0, 0) direction and V_min to the (0, 0, 1) direction. The rotation operation can be completed by applying this calculated rotation matrix to each vertex of the geometry.
[0060] In some embodiments, this rotation normalization process can be implemented in a variety of ways:
[0061] Optionally, an inertia tensor calculation based on a discrete mesh can be used: the mesh model centered at the origin is decomposed into a series of tetrahedrons with the origin as vertices and surface triangular patches as bases; the inertia tensor of each tetrahedron relative to the origin is calculated using known analytical formulas; the inertia tensors of all tetrahedrons are matrix-added to obtain the total inertia tensor of the entire geometry, and then its eigenvectors are obtained through eigenvalue decomposition algorithm, and a rotation matrix is constructed and applied.
[0062] It is understandable that other methods can be used to achieve pose alignment, such as using other shape descriptors (e.g., spherical harmonic functions) to determine the standard orientation of an object, which is not limited here.
[0063] S104. Centered on the origin of the coordinate system, set multiple original projection viewpoints and mirror projection viewpoints in preset directions on the virtual spheres of the original geometry and the mirror geometry, and generate an original two-dimensional depth map and a mirror two-dimensional depth map at each original projection viewpoint and mirror projection viewpoint.
[0064] In this context, the virtual sphere refers to a non-existent sphere with a sufficiently large radius, artificially defined in three-dimensional space with the origin of the coordinate system as its center. It serves as a standardized positional reference surface for placing virtual cameras. The preset direction refers to a set of fixed points on the virtual sphere that are predetermined for placing the virtual camera. This is based on experimental and geometric principles that ensure the completeness and repeatability of sampling. Typically, a set of points that can uniformly cover the sphere is selected, such as the vertex directions of a regular polyhedron (a dodecahedron or an icosahedron), to ensure that objects can be observed from all angles without blind spots or redundancy. The projection viewpoint is equivalent to the position and orientation of the virtual camera. Each pixel in the two-dimensional depth map represents the straight-line distance from the corresponding point on the surface of the three-dimensional object to the projection viewpoint (camera).
[0065] Specifically, the simulation involves placing an object in the center of a room filled with cameras and taking 360-degree photographs. First, a virtual sphere is defined to surround the object. Then, based on preset directions (e.g., the 32 directions corresponding to the 12 vertices and 20 faces of a regular icosahedron), a series of virtual orthogonal projection cameras are placed on the virtual sphere, all facing the origin of the coordinate system. For each preset projection viewpoint, a rendering is performed to generate a depth map. This is typically achieved using the Z-Buffer (depth buffer) function of the graphics processing unit (GPU). In the rendering pipeline, the GPU calculates the distance (Z value) from each pixel's corresponding 3D point to the camera to handle object occlusion. The data in the Z-Buffer is extracted and normalized (e.g., mapping the nearest point to white and the farthest point to black), ultimately saving it as a grayscale image, i.e., a 2D depth map. This process is performed separately and independently on the original geometry and its mirrored geometry, using the exact same set of preset projection viewpoints, thus obtaining two sets of depth maps.
[0066] In some embodiments, this multi-view depth map generation can be achieved in a variety of ways:
[0067] Optionally, CPU-based software ray tracing is employed: For each preset projection viewpoint, a virtual pixel mesh (image plane) is constructed; a ray is emitted from the center of each pixel towards the origin; using a ray-triangle intersection algorithm, the intersection points of this ray with all triangular faces of the geometric mesh are calculated, and the intersection point closest to the camera is identified. This closest distance is the depth value of that pixel. By traversing all pixels, a depth map is generated.
[0068] It is understandable that other methods can be used to capture depth information, such as point cloud projection, which are not limited here.
[0069] S105. Multiple two-dimensional depth maps and mirrored two-dimensional depth maps are spliced together according to a preset spatial layout to form the original fingerprint map and the mirrored fingerprint map.
[0070] Among them, the preset spatial layout refers to the two-dimensional image stitching template, which defines the specific position of the depth maps generated from different viewpoints in the final composite image. It comes from well-known design principles in the field of information visualization and aims to integrate multi-source information in a structured and predictable way. The original fingerprint map and the mirror fingerprint map refer to the large-size composite image that is finally stitched together from their respective depth map sets according to the preset layout.
[0071] Specifically, comparing two sets of images (e.g., 32 images per set) requires 32 independent comparisons, while stitching them together into a fingerprint only requires a comparison of the entire image, resulting in higher efficiency and clearer logic. First, a blank image canvas is created based on a preset spatial layout (e.g., a 4x8 grid corresponding to 32 viewpoints). Then, depth maps generated from the original geometry are read one by one in a preset order. For each depth map, the target coordinate region on the canvas is calculated, and then the pixel data of that depth map is completely copied to this region. For example, the depth map from the first preset viewpoint is placed in the upper left corner of the canvas, the second is placed to its right, and so on, until all depth maps are pasted onto the canvas in the specified positions. After this process is completed, the original fingerprint is generated. The exact same stitching operation is applied to the set of depth maps of the mirrored geometry, thus generating a mirrored fingerprint. Since the entire process (normalization, viewpoint setting, stitching layout) is highly standardized, as long as the shapes of the two 3D objects are completely identical under normalized poses, their generated fingerprints will also be completely identical.
[0072] In some embodiments, this image stitching process can be implemented in a variety of ways:
[0073] Optionally, this can be achieved through low-level array memory copying: Allocate a sufficiently large byte array in memory to store all pixel data of the final fingerprint; traverse all generated depth maps (which are themselves pixel arrays in memory); for each depth map, calculate its starting memory address offset in the target large array based on its position in the layout, and then use an efficient memory copy function (such as memcpy) to copy the pixel data of the current depth map row by row to the corresponding position in the large array. After completion, save the memory block directly as an image file.
[0074] It is understandable that other methods can be used to synthesize fingerprint images, such as generating an atlas texture containing all views, which is not limited here.
[0075] In some embodiments, to enhance the robustness of fingerprint comparison and highlight the key geometric features of the parts, a weighting step based on the local geometric complexity of the three-dimensional surface can be introduced during the process of generating the final fingerprint from the spliced depth map, thereby generating a weighted fingerprint that can distinguish between primary and secondary structures and suppress noise interference.
[0076] Specifically, for the two-dimensional depth map of the original geometry (and the same applies to the mirror geometry), each pixel is traversed. For the current pixel, the reverse mapping from two-dimensional to three-dimensional is first performed. That is, based on the coordinates of the pixel and its depth value (distance information), combined with the virtual camera parameters (such as the projection matrix) used when generating the depth map, the three-dimensional surface point P corresponding to the pixel on the surface of the three-dimensional model is calculated.
[0077] Subsequently, a region of a predetermined neighborhood size is defined on the surface of the 3D model, centered at point P. This neighborhood size is a parameter pre-set based on the model dimensions and the required analysis scale. Within this neighborhood, 3D surface normal vectors from multiple sampling points are collected, forming a normal vector set {N}. The directional distribution of these normal vectors reflects the curvature and variations of the surface within this neighborhood.
[0078] To quantify this distribution, Principal Component Analysis (PCA) is performed on the set of normal vectors {N}. PCA is a statistical method used to identify the dominant directions of variation in data. In this application, three mutually orthogonal principal directions of this normal vector distribution are determined, and the variance of the data along these three principal directions is calculated, i.e., three eigenvalues λ1 ≥ λ2 ≥ λ3. The first eigenvalue λ1 is the largest, corresponding to the most dominant direction of the normal distribution (approximately the average normal of that neighborhood); the third eigenvalue λ3 is the smallest, representing the dispersion of the normals in the least dominant direction. The relative magnitudes of these three eigenvalues contain rich geometric information: if the surface is planar, all normal directions are consistent, λ1 is large while λ2 and λ3 are close to zero; if it is a sharp edge or corner, the normal distribution will be more divergent, and the values of λ2 and λ3 will increase significantly.
[0079] Therefore, the ratio C = λ3 / (λ1 + λ2 + λ3) is used as a measure of geometric complexity. This ratio reflects the degree of anisotropy in the normal distribution: C approaches 0 in flat regions, while C values are larger in highly curved or irregular regions. The calculated geometric complexity C (after normalization) is used as a pixel value and written to the corresponding pixel position in the new 2D map. After traversing all pixels of the 2D depth map, a value corresponding to that depth is generated. Figure 1 A corresponding local geometric complexity map. This process will be applied to all original 2D depth maps and mirrored 2D depth maps, resulting in two complete sets of local geometric complexity maps.
[0080] The complexity map generated in the previous step is used to create a weight map, and the depth map data is modulated. First, based on the principle of assigning low weight values to high-complexity regions and high weight values to low-complexity regions, the local geometric complexity map is transformed into a saliency-weighted mask. For example, this can be achieved through a simple inversion mapping W=1-C, meaning that regions with higher geometric complexity (larger C value) have lower weight values W; conversely, geometrically flat and stable regions (smaller C value) have higher weight values W. The advantage of this approach is that it reduces the influence of regions with rich geometric details but potentially introducing uncertainty due to modeling or meshing differences, while enhancing the role of macroscopic, stable main shapes in the final alignment.
[0081] After generating corresponding weighted masks for each depth map, the final fingerprint image is synthesized. Unlike the original S105 step, this is not a simple stitching process. First, multiple original 2D depth maps are stitched together into a large base original depth fingerprint image according to a preset spatial layout. Simultaneously, multiple original saliency weighted masks are stitched together into a large overall original weighted mask image with the same layout. Finally, the final original fingerprint image is generated by performing pixel-level multiplication on these two large images: final original fingerprint image (x, y) = base original depth fingerprint image (x, y) × overall original weighted mask image (x, y). The same process is applied to the mirrored geometry to generate the final mirrored fingerprint image. Through this weighted calculation, the importance of different regions on the fingerprint image is redistributed, making subsequent comparisons more focused on those geometric regions considered more reliable and representative.
[0082] The above technical steps improve the robustness of the comparison by introducing weighting. Regions with high geometric complexity (such as sharp corners and chamfers) are more sensitive to small differences in modeling or meshing. By reducing the weight of these regions in the fingerprint image, the interference of potential noise can be reduced, making the final comparison result more dependent on the macroscopic and stable main shape of the object, thereby avoiding misjudgment caused by local detail differences and enhancing the accuracy of recognition.
[0083] S106. When pixel data comparison reveals inconsistencies between the original fingerprint image and the mirrored fingerprint image, and the flipped fingerprint image is also inconsistent with the mirrored fingerprint image... Figure 1 When the time comes, the mirrored geometry is identified as a chiral mirrored part, and a chiral mirrored part entry is created in the part statistics list.
[0084] Among them, pixel data comparison refers to the process of comparing the pixel values of two images at the same coordinate position one by one to see if they are completely equal; flipped fingerprint refers to the new image obtained by swapping the original fingerprint image as a two-dimensional image along the vertical central axis (horizontal flip); chiral mirror parts are used to represent two parts that are mirror images of each other, but cannot be made to completely overlap by simple translation and rotation in three-dimensional space, such as the left and right hands of a person; Bill of Materials (BOM) is a key document in the manufacturing process that records in detail the names, specifications, quantities and other information of all the parts required to constitute a final product.
[0085] Specifically, the first step is to perform an initial comparison: directly comparing the original fingerprint image and its mirror image. This is achieved by calculating the sum of the absolute differences between all corresponding pixel values in the two images. If the sum is zero (or less than a very small threshold), it means the two fingerprint images are completely identical. This implies that the original geometry is inherently symmetrical (non-chiral), and the mirroring operation did not produce a new shape.
[0086] If the initial comparison results are inconsistent, it indicates that the two geometries are not entirely identical. At this point, the process proceeds to the second step: generating a flipped fingerprint image in memory. This two-dimensional horizontal flipping operation simulates the impact of a three-dimensional mirroring operation on the viewing perspective. For example, under normalized orientation, the left-view depth map of the original geometry corresponds precisely to the right-view depth map of the mirrored geometry. By horizontally flipping the stitched original fingerprint image, these corresponding views are precisely aligned on the image.
[0087] Then, a second comparison is performed: comparing the flipped fingerprint and the mirrored fingerprint. If this comparison is consistent, it indicates that the original geometry and the mirrored geometry are chiral mirror images of each other. Based on this determination, the parts inventory is updated. For example, if the original part is named "Left Wing Plate," a new entry named "Right Wing Plate" is created, or the demand for the wing plate is recorded as 1 unit and 1 mirrored unit, thus ensuring the accuracy of production material preparation. If the second comparison is still inconsistent, it means that the two geometries are neither identical nor chiral mirror images of each other, and may be two completely independent parts.
[0088] It is understandable that other methods can be used to determine chiral relationships, such as by comparing the topological descriptors of two 3D models, which is not limited here.
[0089] In some embodiments, for parts that are geometrically chiral mirror images but may have asymmetrical visual features (such as text or patterns) on their surfaces, after determining that they are chiral mirror images in S106, a verification step of the surface visual features can be further introduced to achieve accurate correction of the part relationship and avoid misclassifying visually asymmetrical mirror images as functionally interchangeable chiral images.
[0090] Specifically, after the geometric shape comparison in S106 (through depth fingerprinting) preliminarily determines that the original geometry and the mirror geometry form a chiral mirror relationship, it is checked whether the surface appearance of this pair of geometrically mirrored parts also satisfies the characteristic of mirror symmetry.
[0091] Using multiple preset projection viewpoints identically set for the geometry in S104, the original and mirrored geometries are photographed again. The rendering target is the color information of the object's surface, i.e., generating a standard two-dimensional color image. This color information comes from the surface visual features inherent in the 3D model itself, mainly in two forms: one is a texture map, which is one or more two-dimensional images mapped to the model's surface through UV coordinates, often used to represent complex patterns, text, or material details; the other is vertex color data, which is the color information directly stored on each vertex of the model, interpolated on the facets to form smooth color transitions.
[0092] During rendering, the graphics pipeline analyzes this visual feature data, generating a series of color images observed from different standard perspectives. Then, using a preset spatial layout consistent with S105, these color images generated for the original geometry are stitched together to form an original texture fingerprint that provides an overview of all its visual information. Similarly, the color images generated for the mirrored geometry are also stitched together to form a mirrored texture fingerprint. This ensures that the geometric and visual information correspond precisely in the pixel space of the fingerprint, providing a unified benchmark for subsequent judgments.
[0093] Having obtained two texture fingerprints, a comparison logic similar to that in S106 is executed, but the criteria and objectives for the judgment differ. First, the original texture fingerprint is horizontally flipped in two dimensions to obtain a flipped texture fingerprint. This operation simulates the ideal transformation effect of visual features under a three-dimensional mirror image.
[0094] Next, by comparing pixel data, it is determined whether the flipped texture fingerprint map and the mirrored texture fingerprint map are consistent. At this point, if an inconsistency occurs, it means that although the geometry of the two parts is mirrored, the surface visual features do not satisfy mirror symmetry. A typical example is a left part with a positive letter L, and the geometry of the mirrored part is the right side. However, if its surface visual feature is also a positive letter R instead of a mirrored L, then a mismatch will occur during the flip comparison.
[0095] Based on this inconsistent determination, the initial conclusion of the chiral mirror relationship obtained in S106 is overturned and corrected to an independent asymmetric relationship. Accordingly, in the parts statistics list, the previously created chiral mirror part entries are canceled or modified (for example, the relationship between "wingplate-L" and "wingplate-R" is changed from "chiral pair" to two independent parts), and independent asymmetric part entries are regenerated, and they are managed and counted as two completely different and non-interchangeable independent parts.
[0096] The aforementioned technical steps elevate the determination of part identity from the macroscopic geometric shape level to the visual functional level, which includes surface details. By verifying the texture fingerprint, it is possible to identify geometrically symmetrical parts that are not functionally interchangeable due to asymmetrical patterns or text, thereby improving the final accuracy of the Bill of Materials (BOM) and avoiding errors caused by visual feature mismatches in the procurement and assembly processes.
[0097] Figure 2 This is a flowchart illustrating the method logic of the automatic parts list generation method for mortise and tenon block products based on Blender in this embodiment of the application. It shows the core technical process for automatically identifying and counting chiral mirror parts in mortise and tenon block products in this embodiment.
[0098] The process begins by parsing a 3D model containing a mirror modifier, separating the created original geometry from the mirror geometry. To eliminate interference caused by their different positions and angles in model space, the two geometries are first subjected to independent pose normalization. Specifically, their centers of mass are moved to the origin of the coordinate system, and they are rotated to a uniform, comparable standard pose based on their inherent inertia tensor characteristics.
[0099] After both geometries are in a standard pose, a set of two-dimensional depth maps is generated for each geometries from multiple preset virtual viewpoints. These depth maps capture the shape information of their three-dimensional surfaces. Subsequently, these depth maps are stitched together to form a comprehensive fingerprint, resulting in an original fingerprint that uniquely represents the shape of the original geometries and a mirror fingerprint that represents the shape of the mirrored geometries.
[0100] Finally, we enter the core judgment stage. First, we directly compare the original fingerprint image with the mirrored fingerprint image. If they match, it means they are completely identical symmetrical parts. If they don't match, we further flip the original fingerprint image horizontally in two dimensions and compare it again with the mirrored fingerprint image. If they now match perfectly, it proves that there is a chiral mirror relationship between the original geometry and the mirrored geometry, like a person's left and right hands. Based on this judgment, a chiral mirror entry will be created for this part in the final parts list, thus ensuring the accuracy of parts statistics and avoiding errors in the production preparation stage.
[0101] In the above embodiments, the geometry is first rotated to a uniform, normalized orientation using an inertial tensor, and the problem of 3D shape comparison is transformed into the analysis of a 2D fingerprint image composed of stitched depth maps from multiple perspectives. This fingerprint image macroscopically represents the outline and structural layout of the part, thus avoiding the shortcomings of topological signature methods in related technologies, which dilute or even obscure key chiral features due to the collection of massive amounts of repetitive local geometric information. Finally, by comparing the 2D images through flipping, chiral mirror relationships can be identified, enabling the identification of complex chiral parts containing a large number of repetitive elements and improving the accuracy of parts list statistics.
[0102] In other embodiments of this application, when the projected contour of the 3D model on the plane of symmetry itself also exhibits high symmetry (such as a regular polygonal contour), the calibration direction may not be unique due to the calculation of multiple farthest candidate reference points with equal distances. The method for automatically generating parts lists for mortise and tenon building block products based on Blender provided in this application can filter out a unique final reference point from multiple candidate points by introducing analysis of the surface recess features (mortise structure) of the model and using internal asymmetry features as a higher priority criterion.
[0103] like Figure 3The diagram shown is another flowchart illustrating a method for automatically generating a parts list for mortise and tenon building block products based on Blender, as provided in an embodiment of this application. The method includes the following steps:
[0104] S301. Analyze the 3D model configured with the mirror modifier to obtain the original geometry and the mirror geometry generated by the mirror modifier.
[0105] S302. Calculate the original centroid and mirror centroid of the original geometry and the mirror geometry respectively, and move the original geometry and the mirror geometry so that the original centroid and the mirror centroid are located at the origin of the coordinate system of the 3D model.
[0106] S303. Based on the volume distribution of the original geometry and the mirror geometry, calculate the corresponding inertia tensor respectively, and rotate the original geometry and the mirror geometry to the preset normalized posture according to the eigenvector of the inertia tensor.
[0107] Steps S301-S303 and Figure 1 Steps S101-S103 in the illustrated embodiment are similar and can be found in the descriptions of steps S101-S103, which will not be repeated here.
[0108] S304. If, among the three eigenvalues calculated by the inertial tensor, the difference between two eigenvalues is less than a preset symmetry judgment threshold, the symmetry plane defined by the eigenvectors corresponding to the two eigenvalues is identified, and all three-dimensional vertices of the original geometry and the mirror geometry are vertically projected onto the symmetry plane, thereby obtaining the original two-dimensional projection point set and the mirror two-dimensional projection point set.
[0109] Here, the eigenvalue represents the magnitude of the inertia tensor along the direction of the corresponding eigenvector (principal inertia axis), reflecting the ease with which an object rotates around that axis; the preset symmetry judgment threshold is a very small value used to determine whether two eigenvalues are close enough to be considered equal, and is usually determined through a large number of experiments and engineering experience, because a balance needs to be struck between distinguishing true rotational symmetry and the small differences caused by modeling or calculation errors; the symmetry plane is used to represent a special plane in which the inertia tensor exhibits the same inertia in any direction when the object has rotational symmetry (e.g., cylinder, gear), and this plane is spanned by the eigenvectors corresponding to two eigenvalues with similar inertia values.
[0110] Specifically, after calculating the inertia tensor and eigenvalues / eigenvectors in S303, theoretically, for an ideal rotationally symmetric body (such as a disk rotating about the Z-axis), the moments of inertia about the X and Y axes are exactly equal; that is, the two largest eigenvalues λ1 and λ2 of the inertia tensor will be strictly equal. However, in actual digital models, due to the discretization of the mesh and the precision limitations of floating-point calculations, these two values are often extremely close but not absolutely equal. Therefore, this step uses the condition if|λ1-λ2|< a preset threshold to identify objects with rotational symmetry.
[0111] When this condition is met, it means that the S303 alignment method based on the principal axis of the inertia tensor has rotational ambiguity. That is, although the principal axis of the object is aligned to the coordinate system axis, the object can still rotate arbitrarily around the axis of symmetry with dual eigenvalues (the Z-axis in this case), while the inertia tensor remains unchanged. This will cause the subsequently generated fingerprint to become unreliable due to this random rotation angle.
[0112] To address this issue, a plane of symmetry (in this case, the XY plane) defined by two corresponding eigenvectors (V1 and V2) is identified. Rotational ambiguity is then eliminated by flattening the entire 3D geometry onto this plane. This is achieved by iterating through each 3D vertex P(x, y, z) of the original geometry and projecting it perpendicularly onto the plane of symmetry. Mathematically, if the normal vector of the plane of symmetry is N (i.e., the third eigenvector V3), then the projection point P' of vertex P onto the plane can be obtained through the vector operation P' = P - (P·N)*N. Performing this operation on all vertices transforms the 3D object with rotational ambiguity into a set of 2D points that stably represent its contour.
[0113] In some embodiments, this symmetry determination and two-dimensional projection can be implemented in a variety of ways:
[0114] Optionally, a direct projection based on vector algebra can be used: After obtaining three eigenvalues λ1, λ2, λ3 and their corresponding eigenvectors V1, V2, V3 in S303, |λ1-λ2| is compared with a preset threshold; if it is less than the threshold, V3 is determined as the normal vector N of the symmetry plane; each three-dimensional vertex P of the geometry is traversed, and the projection P' on the plane is calculated as P-dot_product(P, N)*N. Then, the three-dimensional P' is converted into (u, v) coordinates stored in the two-dimensional point set through (dot_product(P', V1), dot_product(P', V2)).
[0115] It is understandable that the above projection process can also be achieved in other ways, such as by using the matrix transformation function in the graphics API to complete it quickly, which is not limited here.
[0116] S305. Calculate and determine the unique original reference point and mirror reference point that are farthest from the origin of the coordinate system in the original two-dimensional projection point set and the mirror two-dimensional projection point set, respectively.
[0117] The original / mirror 2D projection point set refers to the set of 2D coordinates generated by S304 that represents the outline of the geometry on the plane of symmetry; the unique original / mirror reference point is the point in the 2D point set that has the largest Euclidean distance from the origin (0,0). This point has the potential to serve as a stable feature point due to its extreme position, which can be used to locate a specific orientation on the rotationally symmetric outline.
[0118] Specifically, once a set of two-dimensional points representing the object's outline is obtained, a definite and reproducibly identifiable anchor point is found on this continuously rotationally symmetric outline. For rotationally symmetric objects (such as the projection of a gear), the orientation around the axis of symmetry remains arbitrary after alignment with the principal axes. To eliminate this arbitrariness, a unique feature must be found on the object's outline. This step selects the point farthest from the origin as this feature.
[0119] This choice is based on a general geometric assumption: for most nontrivial engineering parts, the point on the profile furthest from the center of rotation (e.g., the tooth tip of a gear, the highest point of a cam, the edge of a keyway shaft) is usually unique, or even if not unique, its number is finite and follows a specific distribution pattern. This point, due to its outermost position, becomes a significant and stable geometric feature.
[0120] Initialize a maximum distance record value (usually set to 0) and a reference point coordinate variable for the original 2D projected point set. Then, iterate through each point (x, y) in the point set and calculate the square of the distance from that point to the origin (to avoid square root operations, the squares of the distances are usually compared), i.e., d. 2 =x 2 +y 2 If the currently calculated d 2 If the distance is greater than the recorded maximum distance, update the maximum distance record and save the coordinates of the current point (x, y) as the new reference point. After traversing all points, the final stored point is the original reference point. The same process is independently applied to the mirrored 2D projection point set to find the mirrored reference point. It should be noted that for highly idealized symmetrical figures (such as squares), there may be multiple farthest points. In this case, additional preset rules (e.g., selecting the point with the smallest angle) are needed to ensure uniqueness.
[0121] It is understandable that other methods can be used to find feature points, such as finding curvature extrema, etc., which are not limited here.
[0122] In some embodiments, when multiple candidate reference points are identified solely by the farthest point principle in S305, making it impossible to determine a unique reference orientation, an analysis and screening mechanism based on three-dimensional surface concavity features (i.e., mortise structure) can be further introduced to select a unique reference point from multiple candidates, thereby ensuring stable and reliable attitude calibration for parts with highly symmetrical profiles.
[0123] First, the surface of the 3D model is decomposed into multiple discrete surface basic units. In a typical triangular mesh model, this usually refers to each triangular facet. Then, all surface basic units are traversed. For each unit (e.g., a triangular facet), the following calculations are performed to determine its convexity / concavity:
[0124] Determine the geometric center of the unit: Calculate the arithmetic mean of the three-dimensional coordinates of all vertices constituting the unit to obtain the geometric center point C of the unit.
[0125] Construct the centroid surface vector: Calculate the vector from the origin (centroid) O of the entire model's coordinate system to the geometric center C of the element, i.e., the centroid surface vector V_oc = CO. This vector roughly represents the position and direction of the surface element relative to the center of the object.
[0126] Concavity determination: Calculate the dot product of V_oc and the surface normal vector N of the basic surface unit. The direction of the surface normal vector N is perpendicular to the unit surface and points outward from the model. Theoretically, for points on convex surfaces, the position vector and normal vector have roughly the same direction, and the dot product is positive; however, for points in concave regions, their normal vector points inward from the model and is opposite to the position vector, resulting in a negative dot product. Therefore, when the calculated dot product value is less than a preset concavity determination threshold (this threshold is set through experimental data to filter out noise and nearly flat surfaces), the basic surface unit is marked as a concave unit.
[0127] After identifying all individual concave units, a connected component analysis algorithm is applied to group all concave units that are adjacent to each other in the topology through shared edges or shared vertices into a single unit. Each such set of connected concave units is defined as an independent mortise structure, such as a hole, a slot, or a pit.
[0128] After identifying multiple possible mortise structures on the model, feature points representing the location of each mortise structure are calculated. First, all boundary vertices adjacent to the non-recessed units of each mortise structure are identified; these vertices collectively constitute the opening profile of the mortise structure. Then, the geometric center of the mortise structure is determined by calculating the arithmetic mean of the three-dimensional coordinates of all vertices on the opening profile.
[0129] Next, based on pre-defined geometric rules, a unique reference mortise is determined from all identified mortise structures. These pre-defined rules are engineering strategies developed to ensure the determinism and consistency of the selection process, typically based on experience or analysis of typical part features. For example, the rules could be: selecting the mortise with the largest surface area, selecting the mortise with the longest opening profile perimeter, or selecting the mortise whose geometric center is closest to the model's centroid. The original geometry and the mirrored geometry will use the exact same rules to determine the original reference mortise and the mirrored reference mortise, respectively.
[0130] Finally, the problem of non-unique reference points in S305 is addressed using a datum mortise structure. Assuming S305 finds an original set of candidate reference points (i.e., multiple points farthest from the origin) in the original 2D projection point set, the geometric center of the original datum mortise structure (a 3D point) is projected perpendicularly onto the symmetry plane defined in S304, resulting in a 2D projection point. Then, the 2D Euclidean distance between this projection point and each candidate point in the original candidate reference point set is calculated. The candidate reference point with the closest distance is ultimately determined as the unique original reference point. The same process is applied to mirror geometry to determine the unique mirror reference point.
[0131] The above technical steps, by introducing internal recessed features as higher-priority geometric anchor points, avoid the reference point ambiguity problem caused by relying solely on the symmetry of the external contour (farthest point). While the external contour of a part may be highly symmetrical due to design (e.g., a square flange), functional internal features (e.g., asymmetrically distributed screw holes) are often unique. Utilizing this unique internal structure as the final decision-making basis provides decisive asymmetric information for attitude calibration, thereby ensuring the absolute uniqueness and robustness of the final attitude.
[0132] S306. Calculate the calibration vectors pointing from the origin of the coordinate system to the original reference point and the mirror reference point respectively, and perform axisymmetric rotation on the original geometry and the mirror geometry respectively, so that the calibration vectors are aligned with the preset reference coordinate axes in the symmetry plane.
[0133] Among them, the calibration vector refers to a two-dimensional vector that starts from the origin of the coordinate system and ends at the reference point determined in S305, providing a direction pointer for the object in the plane of symmetry; axisymmetric rotation refers to the rotation operation performed on the entire three-dimensional geometry around the axis of symmetry (i.e., the axis perpendicular to the plane of symmetry); the preset reference coordinate axis refers to a standard coordinate axis that is artificially specified in the plane of symmetry, such as the axis defined by the first eigenvector V1. It is an engineering convention or common knowledge established to eliminate rotational ambiguity, and its function is to provide a final and unified alignment target direction for all rotationally symmetric objects.
[0134] Specifically, after S305 determines a unique reference point, the geometry is adjusted to a defined and normalized final posture by rotation using a direction pointer (calibration vector).
[0135] First, calculate the calibration vector. For the original geometry, if the reference point coordinates are (rx, ry), then the calibration vector is Vec_cal = (rx, ry). Next, calculate the angle θ between this calibration vector and a preset reference coordinate axis, such as the X-axis in a plane, with its direction vector being (1, 0). This angle can be precisely calculated using the arctangent function atan2(ry, rx). This angle θ represents the rotational deviation between the object's current pose and the target standard pose.
[0136] Next, perform a rotation on the entire original 3D geometry (not the set of 2D points). The axis of rotation is the previously determined axis of symmetry (i.e., the eigenvector V3). The angle of rotation is the negative of the deviation angle, -θ. Construct a 3D rotation matrix (or quaternion) around the V3 axis by -θ, and then apply this transformation to every 3D vertex of the original geometry. After this rotation, the projection of the farthest feature point on the original geometry onto the plane of symmetry will fall on the preset reference coordinate axis. At this point, rotational ambiguity is eliminated, and the object achieves a unique, repeatable normalized pose. The same operation will also be applied to the mirror geometry.
[0137] In some embodiments, this final axisymmetric rotation calibration can be achieved in several ways:
[0138] Optionally, rotation based on the axis-angle formula can be used: based on the reference point (rx, ry) obtained in S305, calculate the angle θ = atan2(ry, rx) between the calibration vector and the preset reference axis (such as the X-axis); determine the rotation axis as the axis of symmetry, i.e., the eigenvector V3; use the Rodrigues rotation formula or directly construct the axis-angle rotation matrix R(V3, -θ), and apply this matrix to each vertex of the three-dimensional geometry P_new = R*P_old.
[0139] It is understandable that other methods can be used to implement this attitude calibration process, such as directly calling the built-in rotation function in a specific graphics API, which is not limited here.
[0140] S307. Centered on the origin of the coordinate system, set multiple original projection viewpoints and mirror projection viewpoints in preset directions on the virtual spheres of the original geometry and the mirror geometry, and generate an original two-dimensional depth map and a mirror two-dimensional depth map at each original projection viewpoint and mirror projection viewpoint.
[0141] S308. Multiple two-dimensional depth maps and mirrored two-dimensional depth maps are spliced together according to a preset spatial layout to form the original fingerprint map and the mirrored fingerprint map.
[0142] S309. When pixel data comparison reveals inconsistencies between the original fingerprint image and the mirrored fingerprint image, and the flipped fingerprint image differs from the mirrored fingerprint image... Figure 1 When the time comes, the mirrored geometry is identified as a chiral mirrored part, and a chiral mirrored part entry is created in the part statistics list.
[0143] Steps S307-S309 and Figure 1 Steps S104-S106 in the illustrated embodiment are similar and can be found in the descriptions of steps S104-S106, which will not be repeated here.
[0144] In the above embodiments, by judging the difference between two eigenvalues of the inertia tensor, symmetrical geometries with rotational ambiguity in traditional inertial principal axis alignment methods can be identified. For this specific case, the three-dimensional attitude uncertainty problem is reduced to a two-dimensional plane, and a unique geometric anchor point is introduced by finding the reference point farthest from the origin on the contour. Finally, this anchor point is aligned to a preset reference axis by performing axisymmetric rotation, transforming the attitude alignment problem, which originally had infinitely many solutions, into a geometric positioning process with a deterministic solution. This achieves highly robust attitude normalization for arbitrary rotationally symmetric parts, improving the accuracy of subsequent analysis.
[0145] The following describes an exemplary automatic parts list generation system 400 provided in an embodiment of this application. Figure 4 This is an exemplary hardware structure diagram of the automatic parts list generation system 400 provided in this application embodiment.
[0146] In some embodiments, the automatic parts list generation system 400 is a computer device or includes a computer device. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores data. The network interface of the computer device is used to communicate with other external terminals or servers via a network connection. In some embodiments, the network interface can be a wired network interface; in some embodiments, the network interface can also be a wireless network interface. When the computer program is executed by the processor, it implements the methods in the embodiments of this application.
[0147] Those skilled in the art will understand that Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0148] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0149] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0150] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0151] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for automatically generating a parts list for mortise and tenon building block products based on Blender, characterized in that, include: The 3D model configured with the mirror modifier is analyzed to obtain the original geometry and the mirrored geometry generated by the mirror modifier. Calculate the original centroid and the mirror centroid of the original geometry and the mirror geometry respectively, and move the original geometry and the mirror geometry so that the original centroid and the mirror centroid are located at the origin of the coordinate system of the three-dimensional model; Based on the volume distribution of the original geometry and the mirror geometry, the corresponding inertia tensors are calculated respectively, and the original geometry and the mirror geometry are rotated to a preset normalized posture according to the feature vector of the inertia tensor. Centered on the origin of the coordinate system, multiple original projection viewpoints and mirror projection viewpoints with preset directions are set on the virtual spheres of the original geometry and the mirror geometry, respectively, and an original two-dimensional depth map and a mirror two-dimensional depth map are generated at each of the original projection viewpoints and the mirror projection viewpoints. The following steps are performed on the original two-dimensional depth map and the mirrored two-dimensional depth map respectively: Locate the 3D surface point corresponding to each pixel in the 2D depth map on the 3D model surface; Centered on the three-dimensional surface point, a neighborhood of a preset size is determined on the surface of the three-dimensional model; The three-dimensional surface normal vectors of multiple sampling points within the neighborhood are collected to form a set of normal vectors; Principal component analysis is performed on the set of normal vectors to determine the three principal directions of the normal vector distribution, and the first eigenvalue, second eigenvalue, and third eigenvalue corresponding to the three principal directions are calculated respectively. The first feature value is the largest, and the third feature value is the smallest; The geometric complexity is obtained by calculating the ratio between the third eigenvalue and the sum of the first eigenvalue, the second eigenvalue, and the third eigenvalue. The value of the geometric complexity is written as a pixel value to the corresponding pixel position of the new two-dimensional map, and after traversing all pixels of the two-dimensional depth map, the original local geometric complexity map and the mirrored local geometric complexity map are generated simultaneously. The high-complexity regions in the original local geometric complexity map and the mirrored local geometric complexity map are assigned low weight values, and the low-complexity regions are assigned high weight values, thereby generating the original saliency weighted mask and the mirrored saliency weighted mask respectively. Multiple original two-dimensional depth maps and multiple original saliency-weighted masks, as well as multiple mirrored two-dimensional depth maps and multiple mirrored saliency-weighted masks, are spliced and pixel-level weighted according to a preset spatial layout to generate original fingerprint maps and mirrored fingerprint maps respectively. When the original fingerprint image is inconsistent with the mirrored fingerprint image and the flipped fingerprint image is consistent with the mirrored fingerprint image through pixel data comparison, the mirrored geometry is determined to be a chiral mirrored part, and a chiral mirrored part entry is created in the part statistics list; the flipped fingerprint image is obtained by performing a two-dimensional horizontal flip on the original fingerprint image.
2. The method according to claim 1, characterized in that, After rotating the original geometry and the mirror geometry to a preset normalized pose based on the eigenvectors of the inertia tensor, the method further includes: If, among the three eigenvalues calculated from the inertial tensor, the difference between two eigenvalues is less than a preset symmetry judgment threshold, the symmetry plane defined by the eigenvectors corresponding to the two eigenvalues is identified, and all three-dimensional vertices of the original geometry and the mirror geometry are vertically projected onto the symmetry plane, thereby obtaining the original two-dimensional projection point set and the mirror two-dimensional projection point set. Calculate and determine the unique original reference point and mirror reference point that are farthest from the origin of the coordinate system in the original two-dimensional projection point set and the mirror two-dimensional projection point set, respectively. Calculate calibration vectors pointing from the origin of the coordinate system to the original reference point and the mirror reference point respectively, and perform axisymmetric rotations on the original geometry and the mirror geometry respectively, so that the calibration vectors are aligned with the preset reference coordinate axes in the symmetry plane.
3. The method according to claim 2, characterized in that, After calculating and determining the unique original reference point and mirror reference point farthest from the origin of the coordinate system, the method further includes: When calculating multiple original reference points that are farthest from the origin, the calculated points are used to form a set of original candidate reference points. In the three-dimensional models of the original geometry and the mirror geometry, all the recessed mortise structures are identified and located respectively. According to the preset geometric rules, the original reference mortise structure and the mirror reference mortise structure are determined from all the mortise structures respectively; In the original set of candidate reference points, the candidate reference point whose projection distance on the plane of symmetry is closest to the geometric center of the original reference structure is selected and determined as the unique original reference point.
4. The method according to claim 3, characterized in that, In the three-dimensional models of the original geometry and the mirrored geometry, all recessed mortise structures are identified and located, specifically including: The surface of the three-dimensional model is decomposed into multiple discrete surface basic units; Traverse all the surface basic units and calculate the vertex arithmetic mean of the three-dimensional coordinates of all vertices for each surface basic unit to determine the geometric center of the unit and calculate the centroid surface vector from the origin of the coordinate system to the geometric center of the unit. Calculate the dot product between the centroid surface vector and the surface normal vector of the surface basic unit. When the dot product is less than a preset concavity determination threshold, mark the corresponding surface basic unit as a concave unit. In all the aforementioned concave units, the connected component analysis algorithm is applied to group all concave units that are adjacent to each other in the topology through shared edges or shared vertices into a tangent structure. Identify all boundary vertices adjacent to the mortise structure and non-recessed units, and form an opening profile; Calculate the arithmetic mean of the three-dimensional coordinates of all vertices on the opening profile to determine the geometric center of the corresponding mortise structure.
5. The method according to claim 1, characterized in that, After determining that the mirrored geometry is a chiral mirrored part and creating a chiral mirrored part entry in the part statistics list when the original fingerprint image is inconsistent with the mirrored fingerprint image through pixel data comparison, the process further includes: If surface visual features are identified on the original geometry and the mirror geometry, an additional original texture fingerprint and mirror texture fingerprint are generated to characterize the surface visual features, using the same preset projection viewpoint and spatial layout as when the original fingerprint and the mirror fingerprint were generated; the surface visual features are texture maps or vertex color data applied to the surface of the three-dimensional model. Perform a two-dimensional horizontal flip on the original texture fingerprint to obtain a flipped texture fingerprint; When the flipped texture fingerprint is inconsistent with the mirrored texture fingerprint by comparing pixel data, the chiral mirror relationship is corrected to an independent asymmetric relationship. An independent asymmetric part entry is generated in the part statistics list to replace the chiral mirror part entry.
6. A system for automatically generating parts lists, characterized in that, The automatic parts list generation system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the automatic parts list generation system to perform the method as described in any one of claims 1-5.
7. A computer program product containing instructions, characterized in that, When the computer program product is run on the automatic parts list generation system, the automatic parts list generation system performs the method as described in any one of claims 1-5.
8. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are run on the automatic parts list generation system, the automatic parts list generation system performs the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Assembly mirror image method based on centroid main inertial coordinate system, terminal and storage medium
CN114529704A
Household photovoltaic BOM generation method and system
CN120876210A