A method for automatically establishing part surface difference points and gap points in CAE software

By automating the processing of part images in CAE software and combining it with OpenCV technology, the automatic establishment of surface defects and gaps in parts was achieved, solving the problems of low efficiency and poor consistency of manual operation, and improving the accuracy of feature points and work efficiency.

CN115795582BActive Publication Date: 2026-04-24DITUO (SHANGHAI) TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DITUO (SHANGHAI) TECH DEV CO LTD
Filing Date
2022-11-23
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In CAE software, manually creating feature points and gaps on part surfaces is inefficient and difficult to standardize, especially in complex curved areas. Furthermore, the feature points generated by different personnel vary greatly, making it difficult to ensure that the gaps all meet the requirements.

Method used

The batch processing program controls the CAE software to generate part images and uses OpenCV for feature recognition. It simulates mouse operations, automatically rotates the part, traverses the pixels on the gap curve, obtains the three-dimensional coordinates and normal direction, and automatically establishes feature points by combining surface difference points and gap point features.

Benefits of technology

It enables the automated creation of surface defects and gaps on parts, improving work efficiency and ensuring the accuracy and consistency of feature points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115795582B_ABST
    Figure CN115795582B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of CAE software, and more particularly to a method for automatically establishing part surface difference points and gap points in CAE software, comprising the following steps: displaying two parts that generate gaps, and hiding other irrelevant parts; using CAE software and batch processing commands to rotate the parts to obtain the best observation angle of the current part gap; saving the part picture under the best observation angle, and recording the picture as A; processing the picture A using opencv, extracting the pixel position corresponding to the gap and fitting the gap geometric curve to obtain the midpoint coordinates and normal of each gap; at each gap midpoint, emitting a ray to the two parts to obtain the pixel coordinates on the ray; using a simulated mouse to generate a test point and continuously adjusting the viewing angle of the view according to the normal of the test point; joining the surface difference point and the gap point features, querying and comparing the generated test points to screen out test points that meet the conditions; and establishing the surface difference point and the gap point according to the coordinates and normal direction of the screened test points that meet the conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CAE software technology, and specifically to a method for automatically creating surface defects and gaps in CAE software. Background Technology

[0002] Surface differences and gaps between assembled parts are important feature points in tolerance analysis. In CAE software, these points are typically created manually on the part surfaces, which is inefficient and difficult to standardize. For gaps with complex curved surfaces, many surface differences and gaps need to be set. Manually, these feature points are usually set based on experience, in areas with greater curvature, resulting in variations between different operators. Since the number of manually created feature points is often very limited, especially for gap feature points, it is difficult to guarantee that the gap requirements are met throughout the entire gap using only a limited number of pairs of gap feature points.

[0003] Conventional image recognition often only identifies the entire object or provides a rough estimate of specific features. In tolerance analysis, the measurement points used for calculations have high requirements; the gap point must be the closest point between two objects. Therefore, automation of this process involves multiple rotations, recognitions, comparisons, and calculations, which differs significantly from conventional image recognition. Summary of the Invention

[0004] To address the aforementioned problems, this invention proposes a method for automatically establishing surface imperfection points and gap points in CAE software. This method primarily solves the problem of establishing feature points on the gap between primary and secondary parts. The method controls the CAE software through a batch processing program, generating part images at different times and saving them to a specified directory. An OpenCV program is then called to perform feature recognition on the saved images, replacing manual judgment. Subsequently, using pixels, the program simulates mouse functionality to operate within the CAE software, adjusting the part's position and rotating it in real-time based on the coordinates and normals of the pilot points, thus achieving an automated operation process. By traversing the normal direction of pixels in the gap between two parts along the gap curve, pilot points are established to obtain the three-dimensional coordinates and normal direction of the pilot part surface. Then, combining the features of surface imperfection points and gap points, the required surface imperfection points and gap points are automatically obtained.

[0005] The technical solution adopted by this invention to solve its technical problem is:

[0006] This invention provides a method for automatically creating surface defects and gaps in parts using CAE software, comprising the following steps:

[0007] Step S01: Display the two parts that create the gap, and hide other irrelevant parts;

[0008] Step S02: Use CAE software and batch processing commands to rotate the part to obtain the best observation angle of the current part gap;

[0009] Step S03: Save the image of the part from the best viewing angle and record it as image A;

[0010] Step S04: Use OpenCV to process image A, extract the pixel positions corresponding to the gaps and fit the geometric curve of the gaps to obtain the coordinates of the midpoints and normals of each gap.

[0011] Step S05: At the midpoint of each gap, emit rays to the two parts to obtain the pixel coordinates on the rays;

[0012] Step S06: Using a simulated mouse, generate a pilot and continuously adjust the view's perspective based on the pilot's normal.

[0013] Step S07: Combine the features of surface defects and gaps to query and compare the generated pilot projects in order to select pilot projects that meet the conditions;

[0014] Step S08: Based on the three-dimensional coordinates and normal directions of the selected pilot points that meet the criteria, establish surface difference points and gap points.

[0015] Preferably, step S02 further includes:

[0016] Rotate the two parts, and take a screenshot every time they are rotated to a certain angle;

[0017] Each screenshot image is processed using the OpenCV program to obtain the pixel gap between the two parts;

[0018] Using the total pixel length of the resulting gap as the objective function, obtain the image with the longest gap pixel length among all captured screenshots.

[0019] The image with the longest gap pixel is considered the best viewing angle for the gap between the two parts.

[0020] Preferably, step S05 further includes:

[0021] Starting from the midpoint of each gap, generate two rays along its normal direction to each of the two parts;

[0022] The pixel coordinates on the ray can be obtained by returning the pixel points on the ray using OpenCV.

[0023] Preferably, step S06 includes:

[0024] Based on the pixels, establish pilot points on the surface of the part;

[0025] Returns the 3D coordinates and normal direction of each pilot.

[0026] Preferably, step S06 further includes:

[0027] When creating a pilot point for each pixel on each ray, adjust the view angle once after each pilot point is generated and its normal direction is obtained.

[0028] This will align the viewpoint with the direction of the normal and move the coordinates of the current pilot point to the center of the screen.

[0029] Save the image from the current viewpoint again;

[0030] Use OpenCV to identify gaps and obtain the pixel coordinates of the next pilot point from the current viewpoint.

[0031] Repeat this step until all pilot projects are established.

[0032] Preferably, the number of rotation angles is 100 to 300, and the resolution of the screenshot is 1000 pixels × 1000 pixels to 3000 pixels × 3000 pixels.

[0033] Preferably, in step S03, the image is saved in an environment with a resolution of 5000 pixels × 5000 pixels.

[0034] Preferably, the pilot is deleted after obtaining the three-dimensional coordinates and normal direction of the pilot.

[0035] Preferably, in step S04, 20 to 100 uniformly distributed midpoints of the gaps are interpolated on the fitted gap geometry curve, and the normal of each midpoint of the gap is solved by the fitted gap geometry curve.

[0036] Preferably, the two rays generated have a directional length of 2cm-10cm.

[0037] The above-described technical solution of the present invention has the following beneficial technical effects:

[0038] It can automatically build feature points and automatically identify gap features. It realizes the interaction between the image and the CAE digital model during the point building process. During the point building process, the part can be rotated and moved according to the shape features of the part, realizing the anthropomorphism of point building. Through the established pilot points, the analysis is carried out and the required surface difference points and gap points are finally obtained automatically, which improves work efficiency. Attached Figure Description

[0039] Figure 1 This is a diagram illustrating an embodiment of the present invention;

[0040] Figure 2This is a flowchart of the method of the present invention; Detailed Implementation

[0041] To make the technical means, creative features, achieved objectives, and effects of this invention readily understandable, the invention is further described below with reference to specific embodiments and accompanying drawings. However, the following embodiments are merely preferred embodiments of this invention and not all embodiments. Other embodiments obtained by those skilled in the art based on the embodiments described herein without creative effort are all within the protection scope of this invention. Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concept of this invention.

[0042] refer to Figure 2 .

[0043] This invention provides a method for automatically creating surface defects and gaps in parts using CAE software, comprising the following steps:

[0044] Step S01: Display the two parts that create the gap, and hide other irrelevant parts;

[0045] Step S02: Rotate the parts using CAE software and batch processing commands to obtain the optimal observation angle for the gap between the parts; rotate both parts, taking a screenshot after each rotation; process each screenshot using OpenCV to obtain the gap pixels between the two parts; using the total length of the obtained gap pixels as the objective function, obtain the image with the longest gap pixels among all captured screenshots, and consider the image with the longest gap pixels as the optimal observation angle for the gap between the two parts; the number of rotation angles is 100 to 300, and the resolution of the screenshots is 1000 pixels × 1000 pixels to 3000 pixels × 3000 pixels.

[0046] Step S03: Save the image of the part from the best viewing angle, and denote it as image A; the image is saved in an environment with a resolution of 5000 pixels × 5000 pixels.

[0047] Step S04: Use OpenCV to process image A, extract the pixel positions corresponding to the gaps and fit the gap geometry curve to obtain the coordinates and normals of each gap midpoint; interpolate 20 to 100 evenly distributed gap midpoints on the fitted gap geometry curve, and solve the normal of each gap midpoint through the fitted gap geometry curve.

[0048] Step S05: At the midpoint of each gap, emit rays towards the two parts to obtain the pixel coordinates on the rays; starting from the midpoint of each gap, generate two rays towards the two parts respectively along their normal direction; return the pixel points on the rays using OpenCV to obtain the pixel coordinates on the rays. The two rays are generated with a directional length of 2cm-10cm.

[0049] Step S06: Using a simulated mouse, generate pilot points and continuously adjust the view's perspective based on the pilot point's normal direction; establish pilot points on the part surface based on pixels; return the 3D coordinates and normal direction of each pilot point. After obtaining the 3D coordinates and normal direction of the pilot points, delete the pilot points.

[0050] When creating a pilot point for each pixel on each ray, after generating a pilot point and obtaining its normal direction, adjust the view angle once so that the viewpoint is aligned with the normal direction and move the coordinates of the current pilot point to the center of the screen; save the image under the current viewpoint again; use OpenCV to perform gap recognition to obtain the pixel coordinates of the next pilot point under the current viewpoint; repeat this step until all pilot points are created.

[0051] Step S07: Combine the features of surface defects and gaps to query and compare the generated pilot projects in order to select pilot projects that meet the conditions;

[0052] Specifically, the edges of parts are usually rounded, the surface defects are located at the edges of the plane and the chamfer, the gap between two parts is the smallest, and the gap is usually on the rounded corner. By combining these features of surface defects and gap, the generated pilots can be queried and compared to obtain pilots that meet the conditions.

[0053] Step S08: Based on the three-dimensional coordinates and normal directions of the selected pilot points that meet the criteria, establish surface difference points and gap points.

[0054] refer to Figure 1 The invention will be further explained below with reference to specific examples:

[0055] Taking the gap between the front and rear doors as an example, the main problem to be solved is the establishment of feature points on the gap 3 between the main part 1 and the secondary part 2.

[0056] Display two parts, Part 1 and Part 2, that need to be established for surface differences and gaps. Hide other unnecessary parts. Using CAE software and batch processing commands, rotate the two parts formed by Part 1 and Part 2. Take a screenshot after each rotation angle. Take 100 screenshots at each rotation angle. The resolution of the screenshots for the two parts is 1000 pixels × 1000 pixels. Process each screenshot image using OpenCV to obtain the gap 3 between Part 1 and Part 2. Using the total pixel length of gap 3 as the objective function, obtain the image with the longest gap pixels among all captured screenshots, thus obtaining the optimal observation angle for the gap between the two parts. Rotate the parts to the optimal observation angle for the gap, and save the image of the two parts at a resolution of 5000 pixels × 5000 pixels. This image is Image A. Process Image A using OpenCV to extract the pixel positions corresponding to the gap, fit the geometric curve of the gap, and then process the fitted gap... On the geometric curve, 20 evenly distributed gap midpoints are interpolated. The normal of each gap midpoint is solved by fitting the gap geometry curve. Starting from each gap midpoint, two rays are generated along its normal direction to part 1 and part 2 respectively. The length of the ray varies from 6 cm depending on the type of part. The pixels on this ray are returned by OpenCV. Using the simulated mouse function, pilot points are established on the surface of the parts based on the pixels. The three-dimensional coordinates and normal direction of each pilot point are returned. After obtaining the three-dimensional coordinates and normal direction, the pilot points are automatically deleted. When establishing pilot points for pixels on each ray, after each pilot point is generated and its normal direction is obtained, the view angle is adjusted so that the viewpoint is aligned with the normal direction, and the coordinates of the current pilot point are moved to the center of the screen. Then the image under the current viewpoint is saved again. Gap recognition is performed by OpenCV to obtain the pixel coordinates of the next pilot point under the current viewpoint. Then the above operation is repeated until all pilot points are established.

[0057] Since the edges of parts are usually rounded, the surface difference point is located at the edge of the plane and the chamfer. The distance between the gap points of two parts is the smallest, and the gap point is usually on the rounded corner. Combining these characteristics of surface difference points and gap points, the generated pilots are queried and compared to obtain pilots that meet the conditions. Based on the three-dimensional coordinates and normal direction of the pilots that meet the conditions, surface difference points and gap points are established.

[0058] The data in the above embodiments are merely for better understanding of the present invention and do not limit the scope of protection of the present invention in any way. The basic principles, main features, and advantages of the present invention have been shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and modifications can be made to the present invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for automatically creating surface defects and gap points of a part in CAE software, characterized in that, Includes the following steps: Step S01: Display the two parts that create the gap, and hide other irrelevant parts; Step S02: Use CAE software and batch processing commands to rotate the part to obtain the best observation angle of the current part gap; Step S03: Save the image of the part from the best viewing angle and record it as image A; Step S04: Use OpenCV to process image A, extract the pixel positions corresponding to the gaps and fit the geometric curve of the gaps to obtain the coordinates of the midpoints and normals of each gap. Step S05: At the midpoint of each gap, emit rays to the two parts to obtain the pixel coordinates on the rays; Step S06: Using a simulated mouse, generate a pilot and continuously adjust the view's perspective based on the pilot's normal. Step S07: Combine the features of surface defects and gaps to query and compare the generated pilot projects in order to select pilot projects that meet the conditions; Step S08: Based on the three-dimensional coordinates and normal directions of the selected pilot points that meet the criteria, establish surface difference points and gap points.

2. The method for automatically establishing surface defects and gaps in CAE software according to claim 1, characterized in that, Step S02 further includes: Rotate the two parts, and take a screenshot every time they are rotated to a certain angle; Each screenshot image is processed using the OpenCV program to obtain the pixel gap between the two parts; Using the total pixel length of the resulting gap as the objective function, obtain the image with the longest gap pixel length among all captured screenshots. The image with the longest gap pixel is considered the best viewing angle for the gap between the two parts.

3. The method for automatically establishing surface defects and gaps in CAE software according to claim 1, characterized in that, Step S05 further includes: Starting from the midpoint of each gap, generate two rays along its normal direction to each of the two parts; The pixel coordinates on the ray can be obtained by returning the pixel points on the ray using OpenCV.

4. The method for automatically establishing surface defects and gaps in CAE software according to claim 3, characterized in that, Step S06 includes: Based on the pixels, establish pilot points on the surface of the part; Returns the 3D coordinates and normal direction of each pilot.

5. The method for automatically establishing surface defects and gaps in CAE software according to claim 4, characterized in that, Step S06 further includes: When creating a pilot point for each pixel on each ray, adjust the view angle once after each pilot point is generated and its normal direction is obtained. This will align the viewpoint with the direction of the normal and move the coordinates of the current pilot point to the center of the screen. Save the image from the current viewpoint again; Use OpenCV to identify gaps and obtain the pixel coordinates of the next pilot point from the current viewpoint. Repeat this step until all pilot projects are established.

6. The method for automatically establishing surface defects and gaps in CAE software according to claim 2, characterized in that, The number of rotation angles is between 100 and 300, and the resolution of the screenshot is between 1000 pixels × 1000 pixels and 3000 pixels × 3000 pixels.

7. The method for automatically establishing surface defects and gaps in CAE software according to claim 1, characterized in that, In step S03, the image is saved in an environment with a resolution of 5000 pixels × 5000 pixels.

8. A method for automatically establishing surface defects and gaps in CAE software according to claim 4, characterized in that, After obtaining the 3D coordinates and normal direction of the pilot, delete the pilot.

9. A method for automatically establishing surface defects and gaps in CAE software according to claim 1, characterized in that, In step S04, 20 to 100 uniformly distributed midpoints of the gaps are interpolated on the fitted gap geometry curve, and the normal of each midpoint of the gap is solved by the fitted gap geometry curve.

10. A method for automatically establishing surface defects and gaps in CAE software according to claim 3, characterized in that, The generated two rays have a directional length of 2cm-10cm.

Citation Information

Patent Citations

  • Non-contact online inspection method for automobile body gap size

    CN103075973A

  • Assembly process geometric parameter self-adaptive measurement system and method based on computer vision

    CN111475016A