Vectorization and parameterization processing method of imager scanning files

Through discrete cross-section point acquisition, regression analysis and error analysis technology, the problem that the imager scanned files cannot be directly parameterized is solved, and the vectorization and parameterization processing of the imager scanned files is realized, which improves processing efficiency and accuracy, and meets high Processing requirements for precision and low-precision scan files.

CN114723913BActive Publication Date: 2024-12-03CHENGDU TOOL RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110926733.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-12
Publication Date
2024-12-03
Estimated Expiration
2041-08-12

AI Technical Summary

Technical Problem

Existing imagers cannot directly obtain parameterized results in scanning files, resulting in low processing efficiency and cannot meet the processing requirements of high-precision and low-precision scan files.

Method used

The cross-section discrete point acquisition technology, regression analysis processing technology and error analysis technology are used to determine the type of scan file, obtain coordinate points, fit voxel segments, smoothly connect the fitted voxel segments, and perform parameter extraction of the contour graph and Three-dimensional modeling realizes vectorization and parameterization processing of imager scan files.

Benefits of technology

It realizes fast and efficient vectorization and parameterization processing of STL and DXF files, and obtains parameterized results, helps designers to carry out serial designs and improves processing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723913B_ABST
    Figure CN114723913B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for vectorization and parameterization of imager scanned files. The method utilizes cross-sectional discrete point acquisition technology and regression analysis processing technology, and is combined with error analysis technology to obtain ideal vectorization and parameterization processing data. The method first determines the type of the scanned file and obtains coordinate points therefrom. Then, based on the coordinate points, voxel segments are fitted and the adjacent voxel segments after fitting are smoothly connected. Finally, parameters of the contour map are extracted and three-dimensional modeling is performed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for vectorizing and parameterizing a file scanned by an imager. Background Art

[0002] With the rapid development of measurement technology, various imagers have appeared at home and abroad for high-precision measurement of products. For example, the Alicona imager has high scanning accuracy, and the resulting STL file is very smooth when opened in 3D software.

[0003] The accuracy of the imager is expressed as 1.5+5l / 1000, where 1.5 is the base number, which is the minimum measurement accuracy; L refers to the length of the workpiece being measured, and 1.5+5L / 1000 refers to the accuracy of the instrument. Generally speaking, the highest accuracy of domestic imagers is 1.6+3L / 300, in microns.

[0004] Existing imagers all have a common problem that the files scanned by these imagers cannot directly obtain parameterized results. Therefore, we need a set of vectorization (parametric) processing techniques and methods for these scanned files in order to quickly obtain satisfactory processing results.

[0005] Furthermore, the processing software we need must be able to handle both high-precision and lower-precision scanned files well.

[0006] Due to the above reasons, the inventors have conducted in-depth research on existing image scanning and data processing methods in the hope of designing a method for vectorization and parameterization of image scanning files that can solve the above problems. Summary of the invention

[0007] In order to overcome the above-mentioned problems, the inventors have conducted intensive research and designed a method for vectorization and parameterization of imager scanned files. The method utilizes cross-sectional discrete point acquisition technology and regression analysis processing technology, and combined with error analysis technology, it can obtain ideal vectorization and parameterization processing data; wherein, firstly, the type of the scanned file is determined, and the coordinate points are obtained therefrom, and then, based on the coordinate points, voxel segments are fitted to obtain voxel segments, and the adjacent voxel segments after fitting are smoothly connected; finally, the contour map is parameter extracted and three-dimensional modeling is performed, thereby completing the present invention.

[0008] Specifically, the purpose of the present invention is to provide a method for vectorization and parameterization of imager scanned documents, the method comprising the following steps:

[0009] Step 1, determine the type of the scanned file and obtain the coordinate points from it;

[0010] Step 2, fitting to obtain voxel segments according to the coordinate points;

[0011] Step 3, smoothly connect the adjacent voxel segments after fitting;

[0012] Step 4: Extract parameters of the contour map and perform three-dimensional modeling.

[0013] Among them, in step 1, when the scan file is an STL file, the process of obtaining the coordinate points includes the following sub-steps:

[0014] Sub-step 1-1, read the coordinate information of all its small planes,

[0015] Sub-step 1-2: input and obtain profile information data,

[0016] Sub-step 1-3, obtaining valid intersection points where the facet intersects the cross section;

[0017] Sub-steps 1-4, arrange the valid intersection points in order to obtain the coordinate points.

[0018] Wherein, in sub-step 1-1, when the STL file is in ASCII format,

[0019] The process of obtaining the coordinate information of the small plane is:

[0020] Sub-step 1-1-1, read each line of string in the STL file,

[0021] Sub-step 1-1-2, for the character string beginning with "facet", retrieve and record the three components separated by spaces after "facet" in the character string as the three normal vector component values;

[0022] For the string beginning with "vertex", retrieve and record the nine components separated by spaces after "vertex" in the string as the nine coordinate component values;

[0023] Sub-step 1-1-3, traverses each line of the character string, and obtains the normal vector and three corner point coordinates of each "small plane", a total of four data, which are the coordinate information of the small plane.

[0024] Wherein, in sub-step 1-1, when the STL file is in Binary format, the process of obtaining the coordinate information of the small plane is:

[0025] Sub-step 1-1-a, obtaining the Binary Reader variable br information from the binary STL file;

[0026] Sub-step 1-1-b, use the br.ReadInt32() function to obtain the number of "small planes" in the binary STL file,

[0027] Sub-step 1-1-c, use the br.ReadSingle() function to obtain the three normal vectors and nine coordinates of the three corner points of each "small plane", and then use br.ReadInt16() to obtain a value that is independent of the coordinates.

[0028] Sub-step 1-1-d, repeat sub-step 1-1-c until each "small plane" is traversed to obtain the three normal vectors and nine coordinates of the three corner points of all the "small planes".

[0029] Wherein, in sub-step 1-2, the cross section is selected from one or more of the following surfaces:

[0030] Mid-section of the blade in the thickness direction;

[0031] It can be a surface passing through the blade tip and forming a certain angle with the long side direction of the blade, and the certain angle can be -30 to 30 degrees; and

[0032] A plane perpendicular to a preset line, wherein the preset line passes through the blade tip and is parallel to the long side direction of the blade.

[0033] Among them, in sub-steps 1-3, the tool tip point is obtained from all the small plane coordinate points, and the process of obtaining the tool tip point is:

[0034] Sub-step 1-3-1, obtain the minimum value Xmin, Ymin, Zmin and the maximum value Xmax, Ymax, Zmax of the X, Y, and Z coordinates from all small plane coordinate points respectively;

[0035] Sub-step 1-3-2, find the point with the smallest Y coordinate value among all points that satisfy the condition Z=Zmax. This point is the tool tip point.

[0036] Among them, in sub-steps 1-3, the intersection points of each edge of the "small plane" and each section are solved, and then the valid intersection points are selected.

[0037] Wherein, in the step 2, during the fitting process, the straight line, circular arc or multiple curves are fitted respectively, the distance error value between the discrete points of the segment and the fitting curve is calculated, and the maximum value thereof is taken as the judgment value.

[0038] Wherein, in said step 2,

[0039] When the voxel segment is a straight line segment, the fitting error is calculated, and the end point of the straight line corresponding to the fitting error is displayed. Observe whether it reaches the end point of the straight line segment. If not, increase the error and continue to observe. If exceeded, reduce the error. If reached, proceed to the next step.

[0040] When the voxel segment is an arc segment, the fixed error is 0.001, and the end point of the arc is displayed;

[0041] When the upper segment is an arc and this segment is a straight line, calculate the end angle of the intersection or foot point of the upper arc and this straight line, draw the arc, connect the foot of the perpendicular to the end point of the arc, and connect the foot of the perpendicular or the effective intersection point to the midpoint of the straight line;

[0042] When the upper segment is a straight line and this segment is also a straight line, the intersection of the two straight lines is calculated and connected to the midpoints of the two straight lines respectively;

[0043] When the upper segment is a straight line and this segment is an arc, the arc starting angle is calculated by connecting the midpoint of the straight line with the effective intersection point or the foot of the perpendicular;

[0044] When the upper segment is an arc and this segment is also an arc, draw the upper arc and connect the end point of the upper arc with the starting point of this arc.

[0045] Among them, in step 3, between the straight line and the adjacent arc, the arc segment and the straight line segment are directly connected at the nearest point, that is, a perpendicular line is drawn from the center of the circle to the straight line, and the arc is connected to the foot point of the perpendicular.

[0046] The method for vectorization and parameterization of imager scanned files provided by the present invention can quickly and efficiently perform vectorization and parameterization on the STL file or DXF file obtained by the imager to obtain a parameterized result;

[0047] Among them, the STL format is a slice format file, which is generally used to input a 3D printer to directly quickly form a solid model. It is more commonly used in industrial design. The STL format file is composed of a large number of triangular facets, and the contour parameters cannot be directly obtained. The DXF file is a raster graphic composed of a large number of points. When opened with AutoCAD software, it can be seen that its graphics are just a series of point cloud information, and the contour parameters cannot be directly obtained; the imager scanning file vectorization and parameterization processing method provided by the present invention can be specially processed for the coordinate information of the STL file and the point cloud information of the DXF file, so as to process it into an image composed of a series of regular straight lines and arcs parameterized entities, and the position and shape parameters of these straight lines and arcs can be obtained, so that they can be edited to obtain the results after changing the parameters, helping designers to carry out serialized design and expand the original single graphic into a parametric design graphic with multiple results. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 The overall structure logic diagram of the method for vectorization and parameterization of imager scanned documents according to a preferred embodiment of the present invention is shown;

[0049] Figure 2 An STL file operation interface according to a preferred embodiment of the present invention is shown;

[0050] Figure 3The operation interface when the end point of the straight line segment processed by the display screen is nzz=307 according to a preferred embodiment of the present invention is shown;

[0051] Figure 4 The operating interface when the display screen displays a prompt for modifying the error judgment value according to a preferred embodiment of the present invention is shown;

[0052] Figure 5 The operation interface when the end point of the straight line segment processed by the display screen is nzz=318 according to a preferred embodiment of the present invention is shown;

[0053] Figure 6 The operation interface when the end point of the straight line segment processed by the display screen is nzz=345 according to a preferred embodiment of the present invention is shown;

[0054] Figure 7 A comparison diagram showing the overlap between the contour discrete points of the original scanned file and the parameterized discrete points in an embodiment of the present invention;

[0055] Figure 8 Show Figure 7 A partial enlarged view of . DETAILED DESCRIPTION

[0056] The present invention will be further described in detail below through the accompanying drawings and embodiments. Through these descriptions, the characteristics and advantages of the present invention will become more clear and distinct.

[0057] The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise noted.

[0058] According to the method for vectorization and parameterization of imager scanned files provided by the present invention, Figure 1 As shown in , the method comprises the following steps:

[0059] Step 1, determine the type of the scanned file and obtain the coordinate points from it;

[0060] The file formats generated by various imagers are different. For example, the file scanned by Alicona (Beijing Audlino Instrument Co., Ltd.) is a standard shell STL file, while the file scanned by the LUX 300C fully automatic measurement system of IMS Company in the UK is a standard DXF file.

[0061] DXF files can be converted to IGS format files using UG software.

[0062] 3D imager scan files (.igs) are standard format files consisting of a series of discrete points, as shown below:

[0063]

[0064] In the line starting with 106, 6063 means there are 6063 discrete points, followed by the three-dimensional coordinate lines of each discrete point. The values ​​of these coordinate points can be obtained by computer program processing.

[0065] If it is an IGS file converted from a DXF file, find row i (i=1,2,3,.....) whose first 5 characters are "116," and the number before the first "," is the X coordinate of the ith point, and the number before the second "," is the Y coordinate of the ith point. Continue searching in this way until the end of the IGS file. In this way, the coordinates of all points are obtained.

[0066] If it is a cross-section IGS file directly obtained by an image scanner (such as Alicona), the 14th line is "106, 2, n," where n is the number of coordinate points to be obtained, and then the 3 coordinates of n points are obtained in this way (separated by ", "). The order of coordinates is related to the placement of the scanned object. If the cross-section consists of multiple unconnected segments, the n+1 line is "106, 2, n1," where n1 is the number of coordinate points to be obtained, and then the 3 coordinates of n1 points are obtained in this way (separated by ", "), and so on, until all separated sections of the cross-section are processed.

[0067] The STL file describes the original unstructured triangular mesh, including surface unit normals and vertices ordered by the right-hand rule; preferably, the STL file records the three-dimensional structure information in the form of multiple triangular planes; multiple triangular planes constitute a closed three-dimensional image, and any edge of each triangular plane coincides with the edge of other triangular planes. The triangular plane is also called a facet, and in the STL file, the coordinate information of the facet is stored in the form of "facet normal vector data" and "triangular facet corner point coordinate data".

[0068] When the scan file is an STL file, the process of reading coordinate points includes the following sub-steps:

[0069] Sub-step 1-1, read the coordinate information of all its small planes,

[0070] Sub-step 1-2: input and obtain profile information data through human-computer dialogue.

[0071] Sub-step 1-3, obtaining valid intersection points where the facet intersects the cross section;

[0072] Sub-steps 1-4, arrange the valid intersection points in order to obtain the coordinate points.

[0073] Preferably, in sub-step 1-1, when the STL file is in ASCII format,

[0074] The process of obtaining the coordinate information of the small plane is:

[0075] Sub-step 1-1-1, read each line of string in the STL file,

[0076] Sub-step 1-1-2, if the line of character string begins with "facet", it means that the line is "small face normal vector data", and for the character string beginning with "facet", retrieve and record the three components separated by spaces after "facet" in the line of character string as the three normal vector component values ​​of the "small face";

[0077] If the line of character string begins with "vertex", it means that the line is "triangular facet corner point coordinate data". For the character string beginning with "vertex", the nine components separated by spaces after "vertex" in the line of character string are retrieved and recorded as the nine coordinate component values ​​of the corner points of the "facet". Among the nine coordinate component values, the first three coordinate component values ​​constitute the three-dimensional coordinates of the first point of the facet, the middle three coordinate component values ​​constitute the three-dimensional coordinates of the second point of the facet, and the last three coordinate component values ​​constitute the three-dimensional coordinates of the third point of the facet.

[0078] Sub-step 1-1-3, traverse each line of the character string. After the three normal vector component values ​​of each "small plane" and the nine coordinate component values ​​of each "small plane" corner point are obtained, the four data of each "small plane" (normal vector and three corner point coordinates) are obtained, which is the coordinate information of the small plane.

[0079] In sub-step 1-1, when the STL file is in Binary format, that is, a binary STL file, a Binary Reader is used to extract the coordinate points; the process of obtaining the coordinate information of the small plane is as follows:

[0080] Sub-step 1-1-a, obtaining the Binary Reader variable br information from the binary STL file;

[0081] Sub-step 1-1-b, use the br.ReadInt32() function to obtain the number of "small planes" in the binary STL file,

[0082] Sub-step 1-1-c, use br.ReadSingle() function to obtain the three normal vectors and nine coordinates of the three corner points of each "small plane", and then use br.ReadInt16() to obtain the attribute information data of a triangle that is independent of the coordinates; this information data occupies 2 bytes. Although the attribute information data of the triangle that is independent of the coordinates has no effect on the processing program, it needs to be read and obtained for the needs of the program loop, and is not assigned to any variable, otherwise the information read in the next binary file br will no longer be the actual required coordinate-related data.

[0083] Sub-step 1-1-d, repeat sub-step 1-1-c until each "small plane" is traversed to obtain the three normal vectors of all the "small planes" and the nine coordinate values ​​of the three corner points.

[0084] Preferably, in sub-step 1-2, the cross-sectional information data can be set according to the type and structure of the scanned device; for example, when the scanned device is an indexable insert, Figure 2 As described in, the section can be a mid-section in the thickness direction of the blade, that is, a section perpendicular to the thickness direction of the blade and located in the middle of the blade; it can be a surface passing through the blade tip and forming a certain angle with the long side direction of the blade, and the certain angle can be -30 to 30 degrees, which is input through human-computer interaction; it can also be a surface perpendicular to the long side direction of the blade parallel to the blade tip, in which case the distance between the section and the blade tip is input through human-computer interaction.

[0085] Preferably, in sub-steps 1-3, the tool tip point is first obtained from all the small plane coordinate points, and then the valid intersection point is obtained based on the obtained tool tip point;

[0086] Specifically, the process of obtaining the tool tip point is:

[0087] Sub-step 1-3-1, obtain the minimum value Xmin, Ymin, Zmin and the maximum value Xmax, Ymax, Zmax of the X, Y, and Z coordinates from all small plane coordinate points respectively;

[0088] Sub-step 1-3-2, find the point with the smallest Y coordinate value among all points that satisfy the condition Z=Zmax, and this point is the tool tip point; the X coordinate of the tool tip point is djx, the Y coordinate is djy, and the Z coordinate is djz.

[0089] In sub-steps 1-3, the intersection points of each edge of the "small plane" with each section are solved, and then valid intersection points are selected;

[0090] Specifically, each "small face" is a triangle, and the intersection points of each side of the triangle and each section are calculated separately. p1(x1, y1, z1), p2(x2, y2, z2), and p3(x3, y3, z3) are the three vertices of the triangular face.

[0091] The coordinates of the intersection of the straight line p1p2 and the mid-section in the thickness direction of the blade are: (x1+(y0-y1)*(x2-x1) / (y2-y1), y0, z1+(y0-y1)*(z2-z1) / (y2-y1))

[0092] The coordinates of the intersection of the straight line p1p2 and the surface passing through the blade tip and forming a certain angle with the long side direction of the blade are (jdx, jdy, jdz), where:

[0093] jdz=((x2-x1)*z1 / (z2-z1)+djx-x1+Math.Tan(Math.PI*pmjd / 180.0)*djz) / (Math.Tan(Math.PI*pmjd / 180.0)+(x2-x1) / (z2-z1)); Math.PI in this formula represents pi, and its value is a double-precision number of 3.141592653589793.

[0094] jdx=djx-Math.Tan(Math.PI*pmjd / 180.0)*(jdz-djz);

[0095] jdy=y1+(y2-y1)*(jdz-z1) / (z2-z1);

[0096] The coordinates of the intersection of the straight line p1p2 and the plane perpendicular to the long side of the blade through the cutting edge are (jdx, jdy, jdz), where:

[0097] jdx=x1+(z0-z1)*(x2-x1) / (z2-z1)

[0098] jdz=z0

[0099] jdy=y1+(z0-z1)*(y2-y1) / (z2-z1);

[0100] The z0=djz–pmjl;

[0101] In the present application, in the mid-section of the blade in the thickness direction, the Y coordinate value is the middle value between the maximum value Ymax and the minimum value Ymin, that is, y0=(Ymax+Ymin) / 2, and the plane is perpendicular to the Y axis.

[0102] The angle that needs to be entered in the plane that passes through the tip of the blade and forms a certain angle with the long side of the blade is the section angle, which is pmjd;

[0103] The distance between the section and the cutting edge to be entered in the plane perpendicular to the long side of the blade and passing through the cutting edge is pmjl.

[0104] Preferably, when the distance between the intersection point (jdx, jdy, jdz) and p1 (dd1) and p2 (dd2) is less than or equal to the length of the straight line p1p2, the intersection point is a valid intersection point;

[0105] Based on the same method as above, the coordinates of the intersections of the straight lines p2p3, p1p3 and each cross section can be obtained respectively, and the effective intersections can be obtained.

[0106] Finally, the same repeated points are removed to obtain the valid intersection points of the small plane and the cross section described in sub-steps 1-3.

[0107] Preferably, in sub-steps 1-4, the process of arranging the valid intersection points in order comprises the following steps:

[0108] Sub-step 1-4-1, take any point i (i=1, 2, ...yxjds-1) among the valid intersection points as the starting point, and then take another point (i+1) after the starting point, and calculate the distance between the two points;

[0109] Sub-step 1-4-2, sequentially search for each valid intersection point j (j=i+1, i+2, ...yxjds) after the starting point, and find the point dhxl[i] closest to the starting point i; where yxjds represents the number of valid intersection points, that is, the total number of intersection points on all small planes intersecting with the cutting plane, and yxjds-1 represents the number of valid intersection points minus one; exchange the position of another point (i+1) after the starting point with the closest point dhxl[i];

[0110] Sub-step 1-4-3, repeat sub-step 1-4-1 and sub-step 1-4-2, ensure that all valid intersections are traversed in sub-step 1-4-1, and sub-step 1-4-2 traverses all valid intersections after the valid intersection selected in 1-4-1. The new valid intersections obtained after the exchange of positions are arranged in order, which are the coordinate points.

[0111] Step 2, fitting to obtain voxel segments according to the coordinate points;

[0112] In step 2, the voxel segment includes a straight line, an arc and a multiple curve. During the fitting process, the straight line, arc or multiple curve is fitted respectively, and the distance error value between the discrete points of the segment and the fitting curve is calculated, and the maximum value is taken as the judgment value.

[0113] Preferably, when the voxel segment is a straight line segment, the fitting error is calculated, and the straight line endpoint corresponding to the fitting error is displayed on the screen. Observe whether the straight line segment endpoint is reached. If not, increase the error and continue to observe. If exceeded, reduce the error. If reached, execute the next step.

[0114] Specifically, a point number is marked with a dot, and the point number is a point where the maximum value of the distance error between each discrete point of the voxel segment and the fitting curve is close to the judgment value, and is displayed, preferably on a display screen, such as Figure 3 As shown in ; further extending the fitted line segment according to the judgment result, or completing the fitting of the line segment;

[0115] Specifically, when the end point of the straight line segment being displayed is nzz=307, Figure 3 As shown in , the error judgment value is wcpdz = 0.001. After judging that the end point of the straight line segment has not been reached, the following is given: Figure 4 The error judgment value shown in is used as a modification prompt, on this basis, the error judgment value can be further increased or the fitting of the line segment can be completed.

[0116] like Figure 4 As shown in , if the selection is correct, that is, if "Yes" is selected, the error judgment value is increased to further obtain a new fitting result, such as Figure 5 As shown in Figure 5 The end point of the straight line segment is shown as nzz=318, and the error judgment value is wcpdz=0.002. Obviously, the end point of the straight line segment has not been reached yet, so we choose to continue to increase the error judgment value. The end point of the straight line segment is shown as nzz=345 again, and the error judgment value is wcpdz=0.003. When the fitting result has reached the end point of the execution segment, the fitting is terminated. Specifically, Figure 6 As shown in , the observation has reached the end point of the straight line segment. At this time, the straight line fitting operation can be completed by confirmation.

[0117] In the above selection and judgment process, when the straight line segment range has been exceeded, the straight line segment endpoint can be retracted. Specifically, the error judgment value can be reduced by selecting the "No" button to retract the straight line segment endpoint.

[0118] In a preferred embodiment, in step 2, during the fitting process, when the voxel segment is an arc segment, the fixed error is 0.001, and the end point of the arc is displayed;

[0119] Further preferably, if the upper segment is an arc and this segment is a straight line, the termination angle of the intersection or foot point of the upper segment arc and this segment straight line is calculated, the arc is drawn, the foot of the perpendicular is connected with the end point of the arc, and the foot of the perpendicular or the effective intersection is connected to the midpoint of the straight line;

[0120] If the previous segment is a straight line and this segment is also a straight line, calculate the intersection of the two straight lines and connect the intersection to the midpoints of the two straight lines respectively;

[0121] If the previous segment is a straight line and this segment is an arc, calculate the arc starting angle and connect the midpoint of the straight line with the effective intersection point or foot of the perpendicular;

[0122] If the upper segment is an arc and this segment is also an arc, draw the upper arc and connect the end point of the upper arc with the starting point of this arc.

[0123] When a straight line segment is too short and the midpoint of the straight line is outside the intersection of the straight line and the arc, the straight line segment is replaced by an arc.

[0124] When three arc segments are connected, the first segment is connected to the left end straight line at the intersection point or the foot point of the straight line, the arc segments are connected by the end point number position of the previous arc and the starting point number position of the next arc, and the last segment is connected to the right end straight line at the intersection point or the foot point of the straight line.

[0125] Step 3, smoothly connect the adjacent voxel segments after fitting;

[0126] There are many connection methods. In the present application, preferably, within the controllable error range, such as between a straight line and an adjacent arc, the arc segment and the straight line segment are directly connected at the nearest point, that is, a perpendicular line is drawn from the center of the circle to the straight line, and the arc is connected to the foot point of the perpendicular.

[0127] In the present application, a smooth connection is achieved by the above method, and its error is in the micron level, which is within the controllable range of accuracy; preferably, the arc radius can also be modified, or the arc center can be moved to make the arc directly tangent to the straight line, and this method is also within the controllable error range.

[0128] Step 4: Extract parameters of the contour map and perform three-dimensional modeling.

[0129] By extracting the contour parameters after vectorization and performing 3D modeling, the effect of vectorization processing can be seen;

[0130] The parameter extraction process includes the following sub-steps:

[0131] Sub-step 4-1, constructing a contour graphic file, saving the starting point and end point coordinates of all straight line contours; saving the arc center X coordinate, arc center Y coordinate, arc radius, arc start angle and arc end angle of the arc contour;

[0132] Sub-step 4-2, reading a contour graphic information file in the acquired file for processing, preferably, the contour graphic information file is a lkt.txt file;

[0133] Sub-step 4-3, calculates the required parameter information according to the position coordinates and orientation information of each contour.

[0134] In a preferred embodiment, before executing step 2, a search is performed in the overall contour of the scan to find all valid intersections, and after selection, the valid intersections within the selected range are determined as processing objects; in subsequent steps 2, 3 and 4, only the selected contour is processed, thereby improving work efficiency and avoiding time waste while ensuring that the desired part structure is obtained.

[0135] Example:

[0136] The blade was scanned by an imager from Alicona (Beijing Audlino Instrument Co., Ltd.) to obtain an STL file in ASCII format, which was processed by the following method:

[0137] Step 1, obtaining coordinate points from the file, specifically includes the following sub-steps:

[0138] Sub-step 1-1, read the coordinate information of all its small planes,

[0139] Sub-step 1-2: input and obtain profile information data through human-computer dialogue.

[0140] Sub-step 1-3, obtaining valid intersection points where the facet intersects the cross section;

[0141] Sub-steps 1-4, arranging the valid intersection points in order, that is, obtaining the coordinate points;

[0142] The process of obtaining the coordinate information of the small plane is as follows:

[0143] Sub-step 1-1-1, get the string of each line of the STL file,

[0144] Sub-step 1-1-2, for the string beginning with "facet", retrieve the three components separated by spaces that follow the record as the three normal vector component values ​​of the "facet";

[0145] For the string beginning with "vertex", retrieve and record the nine components separated by spaces as the nine coordinate component values ​​of the "corner point of the triangle facet";

[0146] Sub-step 1-1-3, traverses each line of the character string, and obtains the normal vector and three corner point coordinates of each "small plane", a total of four data, which are the coordinate information of the small plane.

[0147] Wherein, in sub-step 1-2, the cross section includes:

[0148] Mid-section of the blade in the thickness direction;

[0149] It can be a surface passing through the blade tip and forming a certain angle with the long side direction of the blade, and the certain angle can be -30 to 30 degrees; and

[0150] The plane perpendicular to the direction parallel to the long side of the blade passing through the cutting edge.

[0151] Among them, in sub-steps 1-3, the intersection points of each edge of the "small plane" and each section are solved, and then the valid intersection points are selected.

[0152] The process of arranging the valid intersection points in order includes the following steps:

[0153] Sub-step 1-4-1, take any point i (i=1, 2, ...yxjds-1) among the valid intersection points as the starting point, and then take another point (i+1) after the starting point, and calculate the distance between the two points;

[0154] Sub-step 1-4-2, search for each valid intersection point j (j=i+1, i+2, ...yxjds) after the starting point in turn, and find the point dhxl[i] closest to the starting point i; wherein; exchange the position of another point (i+1) after the starting point with the nearest point dhxl[i].

[0155] Step 2, fitting to obtain voxel segments according to the coordinate points;

[0156] Among them, when the voxel segment is a straight line segment, the fitting error is calculated, and the straight line endpoint corresponding to the fitting error is displayed. It is observed whether it reaches the end point of the straight line segment. If not, the error is increased and the observation is continued. If it exceeds, the error is reduced. If it has reached, the next step is executed;

[0157] When the voxel segment is an arc segment, the fixed error is 0.001, and the end point of the arc is displayed;

[0158] When the upper segment is an arc and this segment is a straight line, calculate the end angle of the intersection or foot point of the upper arc and this straight line, draw the arc, connect the foot of the perpendicular to the end point of the arc, and connect the foot of the perpendicular or the effective intersection point to the midpoint of the straight line;

[0159] When the upper segment is a straight line and this segment is also a straight line, the intersection of the two straight lines is calculated and connected to the midpoints of the two straight lines respectively;

[0160] When the upper segment is a straight line and this segment is an arc, the arc starting angle is calculated by connecting the midpoint of the straight line with the effective intersection point or the foot of the perpendicular;

[0161] When the upper segment is an arc and this segment is also an arc, draw the upper arc and connect the end point of the upper arc with the starting point of this arc.

[0162] Step 3, smoothly connect the adjacent voxel segments after fitting;

[0163] Between a straight line and an adjacent arc, directly connect the arc segment and the straight line segment at the nearest point, that is, draw a perpendicular line from the center of the circle to the straight line, and connect the arc to the foot point of the perpendicular.

[0164] Step 4: Extract parameters of the contour map and perform three-dimensional modeling.

[0165] The parameter extraction process includes the following sub-steps:

[0166] Sub-step 4-1, constructing a contour graphic file, saving the starting point and end point coordinates of all straight line contours; saving the arc center X coordinate, arc center Y coordinate, arc radius, arc start angle and arc end angle of the arc contour;

[0167] Sub-step 4-2, reading the contour graphic information file in the acquisition file for processing;

[0168] Sub-step 4-3, calculates the required parameter information according to the position coordinates and orientation information of each contour.

[0169] The parametric data obtained by the above method is compared with the original STL file by opening it in AutoCAD. Figure 7 and Figure 8 As shown in

[0170] Figure 7 and Figure 8 In the figure, the black lines are the lines connecting the discrete points of the original scan file, that is, the unprocessed STL file image, and the red lines are the lines connecting the points processed by the above method. The error between the two is very small from a macroscopic perspective.

[0171] The error at each discrete point is calculated as follows:

[0172] The error on the straight line segment is the absolute value of the distance between the discrete points of the contour of the original scan file and the nearest point of the straight line obtained by the above method.

[0173] The error on the arc segment is the absolute value of the distance between the discrete points of the contour of the original scan file and the arc obtained by the above method in the radial direction passing through the center of the circle.

[0174] The error analysis data formed is:

[0175] The first segment is a straight line!

[0176] The error at point 1354 is -0.000620646647240072

[0177] The error at point 1355 is -0.000519885293736559

[0178] The error at point 1356 is -0.000977505028245517 ......

[0180] The global maximum error is 0.00981036168342196, and the point position is 2042

[0181] The global minimum error is -0.00443363076355958, and the point position is 2108

[0182] The global average error is 2.39426712794702E-06!

[0183] From the error analysis data, it can be seen that the error is at the micron level, with the global maximum being 0.0098 and the global minimum being -0.0044.

[0184] From the above results, it can be seen that the parameterization results obtained by the imager scanning file vectorization and parameterization processing method provided in this application are extremely accurate and reliable.

[0185] The present invention has been described above in conjunction with preferred embodiments, but these embodiments are only exemplary and serve only as an illustration. On this basis, the present invention may be subjected to a variety of substitutions and improvements, all of which fall within the scope of protection of the present invention.

Claims

1. A method for vectorization and parameterization of imager scanned documents, characterized in that: The method comprises the following steps: Step 1, determine the type of the scanned file and obtain the coordinate points from it; Step 2, fitting to obtain voxel segments according to the coordinate points; Step 3, smoothly connect the adjacent voxel segments after fitting; Step 4, extract parameters of the contour map and perform three-dimensional modeling; In step 1, when the scan file is an STL file, the process of obtaining coordinate points includes the following sub-steps: Sub-step 1-1, read the coordinate information of all its small planes, Sub-step 1-2: input and obtain profile information data, Sub-step 1-3, obtaining valid intersection points where the facet intersects the cross section; Sub-steps 1-4, arranging the valid intersection points in order, that is, obtaining the coordinate points; In sub-step 1-2, the cross section is selected from one or more of the following surfaces: Mid-section of the blade in the thickness direction; A surface passing through the blade tip that forms an angle of -30 to 30 degrees with the long side of the blade; and A plane perpendicular to a preset line, the preset line passing through the blade tip and parallel to the long side of the blade; In sub-steps 1-3, tool tip points are obtained from all small plane coordinate points. The process of obtaining tool tip points is as follows: Sub-step 1-3-1, obtain the minimum value Xmin, Ymin, Zmin and the maximum value Xmax, Ymax, Zmax of the X, Y, and Z coordinates from all small plane coordinate points respectively; Sub-step 1-3-2, find the point with the smallest Y coordinate value among all points that satisfy the condition Z=Zmax, and this point is the tool tip point; In sub-steps 1-3, the intersection points of each edge of the "small plane" with each section are solved, and then valid intersection points are selected; In sub-steps 1-4, the process of arranging the valid intersection points in order includes the following steps: Sub-step 1-4-1, take any point i among the valid intersection points as the starting point, i=1,2,...yxj ds-1, then take another point i+1 after the starting point, and calculate the distance between the two points; Sub-step 1-4-2, sequentially search for each valid intersection point j after the starting point, j = i+1, i+2, ... yxjds, and find the point dhxl[i] closest to the starting point i; where yxjds represents the number of valid intersection points, that is, the total number of intersection points on all small planes intersecting with the cutting plane, and yxjds-1 represents the number of valid intersection points minus one; exchange the position of another point i+1 after the starting point with the closest point dhxl[i]; Sub-step 1-4-3, repeating sub-step 1-4-1 and sub-step 1-4-2, ensuring that all valid intersections are traversed in sub-step 1-4-1, and sub-step 1-4-2 traverses all valid intersections after the valid intersection selected in 1-4-1, and the new valid intersections obtained after the exchange of positions are arranged in order, namely the coordinate points; In step 2, during the fitting process, the straight line, circular arc or multiple curves are fitted respectively, and the distance error value between the discrete points of the segment and the fitting curve is calculated, and the maximum value is taken as the judgment value.

2. The method for vectorization and parameterization of imager scanned files according to claim 1, characterized in that: In sub-step 1-1, when the STL file is in ASCII format, The process of obtaining the coordinate information of the small plane is: Sub-step 1-1-1, read each line of string in the STL file, Sub-step 1-1-2, for the string beginning with "facet", retrieve and record the three components separated by spaces after "facet" in the string as the three normal vector component values; For the string beginning with "vertex", retrieve and record the nine components separated by spaces after "vertex" in the string as the nine coordinate component values; Sub-step 1-1-3, traverses each line of the string, and obtains the normal vector and three corner point coordinates of each "small plane", a total of four data, which are the coordinate information of the small plane.

3. The method for vectorization and parameterization of imager scanned files according to claim 1, characterized in that: In sub-step 1-1, when the STL file is in Binary format, the process of obtaining the coordinate information of the small plane is: Sub-step 1-1-a, obtaining the Binary Reader variable br information from the binary STL file; Sub-step 1-1-b, use br.ReadI nt32() function to get the number of "small planes" in the binary STL file, Sub-step 1-1-c, use br.ReadSingle() function to obtain the three normal vectors and nine coordinates of the three corner points of each "small plane", and then use br.ReadInt16() to obtain a value that is independent of the coordinates. Sub-step 1-1-d, repeat sub-step 1-1-c until each "small plane" is traversed to obtain the three normal vectors and nine coordinates of the three corner points of all the "small planes".

4. The method for vectorization and parameterization of imager scanned documents according to claim 1, characterized in that: In step 2, When the voxel segment is a straight line segment, the fitting error is calculated, and the end point of the straight line corresponding to the fitting error is displayed. Observe whether it reaches the end point of the straight line segment. If not, increase the error and continue to observe. If exceeded, reduce the error. If reached, proceed to the next step. When the voxel segment is an arc segment, the fixed error is 0.001, and the end point of the arc is displayed; When the upper segment is an arc and this segment is a straight line, calculate the end angle of the intersection or foot point of the upper arc and this straight line, draw the arc, connect the foot of the perpendicular to the end point of the arc, and connect the foot of the perpendicular or the effective intersection point to the midpoint of the straight line; When the upper segment is a straight line and this segment is also a straight line, the intersection of the two straight lines is calculated and connected to the midpoints of the two straight lines respectively; When the upper segment is a straight line and this segment is an arc, the arc starting angle is calculated by connecting the midpoint of the straight line with the effective intersection point or the foot of the perpendicular; When the upper segment is an arc and this segment is also an arc, draw the upper arc and connect the end point of the upper arc with the starting point of this arc.

5. The method for vectorization and parameterization of imager scanned documents according to claim 1, characterized in that: In step 3, between the straight line and the adjacent arc, directly connect the arc segment and the straight line segment at the nearest point, that is, draw a perpendicular line from the center of the circle to the straight line, and connect the arc to the foot point of the perpendicular.