ELECTRONIC DEVICE AND METHOD FOR MEASURING OUTLINE OF OBJECT

In a method for measuring an outline of an object, the method creates vectors according to adjacent points of the outline, calculates an included angle between every two adjacent vectors, obtains sampled points in the outline and direction vectors of the sampled points, obtains reference points corresponding to the sampled points, inserts a point between each two adjacent reference points, and creates a measurement program according to the reference points and inserted points. The method further obtains measurement points of the outline of the object using the measurement program, obtains a tolerance of each measurement point and a tolerance of the outline of the object, and displays the tolerance of each measurement point using a graphic user interface.

DETAILED DESCRIPTION

All of the processes described below may be embodied in, and fully automated via, functional code modules executed by one or more general purpose electronic devices or processors. The code modules may be stored in any type of non-transitory readable medium or other storage device. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory readable medium may be a hard disk drive, a compact disc, a digital video disc, a tape drive, or other suitable storage medium.

FIG. 1is a block diagram of one embodiment of an electronic device2including an outline measurement system24. The electronic device2may be connected with an object measurement machine4through a data bus. In the embodiment, the electronic device2further includes a display device20, an input device22, a storage device23, and at least one processor25. It should be understood thatFIG. 1illustrates only one example of the electronic device2that may include more or fewer components than illustrated, or a different configuration of the various components in other embodiments. The electronic device2may be a computer, a server, or any other computing device.

The display device20may be a liquid crystal display (LCD) or a cathode ray tube (CRT) display, and the input device22may be a mouse or a keyboard used to input computer readable data. The storage device23may be a hard disk or a flash memory.

As shown inFIG. 2, the object measurement machine4may include, but is not limited to, a probe41, an object42to be measured, and a plurality of driving units (not shown inFIG. 2). The driving units may include an X-axis driving motor, a Y-axis driving motor, and an Z-axis driving motor, and may be used to control the probe41moving along an X-axis direction, a Y-axis direction, and an Z-axis direction, to measure the object42. For example, the object measurement machine4may be a three-dimensional measuring machine.

The outline measurement system24is used to automatically measure an outline of the object42, obtain a tolerance of the outline of the object, and generate a measurement report with a graphic user interface. In one embodiment, the outline measurement system24may include computerized instructions in the form of one or more programs that are executed by the at least one processor25and stored in the storage device23(or memory). A detailed description of the outline measurement system24will be given in the following paragraphs.

FIG. 3is a schematic diagram of function modules of the outline measurement system24included in the electronic device2. In one embodiment, the outline measurement system24may include one or more modules, for example, an outline obtaining module240, a point sampling module241, a measurement program creating module242, a tolerance obtaining module243, and a measurement report generating module244.

FIG. 4is a flowchart of one embodiment of a method for measuring an outline of the object42using the electronic device2. Depending on the embodiment, additional steps may be added, others removed, and the ordering of the steps may be changed.

In step S1, the outline obtaining module240obtains an outline of the object42and points of the outline from the storage device23. For example, the outline obtaining module240obtains an image of the outline of the object42and coordinates of the points of the outline from the storage device23.

In step S2, the point sampling module241creates vectors for the points according to adjacent ones of the points, calculates an included angle between every two adjacent vectors, samples points in the outline of the object42according to the included angle, and obtains sampled points in the outline of the object42and direction vectors (directions of the corresponding vector) of the sampled points. A detailed description is provided inFIG. 5.

In step S3, the measurement program creating module242obtains reference points corresponding to the sampled points by moving each sampled point with a first preset distance along a direction of the corresponding vector of each sampled point, inserts a point between two adjacent reference points when a connecting line between the two adjacent reference points is overlapping with the outline, and creates a measurement program based on the reference points and inserted points. For example, the first preset distance may be 0.1 millimeters. A detailed description is provided inFIG. 7.

In step S4, the tolerance obtaining module243obtains measurement points of the outline of the object42by controlling movements of the probe41using the measurement program. In one embodiment, each reference point in the measurement program generates a corresponding measurement point. The reference points are points need to be measured in the measurement program, and the measurement points are actually points obtained by the probe41when the measurement program is executed. Then, the tolerance obtaining module243obtains a tolerance of each measurement point by calculating a distance between each measurement point and a corresponding reference point, to obtain tolerances of all the measurement points. The tolerance obtaining module243obtains a tolerance of the outline of the object42by calculating a difference between a maximum value of the tolerances of all the measurement points (maximum tolerance) and a minimum value of the tolerances of all the measurement points (minimum tolerance). A detailed description is provided inFIG. 10.

In step S5, the measurement report generating module244draws a reference line, an upper tolerance line, and a lower tolerance line according to the reference points, connects each measurement point and the corresponding reference point in the reference line, displays the tolerance of each measurement point on the display device20, and sets connecting lines between adjacent measurement points with different colors according to the tolerance of each measurement point. A detailed description is provided inFIG. 12.

FIG. 5is a detailed flowchart of step S2inFIG. 4. Depending on the embodiment, additional steps may be added, others removed, and the ordering of the steps may be changed.

In step S20, the point sampling module241creates a vector between every two adjacent points, calculates an included angle “a” between every two adjacent vectors, and compares the included angle “a” with a first preset value “t1” (e.g., t1=5 degrees). For example, as shown inFIG. 6, “V23” represents a vector between the adjacent points “P2” and “P3”, “V34” represents a vector between the adjacent points “P3” and “P4”, and “a” represents the included angle between the two adjacent vectors “V23” and “V34”.

In step S21, the point sampling module241determines whether the included angle between two adjacent vectors is greater than the first preset value (α>t1). If the included angle between the two adjacent vectors is greater than the first preset value, step S22is executed. If the included angle between the two adjacent vectors is less than or equal to the first preset value, step S23is executed.

In step S22, the point sampling module241determines a sub-outline between two adjacent points as a curve, and obtains sampled points in the curve according to the included angle. For example, as shown inFIG. 6, if the included angle between two adjacent vectors “V23” and “V34” is greater than the first preset value, the sub-outline between the points “P3” and “P4” is determined as the curve. In one embodiment, when the included angle is bigger, the more sampled points are obtained. For example, if the included angle is greater than five degrees and is less than or equal to ten degrees, one sampled point is obtained. If the included angle is greater than ten degrees, two sampled points are obtained.

In step S23, the point sampling module241determines a sub-outline between the two adjacent points as a straight line, and obtains corresponding sampled points by moving the two adjacent points with a second preset distance toward a center position of the straight line. For example, the second preset distance is 0.2 millimeters.

In step S24, the point sampling module241obtains coordinates of the sampled points and direction vectors of the sampled points, and stores the coordinates and the direction vectors of the sampled points in a document (e.g. a text file). As shown inFIG. 6, “V4” represents the direction vector of the sampled point “P4”.

FIG. 7is a detailed flowchart of step S3inFIG. 4. Depending on the embodiment, additional steps may be added, others removed, and the ordering of the steps may be changed.

In step S30, the measurement program creating module242moves each sampled point with the first preset distance along the direction of the corresponding vector of each sampled point, and obtain a reference point corresponding to each sampled point. The reference points are used to measure the outline of the object42. The probe41does not contact the outline of the object42directly, thus, the sampled points in the outline of the object42need to be moved with the first preset distance, such that the surface of the object42is not damaged by the probe41when the outline of the object42is measured.

In step S31, the measurement program creating module242determines whether a connecting line between each two adjacent reference points is overlapping with the outline of the object42, and inserts a point between the two adjacent reference points when the connecting line is overlapping with the outline of the object42, until the connecting line is not overlapping with the outline of the object42.

For example, as shown inFIG. 8, “P2” represents a sampled point in the outline of the object42, because the sampled point “P2” is an end point of a sub-outline “P1P2”, and is also a start point of a sub-outline “P2P3”, two reference points of the sampled point “P2” are generated inFIG. 8, such as the reference points “P′1” and “P′2”. The connecting line between the reference points “P′1” and “P′2” is overlapping with the outline, thus, a point “P” is inserted between the reference points “P′1” and “P′2”. The inserted point “P” may be obtained by moving the point “P2” with a third preset distance towards a outside direction of the outline. For example, the third preset distance is 0.1 millimeters. Suppose (x1, y1) represents two-dimensional coordinates of the reference point “P′1”, (x2, y2) represents two-dimensional coordinates of the reference point “P′2”, and (x0, y0) represents two-dimensional coordinates of the inserted point “P”, thus, x1<x0<x2, and y1<y0<y2.

In step S32, the measurement program creating module242stores coordinates and direction vectors of the reference points, and coordinates of the inserted points in a document (e.g., a text file), and obtain a measurement program of the outline of the object42. An example of the measurement program is shown inFIG. 9.

FIG. 10is a detailed flowchart of step S4inFIG. 4. Depending on the embodiment, additional steps may be added, others removed, and the ordering of the steps may be changed.

In step S40, the tolerance obtaining module243measures the outline of the object42by controlling movements of the probe41using the measurement program to obtain measurement points of the outline of the object42.

In step S41, the tolerance obtaining module243obtains a tolerance “D” of each measurement point by calculating a distance between each measurement point and the corresponding reference point, and compares the tolerance “D” of each measurement point with a second preset value “t2”. For example, the second preset value is 0.01 millimeters.

In step S42, the tolerance obtaining module243determines whether the tolerance of each measurement point is greater than the second preset value (D>t2). If the tolerance of one measurement point is greater than the second preset value, step S43is executed. If the tolerance of one measurement point is less than or equal to the second preset value, step S44is executed.

In step S43, the tolerance obtaining module243determines that the tolerance of the measurement point is not within a tolerance range, and a sub-outline at the measurement point is unqualified.

In step S43, the tolerance obtaining module243determines that the tolerance of the measurement point is within the tolerance range, and the sub-outline at the measurement point is qualified. Then, the tolerance obtaining module243obtains a tolerance of the outline of the object42by calculating a difference between a maximum tolerance and minimum tolerance of the measurement points. For example, as shown inFIG. 11, “D2” represents the maximum tolerance, “D1” represent the minimum tolerance, and the tolerance of the outline of the object42is determined as “D2−D1”.

FIG. 12is a detailed flowchart of step S5inFIG. 4. Depending on the embodiment, additional steps may be added, others removed, and the ordering of the steps may be changed.

In step S50, the measurement report generating module244fits a reference line according to the reference points, and determines an upper tolerance line and a lower tolerance line according to the reference line. As shown inFIG. 13, “c0” represents the reference line, “c1” represents the maximum limit of the tolerance (the upper tolerance line), and “c2” represents the minimum limit of the tolerance (the lower tolerance line), “H1, H2, H3, and H4” represent the reference points, and “P1, P2, P3, and P4” represent the measurement points.

In step S51, the measurement report generating module244connects each measurement point and the corresponding reference point in the reference line, and displays the tolerance of each measurement point and the tolerance of the outline of the object42in a graphic user interface (refers toFIG. 14). As shown inFIG. 14, the tolerance of a measurement point “A001” is 0.003 millimeters. The maximum tolerance of all the measurement points is 0.014 millimeters, and the minimum tolerance of all the measurement points is −0.004 millimeters. Thus, the tolerance of the outline of the object42is determined as (0.014−(−0.004))=0.018 millimeters.

In step S52, the measurement report generating module244sets connecting lines of the measurement points with different colors according to the tolerances of the measurement points. In one embodiment, if the tolerance of a first measurement point is within a preset tolerance range, the measurement report generating module244determines a second measurement adjacent to the first measurement point, and sets a connecting line between the first measurement point and the second measurement point as a preset color corresponding to the preset tolerance range.

For example, as shown inFIG. 13, if the tolerance of the measurement point P1 is within a first tolerance range (e.g., [−0.005, 0.005]), the color of the connecting line “P1P2” is set as a first color (e.g., green). If the tolerance of the measurement point P3 is within a second tolerance range (e.g., [0.005, 0.010]), the color of the connecting line “P3P4” is set as a second color (e.g., yellow).

In step S52, the measurement report generating module244sets connecting lines of the measurement points with different colors according to the tolerances of the measurement points. In one embodiment, if the tolerance of a first measurement point is within a preset tolerance range, the measurement report generating module244determines a second measurement adjacent to the first measurement point, and sets a connecting line between the first measurement point and the second measurement point as a preset color corresponding to the preset tolerance range.

For example, as shown inFIG. 13, if the tolerance of the measurement point P1 is within a first tolerance range (e.g., [−0.005, 0.005]), the color of the connecting line “P1P2” is set as a first color (e.g., green). If the tolerance of the measurement point P3 is within a second tolerance range (e.g., [0.005, 0.010]), the color of the connecting line “P3P4” is set as a second color (e.g., yellow).

In other embodiments, the measurement report generating module244may set connecting lines between the measurement points and the reference points with different colors according to the tolerances of the measurement points. For example, if the tolerance of a first measurement point is within a preset tolerance range, the measurement report generating module244determines a first reference point corresponding to the first measurement point, and sets a connecting line between the first measurement point and the first reference point as a preset color corresponding to the preset tolerance range.

For example, as shown inFIG. 13, if the tolerance of the measurement point P1 is within a first tolerance range (e.g., [−0.005, 0.005]), the color of the connecting line “P1H1” is set as a first color (e.g., green). If the tolerance of the measurement point P3 is within a second tolerance range (e.g., [0.005, 0.010]), the color of the connecting line “P3H3” is set as a second color (e.g., yellow).

In other embodiments, step S52may be removed fromFIG. 12. Thus, no color is set for the connecting lines of between the adjacent measurement points and the connecting lines between the measurement points and the reference points.

In step S53, the measurement report generating module244outputs a graphic measurement report including the tolerance of each measurement point and the tolerance of the outline of the object42. An example of the graphic measurement report is shown inFIG. 14.