A modeling method for the CAD surface geometric model based on image recognition
By generating an accurate point cloud model based on image recognition technology and performing triangular facet reconstruction, the problems of surface intersection and tiny gaps in the CAD model are solved, and the geometric cleaning efficiency and robustness are improved.
Patent Information
- Application Number
- CN202411309882.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-09-19
AI Technical Summary
In the prior art, due to the problems of surface intersection and tiny discontinuous gaps between the original CAD model components, the geometric cleaning process is more difficult and it is difficult to directly generate a mesh.
The original CAD model is extracted based on image recognition technology to generate an accurate point cloud model, and the correlation judgment and reconstruction of point clouds and triangular surfaces are solved to solve the problems of surface intersection and tiny discontinuous gaps, and a CAD geometric model with no surface intersection and clean surfaces is generated.
The position and intersection of the triangular face sheets are quickly determined through multi-view information, which improves the efficiency of model geometric cleaning, reduces the intersect judgment time, and has high robustness to adapt to complex surfaces.
Smart Images

Figure CN119167461B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of CAD modeling technology, and particularly to a method for modeling a CAD surface geometric model based on image recognition. Background Art
[0002] CAE refers to computer-aided engineering in engineering design, which can solve and analyze the structural mechanical properties of complex engineering and products through computer-aided means, as well as optimize the structural performance, etc., and organically organize each link of the project (production). The key is to integrate relevant information so that it is generated and exists throughout the life cycle of the project (product).
[0003] In the process of CAE analysis, mesh generation plays a crucial role in the calculations in the field of CAE. In many cases, meshes cannot be directly generated from the CAD model. Often, manual intervention in geometric cleaning is required first to transform the CAD model into a geometric model that can be used by calculation methods and tool software before the subsequent mesh generation workflow can be carried out. However, in the existing geometric cleaning process, due to problems such as surface intersections and tiny discontinuous gaps between the original CAD model components, the geometric cleaning process is relatively difficult. Summary of the Invention
[0004] One of the purposes of this application is to provide a method for modeling a CAD surface geometric model based on image recognition that can solve at least one of the defects in the above background art.
[0005] To achieve at least one of the above purposes, the technical solution adopted in this application is: A method for modeling a CAD surface geometric model based on image recognition, including the following steps:
[0006] S100: Extract features from the original CAD model based on image recognition technology to obtain the original point cloud model;
[0007] S200: Project the obtained original point cloud model onto the original CAD model to obtain an accurate point cloud model of the outer surface of the original CAD model;
[0008] S300: Associate the point cloud corresponding to the accurate point cloud model with the triangular facets of the original CAD model to determine the positions of the intersecting triangular facets and perform reconstruction, thereby obtaining a CAD geometric model without surface intersections and with a clean surface.
[0009] Preferably, step S100 includes the following process:
[0010] S110: Input the original CAD model and obtain its multi-directional view information;
[0011] S120: Use the view information of the original CAD model as the input of the coarsening model to obtain a rough point cloud model;
[0012] S130: Aggregate the view information of the original CAD model and combine it with the rough point cloud model as the input of the refinement model, and perform feature extraction through the global guidance mechanism to obtain the original point cloud model.
[0013] Preferably, step S110 includes the following specific processes:
[0014] S111: Based on the original CAD model, construct an enclosing sphere;
[0015] S112: Arrange a plurality of evenly distributed cameras on the enclosing sphere;
[0016] S113: Take pictures of the original CAD model through the arranged cameras to obtain multi-view information of the original CAD model.
[0017] Preferably, step S200 includes the following processes:
[0018] S210: Based on the STL data information of the original CAD model, construct the bounding box of each triangular patch and quickly determine the point cloud data belonging to the triangular patch;
[0019] S220: Project the point cloud data obtained in step S210 onto the original CAD model according to the determination result;
[0020] S230: According to the projection points falling on the outer surface of the original CAD model, obtain the accurate point cloud model of the outer surface of the original CAD model.
[0021] Preferably, step S210 includes the following specific processes:
[0022] S211: Construct the minimum bounding box according to the vertex coordinates of each triangular patch in the original CAD model;
[0023] S212: Increase the diagonal length of the minimum bounding box by a set ratio to obtain the actual bounding box;
[0024] S213 Compare the coordinate information of the two points determining the actual bounding box with the coordinate information of each point cloud in the original point cloud model, so as to identify all the point clouds that may be included in the triangular patch;
[0025] S214: Based on the vertical distance between the point cloud identified in step S213 and the triangular patch, determine the triangular patch to which each point of the identified point cloud belongs.
[0026] Preferably, in step S300, the specific process of associating the point cloud with the triangular patch of the original CAD model is as follows:
[0027] S310: Set the average distance between all adjacent mapped points on the triangular patch for determination as the threshold value;
[0028] S320: Find a first mapped point closest to each vertex of the triangular patch for determination, and calculate the distances from the three first mapped points to the corresponding vertices to obtain three vertex distances;
[0029] S330: If the obtained vertex distances are all less than the set threshold value, determine that the corresponding triangular patch is to be completely retained; if some or all of the obtained vertex distances are greater than the set threshold value, determine that the corresponding triangular patch is to be partially retained; if there are no mapped points on the triangular patch, discard the corresponding triangular patch.
[0030] Preferably, in step S300, no operation is required for the completely retained triangular patches, and the discarded triangular patches are deleted subsequently; for the partially retained triangular patches, reconstruction is performed. The specific reconstruction process is as follows:
[0031] S340: Determine the dividing line of the triangular patch based on the first mapped points corresponding to the respective vertices of the triangular patch;
[0032] S350: Connect the triangular patches in sequence according to the obtained dividing line to obtain a complete dividing line, re - distribute points on the complete dividing line and adjust the mesh structure to generate new triangular patches.
[0033] Preferably, if only one of the calculated vertex distances is greater than the set threshold value, step S340 includes the following specific process:
[0034] S341: Obtain the second mapped points on the outermost circle of the triangular patch based on the convex hull algorithm, and connect the obtained second mapped points in sequence to form a closed boundary;
[0035] S342: According to the first mapped point V corresponding to the vertex distance greater than the set threshold value, construct a first vector from the first mapped point V to the corresponding vertex of the triangular patch, and a second vector from the first mapped point V to other second mapped points on the closed boundary;
[0036] S343: Find all the second mapped points corresponding to the second vectors whose included angles with the first vector are less than 100°;
[0037] S344: Determine whether the connection line between the second mapped point found in step S343 and the nearest vertex intersects the closed boundary; if not, form a dividing line with the second mapped point found in step S343 and the first mapped point V; if it intersects and there are no other second mapped points meeting the conditions of step S343, form a dividing line with the first mapped point V alone.
[0038] Preferably, if at least two values among the calculated vertex distances are greater than the set threshold, step S340 includes the following specific process:
[0039] S341: Obtain the second mapped points on the outermost circle of the triangular facets based on the convex hull algorithm, and sequentially connect the obtained second mapped points to form a closed boundary;
[0040] S345: If two vertex distances are greater than the set threshold, locate the closed boundary region between the first mapped points corresponding to these two vertex distances respectively, and form a dividing line according to all the second mapped points within the located closed boundary region;
[0041] S346: If all three vertex distances are greater than the set threshold, use the closed boundary as the dividing line.
[0042] Preferably, step S350 includes the following specific process:
[0043] S351: Sequentially connect the dividing lines of each intersecting triangular facet according to the adjacency relationship of the triangular facets to obtain the required complete dividing line;
[0044] S352: On the obtained complete dividing line, evenly distribute points according to at most 1 / 3 of the average side length of all triangular facets as the density;
[0045] S353: According to the distributed points, locally adjust the grid structure of the intersecting region of the triangular facets in step S351 to generate new triangular facets, and delete the originally partially retained triangular facets and the discarded triangular facets.
[0046] Compared with the prior art, the beneficial effects of this application are as follows:
[0047] (1) The accurate point cloud model obtained based on the multi-view information of the original CAD model can quickly determine which triangular facets are located on the outer surface of the model and quickly judge the intersection situation of each triangular facet, thereby effectively reducing the time required for intersection judgment of triangular facets to improve the efficiency of model geometry cleaning.
[0048] (2) By reasonably setting the point cloud density, it can handle geometric models with complex surfaces and has high robustness. Description of the Drawings
[0049] Figure 1 is a schematic diagram of the overall work flow of this application.
[0050] Figure 2 is a schematic diagram of the structure of the original CAD model of one example of this application.
[0051] Figure 3 is for this application Figure 2The original point cloud model corresponding to the original CAD model shown.
[0052] Figure 4 This application Figure 2 The precise point cloud model corresponding to the original CAD model shown.
[0053] Figure 5 This application is based on Figure 2 The structural schematic diagram of the CAD geometric model without surface intersection and with a clean surface output based on the original CAD model. Detailed implementation manners
[0054] Next, in combination with the detailed implementation manners, a further description of this application will be given. It should be noted that, on the premise of no conflict, any combination can be formed between the following-described embodiments or technical features to form new embodiments.
[0055] In the description of this application, it should be noted that for orientation terms, such as the terms "center", "transverse", "longitudinal", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc., the indicated orientation and positional relationships are based on the orientation or positional relationships shown in the drawings. It is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and should not be construed as limiting the specific protection scope of this application.
[0056] It should be noted that the terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.
[0057] The terms "include" and "have" in the description and claims of this application and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.
[0058] One of the preferred embodiments of this application, as Figure 1 shown, a modeling method for a CAD surface geometric model based on image recognition includes the following steps:
[0059] S100: Extract features from the original CAD model based on image recognition technology to obtain the original point cloud model.
[0060] S200: Project the obtained original point cloud model onto the original CAD model to obtain an accurate point cloud model of the outer surface of the original CAD model.
[0061] S300: Associate the point cloud corresponding to the accurate point cloud model with the triangular facets of the original CAD model to determine the positions of the intersecting triangular facets and perform reconstruction, thereby obtaining a CAD geometric model without surface intersections and with a clean surface.
[0062] It should be known that in the field of geometry, a triangular facet is a two-dimensional geometric figure composed of three vertices and three edges; in 3D software, by using triangular facets to describe the surface of a 3D model, and by combining a large number of adjacent triangular facets, the surface shape of a complex 3D model can be obtained.
[0063] For 3D models with uniform or simple structures, the connection of adjacent triangular facets is continuous and smooth. For 3D models with complex structures, taking Figure 2 a shown original CAD model as an example, this original 3D model includes a spherical part and a rectangular block part; for the individual spherical part and rectangular block part, they can be regarded as uniform structures, so the connection of adjacent triangular facets corresponding to the individual spherical part and rectangular block part is smooth and uniform; however, when the spherical part and the rectangular block part are combined together, the structural positions of the two will show structural discontinuity, and then the triangular facets at this position will cross each other, that is, it will cause problems such as surface intersections and tiny discontinuous gaps in the original CAD model.
[0064] Based on the outer contour of the current original CAD model, a corresponding original point cloud model can be generated; taking Figure 2 the shown original CAD model as an example, the obtained original point cloud model is as Figure 3 shown. Then project the obtained point cloud model again, that is, map it into the original CAD model, and an accurate point cloud model evenly covering the outer surface of the original CAD model can be obtained; taking Figure 2 the shown original CAD model as an example, the obtained accurate point cloud model is as Figure 4 shown. Finally, classify the triangular facet structure of the original CAD model according to the mapping result of the point cloud corresponding to the obtained accurate point cloud model and the triangular facets of the original CAD model, and the positions of the intersecting triangular facets that cause problems such as surface intersections and tiny discontinuous gaps can be obtained. Then, according to the accurate point cloud model, reconstruct the structure of the intersecting triangular facets. New triangular facets with continuous structures can be regenerated at the positions of surface intersections and discontinuous seams according to the generated point cloud, and a new CAD model with a uniform triangular facet structure at the complex connection positions can be obtained, that is, a CAD geometric model without surface intersections and with a clean surface; taking Figure 2 the shown original CAD model as an example, the obtained new CAD model is asFigure 5 As shown
[0065] Compared with the traditional method, the accurate point cloud model obtained based on the multi-view information of the original CAD model in this application can quickly determine which triangular patches are located on the outer surface of the model and quickly judge the intersection situation of each triangular patch, so as to effectively reduce the time required for the intersection judgment of triangular patches and improve the efficiency of model geometry cleaning.
[0066] It should be noted that the point cloud density of the point cloud models respectively generated in steps S100 and S200 can be selected according to the actual needs of those skilled in the art to meet the set accuracy.
[0067] In this embodiment, when performing step S100, there are multiple ways to obtain the original point cloud model corresponding to the original CAD model. For the convenience of understanding, the following will take the multi-view acquisition method as an example for detailed description. The specific process is as follows:
[0068] S110: Input the original CAD model and obtain its view information in multiple directions.
[0069] S120: Use the view information of the original CAD model as the input of the coarsening model to obtain a rough point cloud model.
[0070] S130: Aggregate the view information of the original CAD model and combine it with the rough point cloud model as the input of the refinement model, and perform feature extraction through the global guidance mechanism to obtain the original point cloud model.
[0071] It can be understood that by obtaining the view information of the original CAD model in multiple directions, it is possible to generate point clouds for all positions of the original CAD model to ensure the accuracy of the point cloud model. After obtaining the view information of the original CAD model in multiple directions, the image information on each view can be converted into the corresponding point cloud through image recognition technology, and then the point clouds corresponding to multiple views are globally guided to eliminate the error points and duplicate points among them, and the required original point cloud model can be obtained. For the convenience of understanding, the following will describe in detail the specific generation process of multi-direction view acquisition and point cloud model.
[0072] Specifically, there are various ways to obtain the multi-directional view information of the original CAD model in step S110. For example, the original CAD model can be transformed in multiple spatial angles manually or algorithmically to obtain the corresponding view information, or the camera array method can be used. To ensure the accuracy of obtaining each view information and reduce the difference between each view information, the camera array method is preferably used in this embodiment. The specific process of obtaining the multi-directional view information of the original CAD model by the camera array is as follows:
[0073] S111: Based on the original CAD model, a bounding sphere is constructed.
[0074] S112: A plurality of evenly distributed cameras are arranged on the bounding sphere.
[0075] S113: The original CAD model is photographed by the arranged cameras to obtain the multi-view information of the original CAD model.
[0076] It should be noted that the bounding sphere in step S111 can be regarded as a lattice structure formed by connecting multiple points in space around the original CAD model. This lattice structure wraps the original CAD model in a spherical manner in space, and the center of the bounding sphere corresponds to the circumcenter of the original CAD model. According to the obtained bounding sphere, multiple arrangement points evenly distributed on the bounding sphere can be generated, and cameras are set at each arrangement point. The shooting angles of the cameras all face the center position of the bounding sphere, and then the view information of the original CAD model in multiple directions can be obtained, and the shooting angles of each view information are the same, so as to ensure good compatibility between the subsequent generated 3D point cloud model and the surface of the original CAD model.
[0077] It can be understood that there are various ways to generate the arrangement points for arranging cameras on the bounding sphere. A relatively common way is to generate multiple points with uniform force on the bounding sphere through the method of mechanical principles as the arrangement points. The force received by each arrangement point can be expressed by the following expression:
[0078]
[0079] where F m represents the resultant force received by the m-th arrangement point, r m represents the position of the m-th arrangement point on the bounding sphere, r n represents the position of the adjacent n-th arrangement point on the bounding sphere, represents the vector between the adjacent m-th and n-th arrangement points, represents the distance between the adjacent m-th and n-th arrangement points.
[0080] It should be noted that for the number of layout points, that is, the number of cameras to be arranged, it can be selected according to the actual needs of those skilled in the art, and the specific camera layout can be carried out in 3D software by oneself; for example, 64 cameras can be evenly arranged on the enclosing sphere.
[0081] It should be known that steps S120 and S130 are two specific steps of the point cloud generation method based on image recognition technology. There are various specific methods for generating point clouds through image recognition technology. For the convenience of understanding, steps S120 and S130 will be described in detail below through one of the specific methods.
[0082] Specifically, for step S120, first, the multi-directional view information corresponding to the original CAD model can be input into the CGM module. The feature information of a single view can be combined with the information of other views through the cross-view interaction unit to generate the spatial features corresponding to each view. Then, the obtained spatial features are input into the point predictor to generate the rough point cloud model for each view. Among them, the generation method of the spatial features for each view can adopt the calculation method of the convolutional layer, and the specific calculation formula is as follows:
[0083] f i =Conv([Conv(x i ),…,Conv(x i-1 ),x i ,Conv(x i+1 ),…,Conv(x V )]).
[0084] Among them, f i represents the spatial features corresponding to any view, x i represents the input of the i-th feature interaction branch in the cross-view interaction unit, and V represents the number of input views.
[0085] For step S130, first, the multi-view information of the original CAD model is aggregated. Then, the aggregated information and the rough point cloud model generated by CGM are used as the input of the FGM module. Each input rough point cloud model will extract features through a series of shared multi-layer perceptrons. At the same time, the multi-view aggregated information will be processed by a global feature extractor composed of a series of convolutional layers and downsampling layers to learn multi-level global guiding features, and the global guiding features at each level will be combined with the corresponding point cloud features to guide the point cloud feature extraction; finally, the point cloud models of multiple views are combined to generate an original point cloud model that can accurately represent the surface geometric features of the original CAD model.
[0086] It can be understood that the precise point cloud model generated based on the above method can accurately reflect the geometric features of the original CAD module, and can handle the problem of non-matching and non-robust feature points in the unit point cloud model caused by the appearance differences and occlusions between views. That is, in this embodiment, by reasonably setting the point cloud density, geometric models with complex surfaces can be dealt with, and it has high robustness.
[0087] In this embodiment, when generating the above precise point cloud model, only the geometric features of the outer surface of the original CAD model are retained, and the internal geometric features of the original CAD model do not need to be concerned about. Therefore, in step S200, the original CAD model can be cleaned through the original point cloud model corresponding to the surface structure of the original CAD model to obtain a precise point cloud model and provide a basis for the subsequent judgment of triangular patches. Then in step S200, the process of cleaning the surface of the original CAD model based on the original point cloud model is as follows:
[0088] S210: Based on the STL data information of the original CAD model, construct the bounding box of each triangular patch and quickly determine the point cloud data belonging to the triangular patch.
[0089] S220: Project the point cloud data obtained in step S210 onto the original CAD model according to the judgment result.
[0090] S230: According to the projection points falling on the outer surface of the original CAD model, obtain the precise point cloud model of the outer surface of the original CAD model.
[0091] It should be known that STL is the guaranteed format of model files in 3D software and is also a file format representing triangular meshes. That is, through the STL data information of the original CAD model, the triangular mesh model of the original CAD model can be obtained, and then the bounding box of each corresponding triangular patch can be constructed according to the triangular mesh model. In step S220, there are various projection methods for point cloud data. To ensure the accuracy of the subsequent point cloud model, orthogonal projection is preferably used in this embodiment, so that the projection points of the point cloud data all fall on the outer surface of the original CAD model; since the point cloud data is generated based on the outer surface data of the original CAD model, the projection area of the projection points is the outer surface area of the model. By establishing the association between the point cloud and the triangular patch subsequently, accurate model outer surface data, that is, a precise point cloud model, can be obtained.
[0092] Specifically, in step S210, since the triangular mesh model generally adopts a "point-edge-face-shell" structure, the bounding box surrounding each triangular patch can be constructed based on the vertex information of each triangular patch in the triangular mesh model. The specific construction process of the bounding box and the specific recognition process of the triangular patch point cloud are as follows:
[0093] S211: Construct a minimum bounding box based on the vertex coordinates of each triangular patch in the original CAD model.
[0094] S212: Increase the minimum bounding box by a set proportion along the diagonal length to obtain the actual bounding box.
[0095] S213: Compare the coordinate information of the two points determining the actual bounding box with the coordinate information of each point cloud in the original point cloud model, so as to identify all the point clouds that may be included in the triangular patch.
[0096] S214: Based on the vertical distance between the point cloud identified in step S213 and the triangular patch, determine the triangular patch to which each point of the identified point cloud belongs.
[0097] It should be known that since the bounding box can be determined by two points, through the coordinate information of these two points and the coordinate information of each point in the original point cloud model, it is possible to quickly determine the point clouds that may be included in the triangular patch; and then make a further determination based on the vertical distance between the point cloud and the triangular patch to determine the triangular patch to which each point in the point cloud belongs. In order to be able to determine all the point cloud information belonging to each triangular patch, the bounding box of each triangular patch should be slightly larger than the size of the triangular patch, that is, the bounding box constructed by the vertex coordinates of the triangular patch is the minimum bounding box, and then the minimum bounding box is enlarged by a set proportion according to the point cloud density information to obtain the required actual bounding box. The magnification ratio required for the actual bounding box can be 5%, 10%, 20%, etc., and can be specifically selected according to the actual needs of those skilled in the art.
[0098] In this embodiment, when the point cloud data obtained in step S214 is orthogonally projected onto the corresponding triangular patch, based on the mapping result, it is possible to determine the triangular patches that are completely on the outer surface of the original CAD model, the triangular patches that are partially on the outer surface of the original CAD model, that is, the intersecting triangular patches, and the triangular patches that are completely inside the original CAD model. Among them, the triangular patches that are completely on the outer surface of the original CAD model can be defined as completely retained, the triangular patches that are partially on the outer surface of the original CAD model can be defined as partially retained, and the triangular patches that are completely inside the original CAD model can be defined as discarded. Specifically, since only the geometric features of the outer surface of the original CAD model need to be concerned, and there may be triangular patches inside the actual original CAD model, and there may be a situation where triangular patches are interspersed on the outer surface of the model. Then in step S300, the process of associating the point cloud with the triangular patches of the original CAD model is a process of judging the structural type of the triangular patches, and the specific judgment process is as follows:
[0099] S310: Set the average value of the distances between all adjacent mapped points on the triangular patch for determination as the threshold value.
[0100] S320: Find a first mapped point closest to each vertex of the triangular patch for determination, and calculate the distances from the three first mapped points to the corresponding vertices to obtain three vertex distances.
[0101] S330: If the obtained vertex distances are all less than the set threshold value, determine that the corresponding triangular patch is to be completely retained; if some or all of the obtained vertex distances are greater than the set threshold value, determine that the corresponding triangular patch is to be partially retained; if there are no mapped points on the triangular patch, discard the corresponding triangular patch.
[0102] It should be known that in step S310, other methods can also be used for the specific setting method of the threshold value for subsequent determination of the triangular patch type. For example, the weighted average value of each mapped point to each vertex can be used as the set threshold value. Specifically, it can be selected according to the actual needs of those skilled in the art.
[0103] It should be known that after determining the types of each triangular patch, the processing methods for different types of triangular patches in the subsequent process are also different. For the triangular patches to be completely retained, since they are completely on the outer surface of the original CAD model, that is, the triangular patches belong to the triangular patches in the smooth structure area of the model, no operation is required in the subsequent reconstruction process of the original CAD model to reduce the computational amount of model reconstruction. For the discarded triangular patches, since they are completely inside the original CAD model, there is no situation of surface intersection and gap generation, and they are not the target of subsequent model reconstruction, so they only need to be deleted subsequently to further reduce the computational amount of model reconstruction. Based on the triangular patches to be partially retained, which combine the characteristics of the completely retained and discarded triangular patches, the subsequent reconstruction process of the triangular patches is the reconstruction process of the triangular patches to be partially retained. The specific reconstruction process is as follows:
[0104] S340: Determine the dividing line of the triangular patch based on the first mapped points corresponding to each vertex of the triangular patch.
[0105] S350: Connect each triangular patch in sequence according to the obtained dividing line to obtain a complete dividing line, re - distribute points on the complete dividing line and adjust the mesh structure to generate new triangular patches.
[0106] Specifically, for the partially retained triangular facets, part of them is located on the outer surface of the original CAD model, and part is located inside the original CAD model. Therefore, the reconstruction process of the partially retained triangular facets mainly includes the determination of the dividing line and the trimming process of the triangular facets based on the dividing line. Among them, the dividing line can be regarded as the boundary line of the part that needs to be retained of the partially retained triangular facets, including the intersection line of adjacent triangular facets and the dividing line between the triangular facets and the inside and outside of the original CAD model.
[0107] It should be noted that based on the above step S330, there are mainly three situations for the partially retained triangular facets. The first is that one of the three vertex distances corresponding to the three vertices is greater than the threshold set in step S310; the second is that two of the three vertex distances corresponding to the three vertices are greater than the threshold set in step S310; the third is that all three vertex distances corresponding to the three vertices are greater than the threshold set in step S310. The determination processes of the dividing lines corresponding to these three situations are all different. For the convenience of understanding, the specific determination process of the dividing line will be described in detail for these three situations below.
[0108] Specifically, for the first situation, step S340 includes the following specific processes:
[0109] S341: Obtain the second mapping points on the outermost circle of the triangular facet based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary.
[0110] S342: According to the first mapping point V corresponding to the vertex distance greater than the set threshold, construct a first vector from the first mapping point V to the corresponding vertex of the triangular facet, and a second vector from the first mapping point V to other second mapping points on the closed boundary.
[0111] S343: Find all the second mapping points corresponding to the second vectors whose included angles with the first vector are less than 100°.
[0112] S344: Determine whether the connection line between the second mapping point found in step S343 and the nearest vertex intersects the closed boundary; if not, form a dividing line by combining the second mapping point found in step S343 and the first mapping point V; if it intersects and there are no other second mapping points meeting the conditions of step S343, form a dividing line with the first mapping point V alone.
[0113] For the second situation, step S340 includes the following specific processes:
[0114] S341: Obtain the second mapping points on the outermost circle of the triangular facet based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary.
[0115] S345: Locate the closed boundary region between the first mapping points corresponding to the distances between the two vertices, and form a dividing line based on all the second mapping points within the located closed boundary region.
[0116] For the third case, step S340 includes the following specific process:
[0117] S341: Obtain the second mapping points on the outermost circle of the triangular facets based on the convex hull algorithm, and sequentially connect the obtained second mapping points to form a closed boundary.
[0118] S346: Use the closed boundary obtained in step S341 as the dividing line.
[0119] In this embodiment, step S350 includes the following specific process:
[0120] S351: Sequentially connect the dividing lines of each intersecting triangular facet according to the adjacency relationship of the triangular facets to obtain the required complete dividing line.
[0121] S352: On the obtained complete dividing line, uniformly distribute points with a density of at most 1 / 3 of the average side length of all triangular facets.
[0122] S353: Locally adjust the grid structure of the intersecting region of the triangular facets in step S351 according to the distributed points to generate new triangular facets, and delete the originally partially retained triangular facets and the discarded triangular facets.
[0123] It can be understood that in step S352, more points can be arranged on the complete dividing line by setting the point distribution density. In this way, more and denser new triangular facets can be formed at the complex connection positions of the original CAD model, so as to provide a smoother transition structure for the complex connection positions of the original CAD model while achieving a clean transition without surface intersection. Specifically, any two adjacent points arranged on the complete dividing line can be used as one side length of the new triangular facet. Then, the more points are arranged, the more new triangular facets are formed, and the smoother the transition structure formed by multiple small new triangular facets is, especially for the case of arc boundary connection. Of course, the number of points arranged on the complete dividing line should not be too large, as too many points will lead to an excessive number of new triangular facets being generated, resulting in a sharp increase in the computational workload. The specific number of points arranged can be selected according to the actual needs of those skilled in the art.
[0124] The foregoing has described the basic principles, main features and advantages of the present application. Those skilled in the art should understand that the present application is not limited by the above embodiments, and what is described in the above embodiments and the specification is only the principle of the present application. Without departing from the spirit and scope of the present application, various changes and improvements will occur to the present application, and these changes and improvements all fall within the scope of the present application claimed. The scope of protection required by the present application is defined by the appended claims and their equivalents.
Claims
1. A modeling method for a CAD surface geometric model based on image recognition, characterized in that It includes the following steps: S100: Extract features from the original CAD model based on image recognition technology to obtain the original point cloud model; S200: Project the obtained original point cloud model onto the original CAD model to obtain an accurate point cloud model of the outer surface of the original CAD model; S300: Associate the point cloud corresponding to the accurate point cloud model with the triangular patches of the original CAD model to determine the positions of the intersecting triangular patches and reconstruct them, thereby obtaining a CAD geometric model without surface intersections and with a clean surface; In step S300, the specific process of associating the point cloud with the triangular patches of the original CAD model is as follows: S310: Set the average value of the distances between all adjacent mapped points on the triangular patch to be judged as the threshold; S320: Find a first mapped point closest to each vertex on the triangular patch to be judged, and calculate the distances from the three first mapped points to the corresponding vertices to obtain three vertex distances; S330: If the obtained vertex distances are all less than the set threshold, judge that the corresponding triangular patch is to be completely retained; if some or all of the obtained vertex distances are greater than the set threshold, judge that the corresponding triangular patch is to be partially retained; If there is no mapped point on the triangular patch, discard the corresponding triangular patch; In step S300, no operation is required for the completely retained triangular patches, and the discarded triangular patches are deleted later; for the partially retained triangular patches, reconstruction is carried out. The specific reconstruction process is as follows: S340: Determine the dividing line of the triangular patch based on the first mapped points corresponding to the vertices of the triangular patch; S350: Connect the triangular patches in sequence according to the obtained dividing line to obtain a complete dividing line, re - distribute points on the complete dividing line and adjust the mesh structure to generate new triangular patches; If only one of the calculated vertex distances is greater than the set threshold, step S340 includes the following specific process: S341: Obtain the second mapped points on the outermost circle of the triangular patch based on the convex hull algorithm, and connect the obtained second mapped points in sequence to form a closed boundary; S342: According to the first mapped point V corresponding to the vertex distance greater than the set threshold, construct a first vector from the first mapped point V to the corresponding vertex of the triangular patch, and a second vector from the first mapped point V to other second mapped points on the closed boundary; S343: Find all the second mapped points corresponding to the second vectors with an angle less than 100° with the first vector; S344: Judge whether the connection line between the second mapped points found in step S343 and the nearest vertex intersects the closed boundary; if not, form a dividing line with the second mapped points found in step S343 and the first mapped point V; if it intersects and there are no other second mapped points meeting the conditions of step S343, form a dividing line with the first mapped point V alone.
2. The modeling method of the CAD surface geometric model based on image recognition according to claim 1, characterized in that Step S100 includes the following process: S110: Input the original CAD model and obtain its multi - direction view information; S120: Use the view information of the original CAD model as the input of the coarsened model to obtain a rough point cloud model; S130: Aggregate the view information of the original CAD model, and combine the rough point cloud model as the input of the refined model. Extract features through the global guidance mechanism to obtain the original point cloud model.
3. The modeling method of the CAD surface geometric model based on image recognition according to claim 2, characterized in that, Step S110 includes the following specific processes: S111: Based on the original CAD model, construct an enclosing sphere; S112: Arrange multiple cameras evenly on the enclosing sphere; S113: Take pictures of the original CAD model through the arranged cameras to obtain multi-view information of the original CAD model.
4. The modeling method of the CAD surface geometric model based on image recognition according to claim 1, characterized in that, Step S200 includes the following processes: S210: Based on the STL data information of the original CAD model, construct the bounding box of each triangular patch and quickly determine the point cloud data belonging to the triangular patch; S220: Project the point cloud data obtained in step S210 onto the original CAD model according to the determination result; S230: According to the projection points falling on the outer surface of the original CAD model, obtain the accurate point cloud model of the outer surface of the original CAD model.
5. The modeling method of the CAD surface geometric model based on image recognition according to claim 4, characterized in that, Step S210 includes the following specific processes: S211: Construct the minimum bounding box according to the vertex coordinates of each triangular patch in the original CAD model; S212: Increase the minimum bounding box by a set proportion along the diagonal length to obtain the actual bounding box; S213: Compare the coordinate information of the two points determining the actual bounding box with the coordinate information of each point cloud in the original point cloud model, so as to identify all the point clouds that may be included in the triangular patch; S214: Based on the vertical distance between the point cloud identified in step S213 and the triangular patch, determine the triangular patch to which each point of the identified point cloud belongs.
6. The modeling method of the CAD surface geometric model based on image recognition according to claim 1, characterized in that If at least two of the calculated vertex distances are greater than the set threshold, then step S340 includes the following specific processes: S341: Based on the convex hull algorithm, obtain the second mapping points on the outermost circle of the triangular patch, and connect the obtained second mapping points in sequence to form a closed boundary; S345: If two vertex distances are greater than the set threshold, locate the closed boundary area between the first mapping points corresponding to the two vertex distances respectively, and form a dividing line according to all the second mapping points within the located closed boundary area; S346: If all three vertex distances are greater than the set threshold, use the closed boundary as the dividing line.
7. The modeling method of the CAD surface geometric model based on image recognition according to claim 1, characterized in that, Step S350 includes the following specific processes: S351: Connect the dividing lines of each intersecting triangular patch in sequence according to the adjacency relationship of the triangular patches to obtain the required complete dividing line; S352: On the obtained complete dividing line, evenly distribute points with a density of at most 1 / 3 of the average side length of all triangular patches; S353: According to the distributed points, locally adjust the grid structure of the intersecting area of the triangular patches in step S351 to generate new triangular patches, and delete the originally partially retained triangular patches and the discarded triangular patches.
Citation Information
Patent Citations
Building LIDAR point cloud reconstruction optimization method based on rule constraints
CN107767453A