3D model programming method and device based on image measuring instrument, image measuring instrument and storage medium
By directly obtaining and arranging the solid objects of the 3D model in the image measuring instrument, generating light source parameters and scanning paths, the time-consuming and labor-intensive problem of converting the DXF format in the prior art is solved, and efficient 3D model programming is achieved.
Patent Information
- Application Number
- CN202410990434.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Existing two-dimensional measurement devices require converting 3D models to DXF format drawings, making them time-consuming and labor-intensive, difficult for users to operate, and require additional learning.
By obtaining the solid objects in the 3D model of the workpiece to be measured, arranging the solid objects according to the first coordinate axis coordinates, the light source parameters and scanning path of each solid layer are generated, and they are directly programmed in the image measuring instrument without converting to DXF format.
Improve programming efficiency, simplify operational processes, avoid the steps of converting 3D models to DXF format, and reduce user learning costs.
Smart Images

Figure CN118602950B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image scanning technology, and in particular to a 3D model programming method and device based on an image measuring instrument, an image measuring instrument, and a storage medium. Background Art
[0002] Two-dimensional measuring equipment, also known as two-dimensional image measuring instrument, is a measuring equipment based on computer vision technology. It can present a two-dimensional image of the object being measured on the computer screen and perform measurement and calculation through software.
[0003] Currently, two-dimensional measurement equipment has always used the method of importing Drawing Exchange Format (DXF) files to quickly write measurement programs, but now basically 3D design software is used to draw product models, which means that after drawing the 3D model, the 3D model needs to be converted into a DXF format drawing.
[0004] Converting 3D models into dxf format drawings is not only time-consuming and laborious, but many users don’t even know how to convert 3D models into dxf format drawings, and have to spend extra time learning. Summary of the Invention
[0005] In response to the shortcomings of the existing technology, the present application provides a 3D model programming method, device, image measuring instrument and storage medium based on an image measuring instrument, which is conducive to importing 3D models into the program of the image measuring instrument for programming, without the need to convert the 3D model into a DXF format file.
[0006] In order to solve the above problems, the present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a 3D model programming method based on an image measuring instrument, the method comprising:
[0008] Acquire all entity objects in the 3D model of the workpiece to be measured;
[0009] Arrange all the physical objects according to the first coordinate axis coordinates of the physical objects; wherein the first coordinate axis coordinates are used to determine the distance between the image acquisition device of the image measuring instrument and the workpiece to be measured placed on the image measuring instrument during measurement;
[0010] Determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer, so as to obtain a plurality of entity layers;
[0011] Get the light source parameters and scanning path of each entity layer;
[0012] A measurement program for each physical layer is generated according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is used to control the image measuring instrument to scan the workpiece to be measured.
[0013] In some embodiments, determining the entity objects having the same first coordinate axis coordinate as the same entity layer to obtain multiple entity layers includes:
[0014] Determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer;
[0015] For all entity objects on the same entity layer, a canvas including all entity objects is constructed to obtain the multiple entity layers.
[0016] In some embodiments, the method further comprises:
[0017] Select one of the multiple physical layers as a reference layer to construct a reference coordinate system;
[0018] Determine the coordinates of all physical objects in the reference layer in the reference coordinate system;
[0019] The physical layers other than the reference layer are regarded as non-reference layers, and the coordinates of all physical objects in the non-reference layers in the reference coordinate system are determined.
[0020] In some embodiments, the method further comprises:
[0021] Based on the coordinates of all the physical objects in the reference coordinate system, determining one by one whether there is a physical object with the same coordinates of the points in the point set but in a different order for each physical object; wherein each physical object corresponds to a point set, and each point set includes all the points constituting the physical object;
[0022] Determine the entity objects whose coordinates of the points in the point set are exactly the same but in different orders as the same entity objects;
[0023] Delete the same entity object.
[0024] In some implementations, obtaining a scan path for each physical layer includes:
[0025] Get the starting point and ending point on the canvas;
[0026] A scanning path from the starting point to the ending point capable of scanning all the physical objects on the canvas is determined according to the starting point, the ending point and the coordinates of all the physical objects on the canvas.
[0027] In some embodiments, generating a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer includes:
[0028] Generate a front surface measurement program for each physical layer according to the light source parameters and the scanning path of the Nth physical layer; wherein the initial state of N is 1 and N is a positive integer;
[0029] Determining whether a backside program generation instruction of the Nth physical layer is received;
[0030] Upon receiving the backside program generation instruction for the Nth physical layer, determining a backside canvas corresponding to the Nth physical layer;
[0031] Acquire backside light source parameters and backside scanning path of the physical layer;
[0032] generating a backside measurement program for each of the physical layers according to the backside canvas, the backside light source parameters and the backside scanning path;
[0033] Determine whether N is equal to Nmax. If N is not equal to Nmax, set N=N+1, and return to the execution step to generate a front measurement program for each physical layer according to the light source parameters and the scanning path of the Nth physical layer.
[0034] In some embodiments, the light source parameters include brightness and light source type, and the light source type includes bottom light and surface light.
[0035] In a second aspect, an embodiment of the present application provides a 3D model programming device based on an image measuring instrument, the device comprising:
[0036] A first acquisition unit is used to acquire all entity objects in the 3D model of the workpiece to be measured;
[0037] an arranging unit, configured to arrange all the physical objects according to a first coordinate axis coordinate of the physical objects; wherein the first coordinate axis coordinate is used to determine a distance between an image acquisition device of the image measuring instrument and a workpiece to be measured placed on the image measuring instrument;
[0038] a determining unit, configured to determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer, so as to obtain a plurality of entity layers;
[0039] A second acquisition unit is used to acquire light source parameters and scanning paths of each physical layer;
[0040] A generating unit is configured to generate a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is configured to control the image measuring instrument to scan the workpiece to be measured.
[0041] In a third aspect, an embodiment of the present application provides an image measuring instrument, comprising:
[0042] at least one processor; and,
[0043] a memory communicatively connected to at least one processor; wherein,
[0044] The memory stores instructions that can be executed by at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the 3D model programming method based on the vision measuring instrument according to the first aspect.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores an executable program. The executable program is executed by a processor to implement the 3D model programming method based on the image measuring instrument as in the first aspect.
[0046] The present application provides a 3D model programming method, device, image measuring instrument and storage medium based on an image measuring instrument. The method includes: obtaining all physical objects in a 3D model of a workpiece to be measured; arranging all the physical objects according to the first coordinate axis coordinates of the physical objects; wherein the first coordinate axis coordinates are used to determine the distance between the image acquisition device of the image measuring instrument and the workpiece to be measured placed on the image measuring instrument during measurement; determining the physical objects with the same first coordinate axis coordinates as the physical objects on the same physical layer to obtain multiple physical layers; obtaining the light source parameters and scanning path of each physical layer; generating a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is used to control the image measuring instrument to scan the workpiece to be measured. The present application can import a 3D model into the program of the image measuring instrument for programming, without the need to convert the 3D model into a DXF format file, thereby improving programming efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a schematic diagram of the application scenario provided by this application.
[0048] Figure 2 This is a flow chart of a 3D model programming method based on an image measuring instrument provided in this application.
[0049] Figure 3 yes Figure 2 Detailed flowchart of step 130 in FIG.
[0050] Figure 4 Schematic diagram of the structure of an image measuring instrument provided in an embodiment of the present application.
[0051] Figure 5 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0053] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0054] For the convenience of describing the first and second directions in the embodiments of this application, the first direction is the up-down direction in the drawings, the second direction is the front-back direction in the drawings, and the third direction is the left-right direction in the drawings. The x-axis arrow direction is referred to as the "up" direction, the y-axis arrow direction is referred to as the "rear" direction, and the z-axis arrow direction is referred to as the "right" direction in the following text. However, in the actual application of this application, this is not limiting.
[0055] See also Figure 1 , Figure 1 This is a schematic diagram of the application scenario provided by this application. Figure 1 As shown, the application scenario includes an image measuring instrument 1 , which includes: a measuring plane 10 , an image acquisition device 20 , a clamping device 30 and a detection component 40 .
[0056] In some embodiments, for ease of explanation, Figure 1 The mechanical coordinate system is defined in FIG, and the X-axis, Y-axis and Z-axis are schematically shown. The clamping device can move along the X-axis and Y-axis in the measurement plane, and the image acquisition device can move along the Z-axis.
[0057] But it is understandable that Figure 1 The mechanical coordinate system illustrated in FIG. 1 is only used to explain the movable directions of the image acquisition device 20 and the clamping device 30 , and does not limit the movable ranges of the image acquisition device 20 and the clamping device 30 .
[0058] In some embodiments, the clamping device 30 is used to clamp the detection member 40 , and can control the detection member 40 to rotate to perform a flipping operation, and can also control the detection member 40 to move in the measurement plane 10 .
[0059] In some embodiments, the image acquisition device 20 may be a line scan camera, an area array camera, etc., which is not limited in this application.
[0060] See also Figure 2 , Figure 2 This is a flow chart of a 3D model programming method based on an image measuring instrument provided by this application. Figure 2 As shown, the 3D model programming method 100 based on the image measuring instrument includes: steps 110 to 150.
[0061] Step 110: Acquire all entity objects in the 3D model of the workpiece to be measured.
[0062] In some implementations, the 3D model may be a file in the Initial Graphics Exchange Specification (IGS) format.
[0063] In some embodiments, step 110 includes the following steps.
[0064] Step 111: Determine complex geometric entities and basic geometric entities in the 3D model of the workpiece to be measured.
[0065] In some embodiments, the geometric entities include complex geometric entities and basic geometric entities.
[0066] For example, complex geometric entities include Polyline (polyline), BezierCurve (Bezier curve), etc., and basic geometric entities include line, circle, arc, etc.
[0067] Step 112: Convert the complex geometric entity into a basic geometric entity.
[0068] Step 113: Determine all entity objects in the 3D model based on all basic geometric entities.
[0069] In some embodiments, the entity object in the present application is a basic geometric entity. If the geometric entity is a complex geometric entity, the complex geometric entity needs to be decomposed into basic geometric entities.
[0070] For example, taking the complex collective entity polyline segment as an example, the polyline segment is essentially a continuous line segment defined by a series of vertices. The polyline segment can be divided according to the vertices and decomposed into multiple line segments, that is, lines in the basic geometric entity.
[0071] For example, taking a complex geometric entity as a Bezier curve, for a low-order Bezier curve, such as a quadratic Bezier curve or a cubic Bezier curve, the De Casteljau's algorithm can be used to segment the curve, and each small segment of the Bezier curve obtained by segmentation is approximated as a straight line segment; for a complex Bezier curve, the curvature of the Bezier curve can be used to find arcs in one or more basic geometric entities to convert the Bezier curve into a basic geometric entity.
[0072] Step 120: Arrange all the physical objects according to the first coordinate axis coordinates of the physical objects; wherein the first coordinate axis coordinates are used to determine the distance between the image acquisition device of the image measuring instrument and the workpiece to be measured placed on the image measuring instrument during measurement.
[0073] For example, Figure 1 When the image acquisition device 20 moves along the Z axis, the distance between the image acquisition device 20 and the workpiece 40 to be measured, which is clamped by the clamping device 30 and placed on the image measuring instrument 1, changes. Figure 1 The Z axis in can be used as the first coordinate axis.
[0074] Step 130: Determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer, so as to obtain multiple entity layers.
[0075] In some embodiments, see Figure 3 , Figure 3 yes Figure 2 Detailed flow chart of step 130 in FIG. Figure 3 As shown, step 130 includes steps 131 and 132 .
[0076] Step 131: Determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer.
[0077] Exemplarily, entity objects whose Z-axis coordinates are all 3 are determined to be entity objects on the same entity layer.
[0078] Step 132: For all entity objects on the same entity layer, construct a canvas including all entity objects to obtain the multiple entity layers.
[0079] In some implementations, the canvas is the minimum bounding rectangle that includes all physical objects.
[0080] In some implementations, a display area for displaying the entity layers is specifically divided, and a thumbnail corresponding to each entity layer is displayed in the display area.
[0081] In some embodiments, the minimum second-axis coordinate A, the maximum second-axis coordinate B, the minimum third-axis coordinate C, the maximum third-axis coordinate D of all physical objects can be determined, and the coordinates of the first vertex of the minimum circumscribed rectangle are (A, C), the coordinates of the second vertex are (A, D), the coordinates of the third vertex are (B, C), and the coordinates of the fourth vertex are (B, D).
[0082] In some embodiments, for subsequent programming, it is necessary to unify all physical objects into a same coordinate system. In this case, the 3D model programming method based on the image measuring instrument provided in this application further includes the following steps.
[0083] (1) Select one of the multiple physical layers as a reference layer to construct a reference coordinate system.
[0084] (2) Determine the coordinates of all physical objects in the reference layer in the reference coordinate system.
[0085] (3) The physical layers other than the reference layer are regarded as non-reference layers, and the coordinates of all physical objects in the non-reference layers in the reference coordinate system are determined.
[0086] Through the above method, the coordinates of all entity objects in the same coordinate system can be obtained to provide support for subsequent programming.
[0087] In some embodiments, the 3D model programming method based on the image measuring instrument provided in the embodiments of the present application further includes the following steps.
[0088] (1) Based on the coordinates of all the entity objects in the reference coordinate system, determine one by one whether there is an entity object whose points in the point set have the same coordinates but in a different order; wherein each entity object corresponds to a point set, and each point set includes all the points constituting the entity object.
[0089] (2) Entity objects with the same coordinates but different orders of points in the point set are determined to be the same entity objects.
[0090] (3) Delete the same entity object.
[0091] In some embodiments, the arrangement of points in an IGS file is usually ordered, referred to as the order of points. Especially when these points are used to define more complex geometric entities such as curves, polygons, or surfaces, the order of points is crucial for correctly reconstructing the geometric shape.
[0092] For example, when defining a curve, such as a polyline or a spline curve, the points are usually arranged in order along the path of the curve, which means that the first point is the starting point of the curve, the last point is the end point, and the points in between define the shape of the curve.
[0093] For example, for a polygon or closed surface, points are usually arranged in a clockwise or counterclockwise direction to form a boundary, and this order is very important for determining the inside-outside direction of the surface.
[0094] For example, when defining a mesh or free-form surface, points may be arranged in rows or columns to form a two-dimensional array structure. Each point represents a node on the mesh, and the order of these nodes determines the topology of the surface.
[0095] However, when scanning the workpiece to be scanned corresponding to the 3D model, it is not necessary to consider the order of the points, only the position of the points needs to be considered. Therefore, in this application, the entity objects with exactly the same coordinates of the points in the point set but different orders are determined to be the same entity objects, and the same entity objects are deleted, so that subsequent programming can be better and programming efficiency is improved.
[0096] In some embodiments, the method provided herein further includes the following steps.
[0097] (1) Determine whether the first coordinate axis coordinates of the points in the point set of the entity object are exactly the same;
[0098] (2) If they are not exactly the same, delete the entity object.
[0099] In this way, physical objects that are not parallel to the measurement plane can be eliminated, preventing physical objects that are not parallel to the measurement plane from appearing in the image during subsequent measurements and interfering with the measurement results.
[0100] Step 140: Obtain light source parameters and scanning paths for each physical layer.
[0101] In some embodiments, the light source parameters of each physical layer include light source brightness and light source type, and the light source type includes surface light and bottom light.
[0102] Specifically, when the light source parameter is surface light, the image acquisition device of the image measuring instrument and the lighting device emitting surface light are located on the same side of the physical layer, for example, both are located above the physical layer.
[0103] Specifically, when the light source parameter is bottom light, the image acquisition device of the image measuring instrument and the lighting device emitting bottom light are located on different sides of the physical layer, for example, the image acquisition device is located above the physical layer, and the lighting device emitting bottom light is located below the physical layer.
[0104] In some implementations, the step of obtaining a scan path for each physical layer includes:
[0105] (1) Get the starting point and ending point on the canvas.
[0106] (2) Determine a scanning path from the starting point to the ending point that can scan all the physical objects on the canvas based on the starting point, the ending point, and the coordinates of all the physical objects on the canvas.
[0107] In some implementations, the user can set the starting point and the ending point on the canvas by clicking a mouse or the like.
[0108] In some embodiments, an annular area is fitted on the canvas based on the coordinates of the starting point, the ending point, and all physical objects on the canvas, and a scanning path from the starting point to the ending point that can scan all physical objects on the canvas is fitted in the annular area based on the size of the imaging range of the image acquisition device of the image measuring instrument.
[0109] In some embodiments, an outer circle with the smallest area that includes the starting point, the ending point, and all physical objects on the canvas can be constructed, and an inner circle with the largest area that does not include the starting point, the ending point, and all physical objects on the canvas can be constructed to obtain a ring area through the inner circle and the outer circle.
[0110] The above method obtains an annular area by constructing an inner circle and an outer circle, thereby determining the scanning path, with fast fitting speed and good effect.
[0111] Step 150: Generate a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is used to control the image measuring instrument to scan the workpiece to be measured.
[0112] In some embodiments, step 150 includes the following steps.
[0113] (1) generating a front surface measurement program for each physical layer according to the light source parameters and the scanning path of the Nth physical layer; wherein the initial state of N is 1 and N is a positive integer;
[0114] (2) determining whether a back-side program generation instruction of the Nth physical layer is received;
[0115] (3) upon receiving the back side program generation instruction of the Nth physical layer, determining the back side canvas corresponding to the Nth physical layer;
[0116] (4) Obtaining back light source parameters and back scanning path of the physical layer;
[0117] (5) generating a backside measurement program for each of the physical layers according to the backside canvas, the backside light source parameters, and the backside scanning path;
[0118] (6) Determine whether N is equal to Nmax. If N is not equal to Nmax, set N=N+1 and return to the execution step to generate a front measurement program for each physical layer based on the light source parameters and the scanning path of the Nth physical layer.
[0119] In some embodiments, the canvas is the minimum bounding rectangle of all physical objects on the physical layer, and the step of determining the back canvas corresponding to the Nth physical layer includes the following steps.
[0120] (3.1) Determine the front canvas and back canvas based on the Z coordinates of all entity layers.
[0121] (3.2) A back canvas having the same area as a front canvas is determined as the back canvas corresponding to the front canvas.
[0122] (3.3) Define the back canvas with a corresponding front canvas as the first type of back canvas, and the back canvas without a corresponding front canvas as the second type of back canvas. The second type of back canvas is determined to be the back canvas corresponding to any adjacent front canvas corresponding to the first type of back canvas.
[0123] (3.4) Save the correspondence between each front canvas and at least one back canvas.
[0124] (3.5) Determine the back canvas corresponding to the Nth physical layer according to the corresponding relationship.
[0125] In some embodiments, step (3.1) includes the following steps.
[0126] Determine the canvas with the largest area, record the canvas with the largest area as the front canvas, and determine all canvases below the Z coordinate of the canvas with the largest area as the back canvas;
[0127] Determine the second largest canvas whose Z coordinate is above the largest canvas, determine the second largest canvas as the front canvas, and determine all canvases between the largest canvas and the second largest canvas as the back canvas;
[0128] And so on, until the canvas at the highest Z coordinate point is found.
[0129] In some embodiments, the user may check in the software whether to program the backside metrology program. If the check box for programming the backside metrology program is checked, a backside metrology program generation instruction will be generated.
[0130] In some embodiments, the user can reset the backlight source parameters and the backside scanning path.
[0131] In some embodiments, the preset flipping direction is a flipping direction of a clamping device in the image measuring instrument that clamps the workpiece to be measured.
[0132] In some embodiments, after generating the measurement program for each physical layer, all measurement programs are combined to obtain the total measurement program of the 3D model. When combining, the image acquisition device movement instructions are automatically generated and inserted between the two measurement programs based on the coordinate difference of the first coordinate axis between different physical layers to ensure the clarity of the image obtained during detection.
[0133] The embodiment of the present application further provides a 3D model programming device based on an image measuring instrument, the device comprising:
[0134] A first acquisition unit is used to acquire all entity objects in the 3D model of the workpiece to be measured;
[0135] an arranging unit, configured to arrange all the physical objects according to a first coordinate axis coordinate of the physical objects; wherein the first coordinate axis coordinate is used to determine a distance between an image acquisition device of the image measuring instrument and a workpiece to be measured placed on the image measuring instrument;
[0136] a determining unit, configured to determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer, so as to obtain a plurality of entity layers;
[0137] A second acquisition unit is used to acquire light source parameters and scanning paths of each physical layer;
[0138] A generating unit is configured to generate a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is configured to control the image measuring instrument to scan the workpiece to be measured.
[0139] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an image measuring instrument provided in an embodiment of the present application. Figure 4 As shown, the image measuring instrument 200 includes: one or more processors 210 and a memory 220, Figure 4 A processor 210 is taken as an example.
[0140] In some embodiments, the processor 210 and the memory 220 may be connected via a bus or other means. Figure 4 The bus connection is taken as an example.
[0141] In some embodiments, the processor 210 is used to obtain all physical objects in the 3D model of the workpiece to be measured; arrange all the physical objects according to the first coordinate axis coordinates of the physical objects; wherein the first coordinate axis coordinates are used to determine the distance between the image acquisition device of the image measuring instrument and the workpiece to be measured placed on the image measuring instrument during measurement; determine the physical objects with the same first coordinate axis coordinates as the physical objects on the same physical layer to obtain multiple physical layers; obtain the light source parameters and the scanning path of each physical layer; generate a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is used to control the image measuring instrument to scan the workpiece to be measured.
[0142] In some embodiments, memory 220, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules of the 3D model programming method based on an image measuring instrument in the embodiments of the present application. The processor 210 executes the non-volatile software programs, instructions, and modules stored in memory 220 to execute various functional applications and data processing of the image measuring instrument, thereby implementing the 3D model programming method based on an image measuring instrument in the above-described method embodiment.
[0143] In some embodiments, the memory 220 may include a program storage area and a data storage area. The program storage area may store an operating system and applications required for at least one function; the data storage area may store data generated based on the use of the image measuring instrument. Furthermore, the memory 220 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, the memory 220 may optionally include memory remote from the processor 210. Such remote memory may be connected to the controller via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0144] In some embodiments, one or more modules are stored in the memory 220, and when executed by one or more processors 210, the 3D model programming method based on the image measuring instrument in any of the above method embodiments is executed, for example, the 3D model programming method based on the image measuring instrument described above is executed. Figure 2 Method steps 110 to 150 in.
[0145] Please refer to Figure 5 , Figure 5The computer-readable storage medium 300 stores program code 310, which can be called by a processor to execute the 3D model programming method based on the image measuring instrument described in the above method embodiment.
[0146] The computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, a hard disk, or ROM. Alternatively, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has storage space for program code for executing any of the steps in the control method described above. This program code can be read from or written to one or more computer program products. The program code may be compressed, for example, in a suitable format.
[0147] In summary, the present application provides a 3D model programming method, device, image measuring instrument and storage medium based on an image measuring instrument, the method comprising: obtaining all entity objects in a 3D model of a workpiece to be measured; arranging all the entity objects according to the first coordinate axis coordinates of the entity objects; wherein the first coordinate axis coordinates are used to determine the distance between the image acquisition device of the image measuring instrument and the workpiece to be measured placed on the image measuring instrument during measurement; determining entity objects with the same first coordinate axis coordinates as the entity objects on the same entity layer to obtain multiple entity layers; obtaining the light source parameters and scanning path of each entity layer; generating a measurement program for each entity layer according to the light source parameters and the scanning path of each entity layer; wherein the measurement program is used to control the image measuring instrument to scan the workpiece to be measured. The present application can import a 3D model into the program of an image measuring instrument for programming, without the need to convert the 3D model into a DXF format file, thereby improving programming efficiency.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A 3D model programming method based on an image measuring instrument, characterized in that: The method comprises: Determine the complex geometric entities and basic geometric entities in the IGS model of the workpiece to be measured; Convert complex geometric entities into basic geometric entities; Determine all entity objects in the IGS model based on all basic geometric entities; wherein the entity objects include lines, circles, and arcs; Arrange all the physical objects according to the first coordinate axis coordinates of the physical objects; wherein the first coordinate axis coordinates are used to determine the distance between the image acquisition device of the image measuring instrument and the workpiece to be measured placed on the image measuring instrument during measurement; Determine whether the first coordinate axis coordinates of the points in the point set of the entity object are completely identical; if not, delete the entity object; wherein: each entity object corresponds to a point set, and each point set includes all points constituting the entity object; Determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer, so as to obtain multiple entity layers; Select one of the multiple physical layers as a reference layer to construct a reference coordinate system; Determine the coordinates of all physical objects in the reference layer in the reference coordinate system; Taking the physical layers other than the reference layer as non-reference layers, and determining the coordinates of all physical objects in the non-reference layers in the reference coordinate system; Based on the coordinates of all the physical objects in the reference coordinate system, determining one by one whether there is a physical object with the same coordinates of the points in the point set but in a different order for each physical object; wherein each physical object corresponds to a point set, and each point set includes all the points constituting the physical object; Determine the entity objects whose coordinates of the points in the point set are exactly the same but in different orders as the same entity objects; Deleting the same entity object; Get the light source parameters and scanning path of each entity layer; generating a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is used to control the image measuring instrument to scan the workpiece to be measured; The step of determining the entity objects having the same coordinates along the first coordinate axis as the same entity layer to obtain multiple entity layers includes: Determine the entity objects having the same coordinates along the first coordinate axis as the entity objects on the same entity layer; For all entity objects on the same entity layer, construct a canvas including all entity objects to obtain the multiple entity layers; The obtaining of the scanning path of each physical layer includes: Get the starting point and ending point on the canvas; Constructing an outer circle with the smallest area that includes the starting point, the ending point, and all the physical objects on the canvas; constructing an inner circle with the largest area that does not include the starting point, the ending point, and all the physical objects on the canvas; An annular area is obtained by the inner circle and the outer circle, and a scanning path capable of scanning all physical objects on the canvas from the starting point to the ending point is obtained by fitting in the annular area according to the size of the imaging range of the image acquisition device of the image measuring instrument.
2. The 3D model programming method based on the image measuring instrument according to claim 1, characterized in that: The obtaining of the scanning path of each physical layer includes: Get the starting point and ending point on the canvas; A scanning path from the starting point to the ending point capable of scanning all the physical objects on the canvas is determined according to the starting point, the ending point and the coordinates of all the physical objects on the canvas.
3. The 3D model programming method based on the image measuring instrument according to claim 1, characterized in that: Generating a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer includes: Generate a front surface measurement program for each physical layer according to the light source parameters and the scanning path of the Nth physical layer; wherein the initial state of N is 1 and N is a positive integer; Determining whether a backside program generation instruction of the Nth physical layer is received; Upon receiving the backside program generation instruction for the Nth physical layer, determining a backside canvas corresponding to the Nth physical layer; Acquire backside light source parameters and backside scanning path of the physical layer; generating a backside measurement program for each of the physical layers according to the backside canvas, the backside light source parameters and the backside scanning path; Determine whether N is equal to Nmax. If N is not equal to Nmax, set N=N+1, and return to the execution step to generate a front measurement program for each physical layer according to the light source parameters and the scanning path of the Nth physical layer.
4. The 3D model programming method based on an image measuring instrument according to claim 1, characterized in that: The light source parameters include brightness and light source type, and the light source type includes bottom light and surface light.
5. A 3D model programming device based on an image measuring instrument, characterized in that: The device comprises: The first acquisition unit is configured to determine complex geometric entities and basic geometric entities in the IGS model of the workpiece to be measured; convert the complex geometric entities into basic geometric entities; and determine all entity objects in the IGS model based on all basic geometric entities; wherein the entity objects include lines, circles, and arcs; an arranging unit, configured to arrange all the physical objects according to a first coordinate axis coordinate of the physical objects; wherein the first coordinate axis coordinate is used to determine a distance between an image acquisition device of the image measuring instrument and a workpiece to be measured placed on the image measuring instrument; The device is further configured to determine whether the first coordinate axis coordinates of the points in the point set of the entity object are completely identical; if not, deleting the entity object; wherein: each entity object corresponds to a point set, each point set including all points constituting the entity object; entity objects with the same first coordinate axis coordinates are determined to be entity objects on the same entity layer; for all entity objects on the same entity layer, a canvas including all entity objects is constructed to obtain multiple entity layers; one of the multiple entity layers is selected as a reference layer to construct a reference coordinate system; coordinates of all entity objects in the reference layer in the reference coordinate system are determined; entity layers other than the reference layer are used as non-reference layers, and coordinates of all entity objects in the non-reference layer in the reference coordinate system are determined; based on the coordinates of all entity objects in the reference coordinate system, determining one by one whether each entity object has entity objects with exactly the same coordinates but different orders of points in the point set; wherein each entity object corresponds to a point set, each point set including all points constituting the entity object; entity objects with exactly the same coordinates but different orders of points in the point set are determined to be identical entity objects; and the identical entity objects are deleted; A second acquisition unit is configured to acquire light source parameters and a scanning path for each physical layer; acquiring the scanning path for each physical layer comprises: acquiring a starting point and an ending point on the canvas; constructing an outer circle with a minimum area that encompasses the starting point, the ending point, and all physical objects on the canvas; constructing an inner circle with a maximum area that does not encompass the starting point, the ending point, and all physical objects on the canvas; obtaining an annular area through the inner circle and the outer circle, and fitting the scanning path from the starting point to the ending point in the annular area according to the imaging range of the image acquisition device of the image measuring instrument to obtain the scanning path capable of scanning all physical objects on the canvas; A generating unit is configured to generate a measurement program for each physical layer according to the light source parameters and the scanning path of each physical layer; wherein the measurement program is configured to control the image measuring instrument to scan the workpiece to be measured.
6. An image measuring instrument, characterized in that: The image measuring instrument comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the 3D model programming method based on the image measuring instrument according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores an executable program, and the executable program is executed by a processor to implement the 3D model programming method based on an image measuring instrument according to any one of claims 1 to 4.
Citation Information
Patent Citations
System and method for generating three-dimensional image measuring program
CN103092577A
Shooting point location generation method and device for appearance detection, storage medium and electronic equipment
CN116626051A