Modeling method of CAD (Computer Aided Design) surface geometric model based on image recognition
Through the CAD surface geometric model modeling method based on image recognition technology, the problems of surface intersection and tiny discontinuous gaps during geometric cleaning in CAE are solved, and the CAD geometric model without surface intersection is quickly recognized and reconstructed, improving geometry Cleaning efficiency and robustness.
Patent Information
- Application Number
- CN202411309882.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-19
AI Technical Summary
During the CAE analysis process, it is difficult for the prior art to generate mesh directly from the CAD model, and manual intervention is required for geometric cleaning, especially due to the problems of surface intersection and tiny discontinuous gaps, the geometric cleaning process is complicated.
Using the CAD surface geometric model modeling method based on image recognition technology, we use feature extraction and point cloud projection to identify and reconstruct the triangle face sheet without surface intersection to generate a CAD geometric model with clean surface intersection.
Quickly judge the intersection of triangular faces, improve the efficiency of model geometric cleaning, is suitable for geometric models of complex surfaces, and is highly robust.
Smart Images

Figure CN119167461A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of CAD modeling, and in particular to a modeling method of a CAD surface geometric model based on image recognition. Background Art
[0002] CAE refers to computer-aided engineering in engineering design. It can organically organize various links of engineering (production) through computer-aided solution and analysis of the structural mechanical properties of complex projects and products, as well as optimization of structural performance. The key is to integrate relevant information so that it is generated and exists throughout the entire life cycle of the project (product).
[0003] In the process of CAE analysis, mesh generation plays a vital role in the calculation of CAE. In many cases, meshes cannot be generated directly from CAD models. Manual intervention of geometry cleaning is often required to convert CAD models into geometry models that can be used by calculation methods and tool software before the subsequent mesh generation workflow can be carried out. However, in the existing geometry cleaning process, the geometry cleaning process is difficult due to problems such as surface intersections and small discontinuous gaps between the original CAD model parts. Summary of the invention
[0004] One of the purposes of the present application is to provide a method for modeling a CAD surface geometry model based on image recognition that can solve at least one of the defects in the above-mentioned background technology.
[0005] In order to achieve at least one of the above purposes, the technical solution adopted by the present application is: a modeling method of a CAD surface geometric model based on image recognition, comprising 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: Projecting the obtained original point cloud model into the original CAD model to obtain an accurate point cloud model of the outer surface of the original CAD model;
[0008] S300: Associating the point cloud corresponding to the precise point cloud model with the triangular facets of the original CAD model to determine the positions of the intersecting triangular facets and reconstructing them, thereby obtaining a CAD geometric model with no surface intersection and a clean surface.
[0009] Preferably, step S100 includes the following process:
[0010] S110: inputting the original CAD model and obtaining its multi-directional view information;
[0011] S120: using the view information of the original CAD model as the input of the coarse-grained model to obtain a rough point cloud model;
[0012] S130: Aggregate the view information of the original CAD model, combine it with the rough point cloud model as the input of the refined model, extract features through the global guidance mechanism, and obtain the original point cloud model.
[0013] Preferably, step S110 includes the following specific process:
[0014] S111: construct a bounding sphere based on the original CAD model;
[0015] S112: Arrange a plurality of cameras evenly distributed on the enclosing sphere;
[0016] S113: photographing 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 process:
[0018] S210: Based on the STL data information of the original CAD model, a bounding box of each triangular face is constructed and point cloud data belonging to the triangular face is quickly determined;
[0019] S220: Projecting the point cloud data obtained in step S210 onto the original CAD model according to the determination result;
[0020] S230: Obtaining an accurate point cloud model of the outer surface of the original CAD model according to the projection points falling on the outer surface of the original CAD model.
[0021] Preferably, step S210 includes the following specific process:
[0022] S211: constructing a minimum bounding box according to the vertex coordinates of each triangular face in the original CAD model;
[0023] S212: increasing the minimum bounding box along the diagonal length by a set ratio to obtain an actual bounding box;
[0024] S213 compares the coordinate information of the two points of the actual bounding box with the coordinate information of each point cloud in the original point cloud model, thereby identifying all point clouds that may be included in the triangular face;
[0025] S214: Based on the vertical distance between the point cloud identified in step S213 and the triangular facet, determine the triangular facet 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 facets of the original CAD model is as follows:
[0027] S310: setting the average value of the distances between all adjacent mapping points on the triangular face to be determined as a threshold;
[0028] S320: Find a first mapping point closest to each vertex of the triangle patch to be determined, and calculate the distances from three first mapping points to the corresponding vertices to obtain three vertex distances;
[0029] S330: If the obtained vertex distances are all less than the set threshold, the corresponding triangular face is determined to be completely retained; if some or all of the obtained vertex distances are greater than the set threshold, the corresponding triangular face is determined to be partially retained; if there is no mapping point on the triangular face, the corresponding triangular face is discarded.
[0030] Preferably, in step S300, no operation is required for completely retained triangular facets, and discarded triangular facets are deleted later; partially retained triangular facets are reconstructed, and the specific reconstruction process is as follows:
[0031] S340: Determine a segmentation line of the triangular patch based on first mapping points corresponding to vertices of the triangular patch;
[0032] S350: Connecting the triangular facets in sequence according to the obtained segmentation line to obtain a complete segmentation line, re-arranging points on the complete segmentation line and adjusting the mesh structure to generate a new triangular facet.
[0033] Preferably, if only one value among the calculated vertex distances is greater than a set threshold, step S340 includes the following specific process:
[0034] S341: Obtain the second mapping points of the outermost circle of the triangle patch based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary;
[0035] S342: constructing, according to the first mapping point V corresponding to the vertex distance greater than the set threshold, a first vector from the first mapping point V to the corresponding triangle vertex, and a second vector from the first mapping point V to other second mapping points on the closed boundary;
[0036] S343: Find the second mapping points corresponding to all second vectors whose angles with the first vector are less than 100°;
[0037] S344: Determine whether the line connecting the second mapping point found in step S343 and the nearest vertex intersects with the closed boundary; if not, the second mapping point found in step S343 and the first mapping point V together form a segmentation line; if they intersect and there is no other second mapping point that meets the conditions of step S343, the first mapping point V alone forms a segmentation line.
[0038] Preferably, if at least two values of the calculated vertex distances are greater than a set threshold, step S340 includes the following specific process:
[0039] S341: Obtain the second mapping points of the outermost circle of the triangle patch based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary;
[0040] S345: if the distance between two vertices is greater than the set threshold, locate the closed boundary area between the first mapping points corresponding to the two vertex distances, and form a segmentation line according to all the second mapping points in the located closed boundary area;
[0041] S346: If the distances between all three vertices are greater than the set threshold, the closed boundary is used as a dividing line.
[0042] Preferably, step S350 includes the following specific process:
[0043] S351: connecting the segmentation lines of each intersecting triangular face in sequence according to the adjacency relationship of the triangular face to obtain the required complete segmentation line;
[0044] S352: On the obtained complete segmentation line, points are evenly distributed according to a density of at most 1 / 3 of the average side length of all triangles;
[0045] S353: adjusting the local mesh structure of the intersection area of the triangular facets in step S351 according to the arranged points to generate new triangular facets, and deleting the original partially retained triangular facets and the discarded triangular facets.
[0046] Compared with the prior art, the beneficial effects of this application are:
[0047] (1) The precise 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 of each triangular facet, thereby effectively reducing the time required for judging the intersection of triangular facets and improving the efficiency of model geometry cleaning.
[0048] (2) By reasonably setting the point cloud density, it can cope with geometric models with complex surfaces and has high robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 The figure is a schematic diagram of the overall workflow of this application.
[0050] Figure 2 This is a schematic diagram of the original CAD model structure of one of the examples of this application.
[0051] Figure 3 For this application Figure 2The original point cloud model corresponding to the original CAD model shown.
[0052] Figure 4 For this application Figure 2 The exact point cloud model corresponding to the original CAD model shown.
[0053] Figure 5 This application is based on Figure 2 Schematic diagram of the structure of the CAD geometric model with no surface intersection and clean surface output from the original CAD model. DETAILED DESCRIPTION
[0054] Below, the present application is further described in conjunction with specific implementation methods. It should be noted that, under the premise of no conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.
[0055] In the description of the present application, it should be noted that directional words, such as the terms "center", "lateral", "longitudinal", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", etc., indicating directions and positional relationships are based on the directions or positional relationships shown in the accompanying drawings, which are only for the convenience of narrating the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and cannot be understood as limiting the specific scope of protection of the present application.
[0056] It should be noted that the terms "first", "second", etc. in the description and claims of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0057] The terms "including" and "having" and any variations thereof in the specification and claims of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0058] One of the preferred embodiments of the present application is as follows: Figure 1 As shown, a modeling method of a CAD surface geometric model based on image recognition comprises the following steps:
[0059] S100: Extract features of the original CAD model based on image recognition technology to obtain an original point cloud model.
[0060] S200: Projecting the obtained original point cloud model into the original CAD model to obtain an accurate point cloud model of the outer surface of the original CAD model.
[0061] S300: Associating the point cloud corresponding to the precise point cloud model with the triangular facets of the original CAD model to determine the positions of the intersecting triangular facets and reconstructing them, thereby obtaining a CAD geometric model with no surface intersection and a clean surface.
[0062] It should be known that in the field of geometry, a triangle face is a two-dimensional geometric figure composed of three vertices and three edges; in three-dimensional software, the surface of a three-dimensional model is described by using triangle faces, and by combining a large number of adjacent triangle faces, the surface shape of a complex three-dimensional model can be obtained.
[0063] For 3D models with uniform or simple structures, the connection between adjacent triangles is continuous and smooth. Figure 2 Taking an original CAD model shown as an example, the original three-dimensional model includes a spherical part and a rectangular block part; for a single spherical part and a rectangular block part, they can be regarded as uniform structures, and the connection between adjacent triangular facets corresponding to the single spherical part and the rectangular block part is smooth and uniform; however, when the spherical part and the rectangular block part are combined together, there will be structural discontinuity in the structural position of the two, and the triangular facets formed at this position will intersect, which will cause problems such as surface intersection and tiny discontinuous gaps in the original CAD model.
[0064] Based on the outline of the current original CAD model, the corresponding original point cloud model can be generated; Figure 2 Taking the original CAD model shown in the figure as an example, the original point cloud model obtained is as follows Figure 3 Then the obtained point cloud model is re-projected, i.e., mapped to the original CAD model, and an accurate point cloud model evenly covering the outer surface of the original CAD model can be obtained; Figure 2 Taking the original CAD model shown in the figure as an example, the obtained accurate point cloud model is as follows Figure 4 As shown. Finally, the triangular facet structure of the original CAD model is classified according to the mapping results of the point cloud corresponding to the obtained precise 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 intersection and small discontinuous gaps can be obtained. Then, the intersecting triangular facets are structurally reconstructed according to the precise point cloud model, and new triangular facets with continuous structures can be regenerated according to the generated point cloud at the locations where the surfaces intersect and the seams are discontinuous, so that a new CAD model with uniform triangular facet structure at complex connection locations can be obtained, that is, a CAD geometric model with no surface intersection and clean surface can be obtained; Figure 2 Taking the original CAD model shown in the figure as an example, the new CAD model is as follows Figure 5 shown.
[0065] Compared with traditional methods, the precise point cloud model obtained by the present application 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 of each triangular facet, thereby effectively reducing the time required for triangular facet intersection judgment to improve the efficiency of model geometry cleaning.
[0066] It should be noted that the point cloud density of the point cloud models 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 ease of understanding, the following will be described in detail by taking the multi-view acquisition method as an example. The specific process is as follows:
[0068] S110: Input the original CAD model and obtain its multi-directional view information.
[0069] S120: Using the view information of the original CAD model as the input of the coarse-grained model to obtain a rough point cloud model.
[0070] S130: Aggregate the view information of the original CAD model, combine it with the rough point cloud model as the input of the refined model, extract features through the global guidance mechanism, and obtain the original point cloud model.
[0071] It is understandable that by obtaining the view information of the original CAD model in multiple directions, point cloud generation can be achieved for all positions of the original CAD model to ensure the accuracy of the point cloud model. After obtaining the multi-directional view information corresponding to the original CAD model, the image information on each view can be converted into a corresponding point cloud through image recognition technology, and then the point clouds corresponding to the multiple views are globally guided to eliminate erroneous points and duplicate points, so as to obtain the required original point cloud model. For ease of understanding, the specific process of obtaining multi-directional views and generating point cloud models will be described in detail below.
[0072] Specifically, there are many ways to obtain the multi-directional view information of the original CAD model in step S110. For example, the original CAD model can be manually or algorithmically transformed at multiple spatial angles to obtain the corresponding view information, or it can be obtained by using a camera dot matrix. In order to ensure the accuracy of each view information acquisition and reduce the difference between each view information, the camera dot matrix method is preferably used in this embodiment. The specific process of obtaining the multi-directional view information of the original CAD model through the camera dot matrix is as follows:
[0073] S111: Construct a bounding sphere based on the original CAD model.
[0074] S112: Arrange a plurality of cameras evenly distributed on the enclosing sphere.
[0075] S113: photographing the original CAD model through the arranged cameras to obtain multi-view information of the original CAD model.
[0076] It should be known that the enclosing sphere in step S111 can be regarded as a lattice structure of multiple interconnected points in space surrounding the original CAD model. The lattice structure wraps the original CAD model in a spherical manner in space, and the center of the enclosing sphere corresponds to the circumcenter of the original CAD model. Based on the obtained enclosing sphere, a plurality of layout points evenly distributed on the enclosing sphere can be generated, and a camera is set at each layout point, and the shooting angle of the camera is toward the center position of the enclosing sphere, so that the view information of the original CAD model in multiple directions can be obtained, and the shooting angle of each view information is consistent, so as to ensure that the subsequently generated three-dimensional point cloud model has good compatibility with the surface of the original CAD model.
[0077] It is understandable that there are many ways to generate layout points on the bounding sphere for arranging cameras. The more common way is to generate multiple points on the bounding sphere that are evenly stressed by each other as layout points based on the principle of mechanics. The force received by each layout point can be expressed by the following expression:
[0078]
[0079] Among them, F m represents the resultant force received by the mth layout point, r m represents the position of the mth layout point on the bounding sphere, r n represents the position of the adjacent n-th layout point on the bounding sphere, represents the vector between adjacent m-th and n-th layout points, Represents the distance between adjacent m-th and n-th layout points.
[0080] It should be noted that the number of arrangement points, that is, the number of cameras to be arranged, can be selected according to the actual needs of technical personnel in this field, and the specific camera arrangement can be arranged in the three-dimensional software; for example, 64 cameras can be evenly arranged on the enclosing sphere.
[0081] It should be known that step S120 and step S130 are two specific steps of the point cloud generation method based on image recognition technology. There are many specific methods for generating point clouds through image recognition technology. For the sake of easy understanding, step S120 and step 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, and the feature information of a single view can be combined with other view information 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 a rough point cloud model for each view. Among them, the generation method of the spatial features of each view can be a convolutional layer calculation method, 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, the information of multiple views of the original CAD model is first 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 be extracted through a series of shared multi-layer perceptrons. At the same time, the aggregated information of multiple views will be processed by a global feature extractor composed of a series of convolutional layers and downsampling layers to learn multi-level global guidance features, and combine the global guidance features at each level 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 characterize 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 feature point mismatch and non-robustness in the unit point cloud model caused by the appearance difference and occlusion between views. That is, this embodiment can handle geometric models with complex surfaces by reasonably setting the point cloud density, and has high robustness.
[0087] In this embodiment, when generating the above-mentioned precise point cloud model, only the geometric features of the external surface of the original CAD model are retained, and the internal geometric features of the original CAD model do not need to be concerned. Therefore, in step S200, the original CAD model can be cleaned up by 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 facets. In step S200, the process of cleaning up 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, a bounding box of each triangular face is constructed and point cloud data belonging to the triangular face is quickly determined.
[0089] S220: Projecting the point cloud data obtained in step S210 onto the original CAD model according to the determination result.
[0090] S230: Obtaining an accurate point cloud model of the outer surface of the original CAD model according to the projection points falling on the outer surface of the original CAD model.
[0091] It should be known that STL is the guaranteed format of model files in three-dimensional software, and is also the file format for 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 facet can be constructed according to the triangular mesh model. In step S220, there are many ways to project the point cloud data. In order 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 point is the outer surface area of the model. By subsequently establishing the association between the point cloud and the triangular facet, accurate model outer surface data, that is, an accurate point cloud model, can be obtained.
[0092] Specifically, in step S210, since the triangular mesh model generally adopts a "point-edge-face-shell" structure, a bounding box surrounding each triangular face can be constructed based on the vertex information of each triangular face in the triangular mesh model. The specific construction process of the bounding box and the specific recognition process of the triangular face point cloud are as follows:
[0093] S211: Construct a minimum bounding box according to the vertex coordinates of each triangular facet in the original CAD model.
[0094] S212: Increase the minimum bounding box along the diagonal length by a set ratio to obtain an actual bounding box.
[0095] S213 compares the coordinate information of the two points of the actual bounding box with the coordinate information of each point cloud in the original point cloud model, so as to identify all point clouds that may be contained in the triangular face.
[0096] S214: Based on the vertical distance between the point cloud identified in step S213 and the triangular facet, determine the triangular facet 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, the coordinate information of these two points and the coordinate information of each point in the original point cloud model can be used to quickly determine the point cloud that the triangular patch may contain; then further determination is made 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 degree of increase is determined by the point cloud density information to enlarge the minimum bounding box by a set proportion to obtain the required actual bounding box. The required enlargement ratio for the actual bounding box can be 5%, 10%, 20%, etc., which can be selected according to the actual needs of technicians in this field.
[0098] In this embodiment, when the point cloud data obtained in step S214 is mapped to the corresponding triangular facets through orthogonal projection, the triangular facets that are completely on the outer surface of the original CAD model, the triangular facets that are partially on the outer surface of the original CAD model, that is, there are intersecting triangular facets, and the triangular facets that are completely inside the original CAD model can be determined based on the mapping result. Among them, the triangular facets that are completely on the outer surface of the original CAD model can be defined as completely retained, the triangular facets that are partially on the outer surface of the original CAD model can be defined as partially retained, and the triangular facets 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, the actual original CAD model may also have triangular facets inside the model, and there may be situations where triangular facets are interspersed on the outer surface of the model. In step S300, the process of associating the point cloud with the triangular facets of the original CAD model is the process of judging the structural type of the triangular facets, and the specific judgment process is as follows:
[0099] S310: Setting the average value of the distances between all adjacent mapping points on the triangle to be judged as a threshold.
[0100] S320: Find a first mapping point closest to each vertex of the triangle face to be determined, and calculate the distances from three first mapping points to the corresponding vertices to obtain three vertex distances.
[0101] S330: If the obtained vertex distances are all less than the set threshold, the corresponding triangular face is determined to be completely retained; if some or all of the obtained vertex distances are greater than the set threshold, the corresponding triangular face is determined to be partially retained; if there is no mapping point on the triangular face, the corresponding triangular face is discarded.
[0102] It should be known that in step S310, the specific setting method of the threshold for subsequent determination of the type of triangular facets may also be other methods, such as using a weighted average value of each mapping point to each vertex as the set threshold. The specific method may be selected according to the actual needs of those skilled in the art.
[0103] It is important to know that after determining the type of each triangular facet, different types of triangular facets are processed differently in the subsequent process. For fully retained triangular facets, since they are completely on the outer surface of the original CAD model, that is, the triangular facets belong to the triangular facets 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 amount of computation required for model reconstruction. For discarded triangular facets, since they are completely inside the original CAD model, there is no intersection of surfaces or gaps, and they are not the target of subsequent model reconstruction, so they only need to be deleted in the subsequent process to further reduce the amount of computation required for model reconstruction. Based on the partially retained triangular facets, which combine the characteristics of fully retained and discarded triangular facets, the subsequent reconstruction process of triangular facets is the reconstruction process of partially retained triangular facets. The specific reconstruction process is as follows:
[0104] S340: Determine a segmentation line of the triangular patch based on the first mapping points corresponding to the vertices of the triangular patch.
[0105] S350: Connecting the triangular facets in sequence according to the obtained segmentation line to obtain a complete segmentation line, re-arranging points on the complete segmentation line and adjusting the mesh structure to generate a new triangular facet.
[0106] Specifically, for the partially retained triangular facets, some of them are located on the outer surface of the original CAD model, and some are located inside the original CAD model. Therefore, the reconstruction process of the partially retained triangular facets is mainly divided into the determination of the segmentation line and the trimming process of the triangular facets based on the segmentation line. Among them, the segmentation line can be regarded as the boundary line of the part of the partially retained triangular facets that needs to be retained, including the intersection line of adjacent triangular facets and the boundary 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-mentioned step S330, there are three main cases of 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 the three vertex distances corresponding to the three vertices are all greater than the threshold set in step S310. The determination process of the segmentation line corresponding to these three cases is different. For the sake of easy understanding, the specific determination process of the segmentation line for these three cases will be described in detail below.
[0108] Specifically, for the first case, step S340 includes the following specific processes:
[0109] S341: Obtain the second mapping points of the outermost circle of the triangle patch based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary.
[0110] S342: constructing a first vector from the first mapping point V to the corresponding triangle vertex and a second vector from the first mapping point V to other second mapping points on the closed boundary according to the first mapping point V corresponding to the vertex distance greater than the set threshold.
[0111] S343: Find the second mapping points corresponding to all second vectors whose angles with the first vector are less than 100°.
[0112] S344: Determine whether the line connecting the second mapping point found in step S343 and the nearest vertex intersects with the closed boundary; if not, the second mapping point found in step S343 and the first mapping point V together form a segmentation line; if they intersect and there is no other second mapping point that meets the conditions of step S343, the first mapping point V alone forms a segmentation line.
[0113] For the second case, step S340 includes the following specific processes:
[0114] S341: Obtain the second mapping points of the outermost circle of the triangle patch based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary.
[0115] S345: Locate a closed boundary region between the first mapping points corresponding to the two vertex distances, and construct a segmentation line according to all second mapping points in the located closed boundary region.
[0116] For the third case, step S340 includes the following specific processes:
[0117] S341: Obtain the second mapping points of the outermost circle of the triangle patch based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary.
[0118] S346: Use the closed boundary obtained in step S341 as a dividing line.
[0119] In this embodiment, step S350 includes the following specific processes:
[0120] S351: Connect the segmentation lines of each intersecting triangular facet in sequence according to the adjacency relationship of the triangular facets to obtain the required complete segmentation line.
[0121] S352: On the obtained complete segmentation line, points are evenly distributed according to a density of at most 1 / 3 of the average side length of all triangles.
[0122] S353: adjusting the local mesh structure of the intersection area of the triangular facets in step S351 according to the arranged points to generate new triangular facets, and deleting the original partially retained triangular facets and the discarded triangular facets.
[0123] It is understandable that in step S352, more points can be arranged on the complete dividing line by setting the point density, so that more and denser new triangular facets can be formed for the complex connection positions of the original CAD model, thereby achieving a clean transition without surface intersections and providing a smoother transition structure for the complex connection positions of the original CAD model. Specifically, any adjacent point arranged on the complete dividing line can be used as one of the side lengths of a new triangular facet, so the more points are arranged, the more new triangular facets are formed, and the transition structure formed by multiple small new triangular facets is smoother, especially for the case of arc-shaped boundary connections. Of course, the number of points on the complete dividing line should not be too large. Too many points will result in too many new triangular facets being generated, causing a sharp increase in the amount of calculation. The specific number of points can be selected according to the actual needs of those skilled in the art.
[0124] The above describes 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 the above embodiments and the specification only describe the principles of the present application. The present application may have various changes and improvements without departing from the spirit and scope of the present application, and these changes and improvements fall within the scope of the present application for which protection is sought. The scope of protection claimed by the present application is defined by the attached claims and their equivalents.
Claims
1. A modeling method for a CAD surface geometric model based on image recognition, characterized in that: The steps include: S100: Extract features from the original CAD model based on image recognition technology to obtain the original point cloud model; S200: Projecting the obtained original point cloud model into the original CAD model to obtain an accurate point cloud model of the outer surface of the original CAD model; S300: Associating the point cloud corresponding to the precise point cloud model with the triangular facets of the original CAD model to determine the positions of the intersecting triangular facets and reconstructing them, thereby obtaining a CAD geometric model with no surface intersection and a clean surface.
2. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 1, characterized in that: Step S100 includes the following process: S110: inputting the original CAD model and obtaining its multi-directional view information; S120: using the view information of the original CAD model as the input of the coarse-grained model to obtain a rough point cloud model; S130: Aggregate the view information of the original CAD model, combine it with the rough point cloud model as the input of the refined model, extract features through the global guidance mechanism, and obtain the original point cloud model.
3. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 2, characterized in that: Step S110 includes the following specific processes: S111: construct a bounding sphere based on the original CAD model; S112: Arrange a plurality of cameras evenly distributed on the enclosing sphere; S113: photographing the original CAD model through the arranged cameras to obtain multi-view information of the original CAD model.
4. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 1, characterized in that: Step S200 includes the following process: S210: Based on the STL data information of the original CAD model, a bounding box of each triangular face is constructed and point cloud data belonging to the triangular face is quickly determined; S220: Projecting the point cloud data obtained in step S210 onto the original CAD model according to the determination result; S230: Obtaining an accurate point cloud model of the outer surface of the original CAD model according to the projection points falling on the outer surface of the original CAD model.
5. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 4, characterized in that: Step S210 includes the following specific processes: S211: constructing a minimum bounding box according to the vertex coordinates of each triangular face in the original CAD model; S212: increasing the minimum bounding box along the diagonal length by a set ratio to obtain an actual bounding box; S213 compares the coordinate information of the two points of the actual bounding box with the coordinate information of each point cloud in the original point cloud model, thereby identifying all point clouds that may be included in the triangular face; S214: Based on the vertical distance between the point cloud identified in step S213 and the triangular facet, determine the triangular facet to which each point of the identified point cloud belongs.
6. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 1, characterized in that: In step S300, the specific process of associating the point cloud with the triangular facets of the original CAD model is as follows: S310: setting the average value of the distances between all adjacent mapping points on the triangular face to be determined as a threshold; S320: Find a first mapping point closest to each vertex of the triangle patch to be determined, and calculate the distances from three first mapping points to the corresponding vertices to obtain three vertex distances; S330: If the obtained vertex distances are all less than the set threshold, the corresponding triangular face is determined to be completely retained; if some or all of the obtained vertex distances are greater than the set threshold, the corresponding triangular face is determined to be partially retained; If there is no mapping point on the triangle, the corresponding triangle will be discarded.
7. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 6, characterized in that: In step S300, no operation is required for completely retained triangular facets, and discarded triangular facets are deleted later; partially retained triangular facets are reconstructed, and the specific reconstruction process is as follows: S340: Determine a segmentation line of the triangular patch based on first mapping points corresponding to vertices of the triangular patch; S350: Connecting the triangular facets in sequence according to the obtained segmentation line to obtain a complete segmentation line, re-arranging points on the complete segmentation line and adjusting the mesh structure to generate a new triangular facet.
8. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 7, characterized in that: If only one value among the calculated vertex distances is greater than the set threshold, step S340 includes the following specific processes: S341: Obtain the second mapping points of the outermost circle of the triangle patch based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary; S342: constructing, according to the first mapping point V corresponding to the vertex distance greater than the set threshold, a first vector from the first mapping point V to the corresponding triangle vertex, and a second vector from the first mapping point V to other second mapping points on the closed boundary; S343: Find the second mapping points corresponding to all second vectors whose angles with the first vector are less than 100°; S344: Determine whether the line connecting the second mapping point found in step S343 and the nearest vertex intersects with the closed boundary; if not, the second mapping point found in step S343 and the first mapping point V together form a segmentation line; if they intersect and there is no other second mapping point that meets the conditions of step S343, the first mapping point V alone forms a segmentation line.
9. The method for modeling a CAD surface geometric model based on image recognition as claimed in claim 7, characterized in that: If at least two values of the calculated vertex distances are greater than the set threshold, step S340 includes the following specific process: S341: Obtain the second mapping points of the outermost circle of the triangle patch based on the convex hull algorithm, and connect the obtained second mapping points in sequence to form a closed boundary; S345: if the distance between two vertices is greater than the set threshold, locate the closed boundary area between the first mapping points corresponding to the two vertex distances, and form a segmentation line according to all the second mapping points in the located closed boundary area; S346: If the distances between all three vertices are greater than the set threshold, the closed boundary is used as a dividing line.
10. The method for modeling a CAD surface geometric model based on image recognition according to claim 7, characterized in that: Step S350 includes the following specific processes: S351: connecting the segmentation lines of each intersecting triangular face in sequence according to the adjacency relationship of the triangular face to obtain the required complete segmentation line; S352: On the obtained complete segmentation line, points are evenly distributed according to a density of at most 1 / 3 of the average side length of all triangles; S353: adjusting the local mesh structure of the intersection area of the triangular facets in step S351 according to the arranged points to generate new triangular facets, and deleting the original partially retained triangular facets and the discarded triangular facets.
Citation Information
Patent Citations
Building LIDAR point cloud reconstruction optimization method based on rule constraints
CN107767453A
BIM-based lightweight deep processing work method
CN108595858A
Point cloud three-dimensional space image generation method and device
CN111612920A
Grid-parameter hybrid model modeling method and system
CN114611359A
3D model construction method and device and electronic equipment
CN116416366A
