A method and apparatus for generating a machining reference line of a casting
By registering the spatial point cloud data of the casting blank with the point cloud data of the design model, the target scribing trajectory is generated, which solves the problem of manually calculating the baseline in casting processing, realizes intelligent scribing, and improves production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING YINGJIE TECH CO LTD
- Filing Date
- 2021-10-20
- Publication Date
- 2026-05-19
AI Technical Summary
The casting process requires manual calculation of the machining baseline, which is time-consuming and labor-intensive, affecting production efficiency.
By registering the spatial point cloud data of the target casting blank with the point cloud data of the design model, the target transformation matrix is obtained, and the target scribing trajectory is generated according to the theoretical scribing trajectory to guide the robot to perform intelligent scribing.
It enables intelligent scribing in casting processing, reducing manual labor intensity and improving production efficiency.
Smart Images

Figure CN115994988B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of manufacturing technology, and in particular relates to a method and apparatus for generating datum lines for casting processing. Background Technology
[0002] With the rapid development of technology, digitalization and automation have become widespread in all aspects of production and daily life, leading to improved industrial production efficiency. To keep pace with the high-speed production, production technologies generally use automated machinery to replace manual operations, and in particular, computer software is used to assist in replacing tedious manual processes, greatly utilizing computer computing resources to replace human calculations.
[0003] To improve workshop production efficiency, it is essential to automate and mechanize processes that involve significant manual labor. In traditional casting processing, marking is a necessary step to assist in subsequent machining. However, this marking is traditionally done manually by workers, which is time-consuming and labor-intensive. Summary of the Invention
[0004] The purpose of this invention is to provide a method and apparatus for generating machining datum lines for castings, thereby solving the problem that machining datum lines need to be manually calculated during casting machining in the prior art.
[0005] To achieve the above objectives, embodiments of the present invention provide a method for generating a casting machining datum line, comprising:
[0006] Acquire spatial point cloud data of the target casting blank;
[0007] The spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model.
[0008] The target line trajectory is obtained based on the target transformation matrix and the theoretical line trajectory obtained from the design model.
[0009] Optionally, spatial point cloud data of the target casting blank is acquired, including:
[0010] Using a 3D scanning device, the target casting blank is scanned into a 3D structured light modeling file;
[0011] Based on the aforementioned 3D structured light modeling file, information on multiple triangular facets is obtained;
[0012] The spatial point cloud data is obtained by discretizing the point cloud of multiple triangular facets.
[0013] Optionally, the spatial point cloud data is obtained by discretizing multiple triangular facets, including:
[0014] The multiple triangular facets are rotated and transformed so that the normal vector of each triangular facet coincides with the first coordinate axis;
[0015] The multiple triangular facets that have undergone rotation transformation are then translated to obtain multiple target triangular facets;
[0016] The target triangular facets are divided into meshes to obtain multiple discrete target points located inside the target triangular facets;
[0017] According to the Poisson sampling method, sampling points are selected from the plurality of target discrete points;
[0018] By performing inverse matrix transformation, the sampling points are mapped back to three-dimensional space to obtain the spatial point cloud data.
[0019] Optionally, the multiple target triangular facets are respectively divided into meshes to obtain multiple discrete target points located inside the target triangular facets, including:
[0020] The target triangular facets are divided into meshes to obtain multiple first discrete points;
[0021] The area method is used to determine whether the first discrete point is located inside the corresponding target triangular facet, and the determination result is obtained.
[0022] Based on the judgment result, multiple target discrete points are obtained.
[0023] Optionally, the spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model, including:
[0024] Obtain the second target point set that is closest to the first target point set in the spatial point cloud data from the point cloud data of the design model;
[0025] Calculate the first transformation matrix of the first target point set relative to the second target point set using the transformation matrix method;
[0026] The design model point cloud data is transformed according to the first transformation matrix to obtain the first point cloud data.
[0027] When the relative distance error between the first point cloud data and the spatial point cloud data tends to remain constant, the first transformation matrix is determined to be the target transformation matrix.
[0028] Optionally, after registering the spatial point cloud data with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model, the method further includes:
[0029] The registration effect between the spatial point cloud data and the design model point cloud data is determined by using an open graphics library.
[0030] When the registration effect does not meet the optimal registration pose, point cloud pose transformation is performed on the target transformation matrix.
[0031] Optionally, the target line drawing trajectory is obtained based on the target transformation matrix and the theoretical line drawing trajectory obtained from the design model, including:
[0032] Obtain the theoretical line trajectory;
[0033] Based on the target transformation matrix and the theoretical line trajectory, the first line trajectory and the target normal vector matrix are obtained;
[0034] Based on the first line trajectory and the target normal vector matrix, the theoretical line trajectory is processed to obtain the target line trajectory.
[0035] Optionally, obtaining the theoretical line trajectory includes:
[0036] Based on the point cloud data of the design model, multiple design trajectories located on different surfaces are obtained;
[0037] Based on the multiple design trajectories, the target coordinate point on each design trajectory is obtained;
[0038] The theoretical line trajectory is obtained based on the target coordinate point, the normal vector coordinates corresponding to the target coordinate point, and the preset number.
[0039] Optionally, the theoretical line trajectory is processed based on the first line trajectory and the target normal vector matrix to obtain the target line trajectory, including:
[0040] The target line trajectory is obtained by replacing the second preset data matrix in the theoretical line trajectory with the matrix obtained by transposing the first preset data matrix and the target normal vector matrix in the first line trajectory.
[0041] This invention also provides a casting machining baseline generation device, comprising:
[0042] The first acquisition module is used to acquire the spatial point cloud data of the target casting blank;
[0043] The first acquisition module is used to register the spatial point cloud data with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model.
[0044] The second obtaining module is used to obtain the target drawing trajectory based on the target transformation matrix and the theoretical drawing trajectory obtained from the design model.
[0045] Optionally, the first acquisition module includes:
[0046] The scanning unit is used to scan the target casting blank into a three-dimensional structured light modeling file using a three-dimensional scanning device;
[0047] The first acquisition unit is used to acquire information on multiple triangular facets based on the three-dimensional structured light modeling file.
[0048] Discrete unit, used to discretize point clouds of multiple triangular facets to obtain the spatial point cloud data.
[0049] Optionally, the discrete unit includes:
[0050] The first transformation subunit is used to perform rotation transformation on the multiple triangular facets respectively, so that the normal vector of each triangular facet coincides with the first coordinate axis;
[0051] The second transformation subunit is used to perform translation transformation on the multiple triangular facets after rotation transformation to obtain multiple target triangular facets.
[0052] The sub-unit is used to divide the multiple target triangular facets into meshes respectively, thereby obtaining multiple discrete target points located inside the target triangular facets;
[0053] Select a sub-unit to select a sampling point from the plurality of target discrete points according to the Poisson sampling method;
[0054] The third transformation subunit is used to inversely map the sampling points to three-dimensional space through matrix inverse transformation to obtain the spatial point cloud data.
[0055] Optionally, the sub-unit is specifically used for:
[0056] The target triangular facets are divided into meshes to obtain multiple first discrete points;
[0057] The area method is used to determine whether the first discrete point is located inside the corresponding target triangular facet, and the determination result is obtained.
[0058] Based on the judgment result, multiple target discrete points are obtained.
[0059] Optionally, the first obtaining module is specifically used for:
[0060] Obtain the second target point set that is closest to the first target point set in the spatial point cloud data from the point cloud data of the design model;
[0061] Calculate the first transformation matrix of the first target point set relative to the second target point set using the transformation matrix method;
[0062] The design model point cloud data is transformed according to the first transformation matrix to obtain the first point cloud data.
[0063] When the relative distance error between the first point cloud data and the spatial point cloud data tends to remain constant, the first transformation matrix is determined to be the target transformation matrix.
[0064] Optionally, the device further includes:
[0065] The judgment module is used to judge the registration effect between the spatial point cloud data and the design model point cloud data through an open graphics library;
[0066] The transformation module is used to perform point cloud attitude transformation on the target transformation matrix when the registration effect does not meet the optimal registration attitude.
[0067] Optionally, the second obtaining module includes:
[0068] The second acquisition unit is used to acquire the theoretical line drawing trajectory;
[0069] The first obtaining unit is used to obtain the first drawing trajectory and the target normal vector matrix based on the target transformation matrix and the theoretical drawing trajectory;
[0070] The second obtaining unit is used to process the theoretical drawing trajectory based on the first drawing trajectory and the target normal vector matrix to obtain the target drawing trajectory.
[0071] Optionally, the second acquisition unit is specifically used for:
[0072] Based on the point cloud data of the design model, multiple design trajectories located on different surfaces are obtained;
[0073] Based on the multiple design trajectories, the target coordinate point on each design trajectory is obtained;
[0074] The theoretical line trajectory is obtained based on the target coordinate point, the normal vector coordinates corresponding to the target coordinate point, and the preset number.
[0075] Optionally, the second obtaining unit is specifically used for:
[0076] The target line trajectory is obtained by replacing the second preset data matrix in the theoretical line trajectory with the matrix obtained by transposing the first preset data matrix and the target normal vector matrix in the first line trajectory.
[0077] This invention also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the casting machining baseline generation method as described above.
[0078] This invention also provides a readable storage medium storing a program that, when executed by a processor, implements the casting machining baseline generation method described above.
[0079] The above-described technical solution of the present invention has at least the following beneficial effects:
[0080] In the above scheme, spatial point cloud data of the target casting blank is acquired; the spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model; based on the target transformation matrix and the theoretical scribing trajectory obtained from the design model, the target scribing trajectory is obtained to guide the robot arm of the subsequent work station to perform scribing, thereby realizing intelligent scribing, greatly reducing the labor intensity of manual scribing, and greatly improving production efficiency. Attached Figure Description
[0081] Figure 1 This is a schematic diagram illustrating the steps of the casting machining datum line generation method according to an embodiment of the present invention;
[0082] Figure 2 This is a schematic diagram of the rotational transformation of the triangular facets according to an embodiment of the present invention;
[0083] Figure 3 This is a schematic diagram of the triangular facet meshing according to an embodiment of the present invention;
[0084] Figure 4 This is a schematic diagram of the area determination method according to an embodiment of the present invention;
[0085] Figure 5 This is a schematic diagram of the casting machining baseline generation device according to an embodiment of the present invention. Detailed Implementation
[0086] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0087] This invention addresses the problem in the prior art that machining datum lines need to be manually calculated during casting processing, by providing a method and apparatus for generating casting machining datum lines.
[0088] like Figure 1 As shown, this embodiment of the invention provides a method for generating a casting machining datum line, including:
[0089] Step 101: Obtain the spatial point cloud data of the target casting blank;
[0090] Step 102: Register the spatial point cloud data with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model.
[0091] It should be noted that the registration results of the spatial point cloud data and the design model point cloud data of the target casting blank are fed back through a human-computer interface. This achieves the goal of dynamically registering the target casting blank with the design model, thereby obtaining a reasonable and effective target transformation matrix. Here, the design model is a CAD model.
[0092] Step 103: Obtain the target line trajectory based on the target transformation matrix and the theoretical line trajectory obtained from the design model.
[0093] Here, the target line trajectory is output to the robotic arm for subsequent line drawing operations.
[0094] In this embodiment of the invention, spatial point cloud data of a target casting blank is acquired; the spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain a target transformation matrix of the target casting blank relative to the design model; based on the target transformation matrix and the theoretical scribing trajectory obtained from the design model, the target scribing trajectory is obtained to guide the subsequent workstation robot to perform scribing, thereby realizing intelligent scribing, greatly reducing the labor intensity of manual scribing, and greatly improving production efficiency.
[0095] Optionally, step 101 involves acquiring the spatial point cloud data of the target casting blank, including:
[0096] Using 3D scanning equipment, the target casting blank is scanned into a 3D structured light modeling file;
[0097] Based on the 3D structured light modeling file, obtain information on multiple triangular facets;
[0098] Point cloud data is obtained by discretizing multiple triangular facets.
[0099] It should be noted that 3D structured light modeling files, also known as STL files, can only describe the surface geometry of 3D objects and are saved in both ASCII and binary formats. Here, we primarily use ASCII format STL files, with examples shown below:
[0100]
[0101] Here, the 3D structured light modeling file is traversed to obtain the triangular facet information. The triangular facet information includes the normal vector coordinates and the coordinates of the three vertices of the triangular facet. Here, facet normal represents the normal vector of the triangular facet N = [0.593128 0.731145 -0.337086], and the direction of the normal vector is from the solid to the outside. At the same time, it also includes the coordinates of the three vertices of the triangular facet A = [83.245483 425.362030 454.837982], B = [83.330200 425.476044455.234344], and C = [83.421417 425.146088 454.679169].
[0102] Optionally, point cloud discretization is performed on multiple triangular facets to obtain spatial point cloud data, including:
[0103] Perform rotation transformations on multiple triangular facets so that the normal vector of each triangular facet coincides with the first coordinate axis;
[0104] The multiple triangular facets that have undergone rotation transformation are then translated to obtain multiple target triangular facets;
[0105] Multiple target triangular facets are divided into meshes to obtain multiple discrete target points located inside the target triangular facets;
[0106] Based on the Poisson sampling method, sampling points are selected from multiple discrete target points;
[0107] By performing inverse matrix transformation, the sampling points are mapped back to three-dimensional space to obtain spatial point cloud data.
[0108] It should be noted that, firstly, as Figure 2 As shown, the normal vector n = (n x ,n y ,n z ,) is rotated to coincide with the first coordinate axis, which here coincides with the Z-axis.
[0109] Specifically, the normal vector n is first rotated around the Z-axis by an angle α. The rotation transformation matrix is:
[0110]
[0111] in, Then, this transformation is applied to the triangular facet so that the normal vector n lies in the YOZ plane.
[0112] Next, rotate the normal vector n around the X-axis by an angle β. The rotation transformation matrix is:
[0113]
[0114] in, Then, this transformation is applied to the triangular facet so that the normal vector coincides with the Z-axis.
[0115] The triangular facet after the above rotation transformation is perpendicular to the Z-axis.
[0116] Then, the triangular facet after the above rotation transformation is translated to obtain the target triangular facet, as shown below. Figure 3 As shown, the target triangular facet ABC lies on the XOY plane. Here, the translation matrix is:
[0117]
[0118] Then, the maximum and minimum coordinate values of the triangular facets are calculated, and the rectangular region containing the triangular facets is divided into grids at equal intervals. Points located inside the triangular facets are extracted as target discrete points, and their normal vector information is preserved. It is important to note that the smaller the grid spacing, the more point cloud data is obtained.
[0119] Then, the Poisson sampling method is used to select sampling points among the target discrete points.
[0120] Specifically, the minimum distance between sampling points is defined as r. An active sampling point is randomly generated within the triangular facet. Then, k candidate sampling points are randomly generated in a ring-shaped region surrounding this active sampling point, with a radius extending from r to 2r. Among these k random candidate sampling points, points whose distance to the selected sampling point is less than r are discarded, and the remaining points are designated as new active sampling points. If all k sampling points are discarded, and no usable points remain, the selected active sampling point at the center of the ring-shaped region is marked as inactive and no longer used to generate candidate sampling points. The algorithm iteration ends when all sampling points are inactive. This results in uniformly distributed point cloud data.
[0121] Finally, the point cloud data of the two-dimensional plane obtained above, i.e. the sampling points, are mapped back to the three-dimensional space through matrix inverse transformation to obtain spatial point cloud data.
[0122] Optionally, the multiple target triangular facets are respectively divided into meshes to obtain multiple discrete target points located inside the target triangular facets, including:
[0123] Multiple target triangular facets are divided into meshes to obtain multiple first discrete points;
[0124] The area method is used to determine whether the first discrete point is located inside the corresponding target triangular facet, and the determination result is obtained.
[0125] Based on the judgment results, multiple target discrete points are obtained.
[0126] It should be noted that the area method is used to determine whether multiple discrete points are inside the target triangular facet. Figure 4 As shown, if the area of triangle ABC is the sum of the areas of triangles PAB, PBC, and PAC, then point P is inside or on the side of triangle ABC; otherwise, point P is discarded and not considered as the target discrete point.
[0127] The area of a triangle can be solved using the three-point method, where the coordinates of the three points are A(x, y). a ,y a ,z a B(x) b ,y b ,z b ), C(x) c ,y c ,z c If the area of triangle ABC is ABC, then the formula for calculating the area of triangle ABC is:
[0128]
[0129] Optionally, in step 102, the spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model, including:
[0130] Obtain the second target point set that is closest to the first target point set in the spatial point cloud data from the point cloud data of the design model;
[0131] Calculate the first transformation matrix of the first target point set relative to the second target point set using the transformation matrix method;
[0132] The point cloud data of the design model is transformed according to the first transformation matrix to obtain the first point cloud data.
[0133] When the relative distance error between the first point cloud data and the spatial point cloud data tends to remain constant, the first transformation matrix is determined as the target transformation matrix.
[0134] Here, the ICP (Iterative Closest Point) algorithm is used to determine the target transformation matrix. The relative distance error between all points in the first point cloud data and the corresponding points in the spatial point cloud data is iterated. When the relative distance error tends to remain constant, the first transformation matrix corresponding to the first point cloud data is determined as the target transformation matrix.
[0135] Optionally, after registering the spatial point cloud data with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model, step 102 further includes:
[0136] By using an open graphics library, the registration effect between spatial point cloud data and design model point cloud data can be determined.
[0137] When the registration effect does not meet the optimal registration pose, point cloud pose transformation is performed on the target transformation matrix.
[0138] It should be noted that the registration effect is displayed using a human-machine interface. Here, the point cloud registration effect is judged by creating a window through the OpenGL library. When the registration effect does not meet the optimal registration pose or the processing margin is insufficient, the point cloud pose transformation is performed on the target transformation matrix.
[0139] Specifically, the steps for performing point cloud pose transformation on the target transformation matrix include:
[0140] Step 1: Adjust the target transformation matrix as follows:
[0141] Translations along the X, Y, and Z axes, and rotations about the X, Y, and Z axes, are denoted as x, y, z, nx, ny, and nz, respectively. Here, the angle values of rotation about the X, Y, and Z axes are converted to radians:
[0142]
[0143] Translation matrix T P The rotation matrix T about the X-axis X The rotation matrix T about the Y-axis Y And the rotation matrix T about the Z-axis Z They are as follows:
[0144]
[0145]
[0146]
[0147]
[0148] The adjusted target transformation matrix is:
[0149] T i =T P T X T Y T Z ;
[0150] Among them, T i The target transformation matrix after the i-th adjustment.
[0151] Step 2: Determine the registration effect of the first target transformation matrix;
[0152] Step 3: If the registration effect does not meet the optimal registration pose, repeat the adjustment in Step 1 until the optimal registration effect is met.
[0153] It should be noted that the target rotation transformation matrix after multiple adjustments is as follows:
[0154] T res =T n T n-1 T n-2 …T2T1.
[0155] Optionally, step 103 involves obtaining the target line trajectory based on the target transformation matrix and the theoretical line trajectory obtained from the design model, including:
[0156] Obtain the theoretical line trajectory;
[0157] Based on the target transformation matrix and the theoretical line trajectory, the first line trajectory and the target normal vector matrix are obtained;
[0158] Based on the first line trajectory and the target normal vector matrix, the theoretical line trajectory is processed to obtain the target line trajectory.
[0159] Specifically, the steps for obtaining the first drawn trajectory and the target normal vector matrix based on the target transformation matrix and the theoretical drawn trajectory include:
[0160] Step 1: Take the second to fourth columns of the theoretical line trajectory F to form a new matrix. Transpose this matrix and add a row of all 1s to the bottom of the transposed matrix to obtain the second line trajectory, path:
[0161]
[0162] The first line trajectory, newpath, is calculated using the following formula:
[0163] newpath = T res ×path;
[0164] Among them, T res This is the target transformation matrix (this target transformation matrix is the target transformation matrix after multiple adjustments);
[0165] Step 2: Take the first three rows and first three columns of the target transformation matrix to form the first normal vector matrix rotate;
[0166] Transpose the last three columns of the theoretical line trajectory F to obtain the second normal vector matrix N;
[0167] The target normal vector matrix newN is calculated according to the following formula:
[0168] newN = N × rotate.
[0169] Optionally, obtaining the theoretical line trajectory includes:
[0170] Based on the point cloud data of the design model, multiple design trajectories located on different surfaces are obtained;
[0171] Based on multiple design trajectories, the target coordinate points on each design trajectory are obtained;
[0172] Based on the target coordinate point, the corresponding normal vector coordinates of the target coordinate point, and the preset number, obtain the theoretical line trajectory.
[0173] It should be noted that the theoretical trajectory F can be written in matrix form as follows:
[0174]
[0175] The first column, `pathno`, represents a preset number. For example, 0101 indicates the first design trajectory on the first surface, and 0203 indicates the third design trajectory on the second surface. It's important to note that changing the preset number turns off the robot's laser; otherwise, the laser remains on during movement. The other columns in each row represent the target coordinates on the design trajectory and the corresponding normal vector coordinates. When the design trajectory is a straight line, the target coordinates are the start and end points of that line; when the design trajectory is a curve, the target coordinates are multiple points on the curve, with the multiple straight lines connecting these points fitting to form the curve.
[0176] Optionally, based on the first line trajectory and the target normal vector matrix, the theoretical line trajectory is processed to obtain the target line trajectory, including:
[0177] The target line trajectory is obtained by replacing the second preset data matrix in the theoretical line trajectory with the transposed matrices of the first preset data matrix and the target normal vector matrix in the first line trajectory.
[0178] It should be noted that the first preset data matrix is the first three rows of data in the first drawn trajectory newpth; the second preset data matrix is the data in the second to seventh columns of the theoretical drawn trajectory F.
[0179] Here, the matrix formed by transposing the first preset data matrix and the target normal vector matrix respectively is used to replace the second preset data matrix to obtain the target line trajectory F. ′ for:
[0180]
[0181] like Figure 5 As shown, this embodiment of the invention also provides a casting machining baseline generation device, comprising:
[0182] The first acquisition module 501 is used to acquire the spatial point cloud data of the target casting blank;
[0183] The first acquisition module 502 is used to register the spatial point cloud data with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model.
[0184] The second acquisition module 503 is used to obtain the target line trajectory based on the target transformation matrix and the theoretical line trajectory obtained from the design model.
[0185] In this embodiment of the invention, spatial point cloud data of a target casting blank is acquired; the spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain a target transformation matrix of the target casting blank relative to the design model; based on the target transformation matrix and the theoretical scribing trajectory obtained from the design model, the target scribing trajectory is obtained to guide the subsequent workstation robot to perform scribing, thereby realizing intelligent scribing, greatly reducing the labor intensity of manual scribing, and greatly improving production efficiency.
[0186] Optionally, the first acquisition module 501 includes:
[0187] The scanning unit is used to scan the target casting blank into a three-dimensional structured light modeling file using a three-dimensional scanning device;
[0188] The first acquisition unit is used to acquire information on multiple triangular facets based on the 3D structured light modeling file;
[0189] Discrete units are used to discretize point clouds from multiple triangular facets to obtain spatial point cloud data.
[0190] Optionally, the discrete unit includes:
[0191] The first transformation subunit is used to perform rotation transformations on multiple triangular facets respectively, so that the normal vector of each triangular facet coincides with the first coordinate axis;
[0192] The second transformation subunit is used to perform translation transformation on the multiple triangular facets after rotation transformation to obtain multiple target triangular facets.
[0193] Sub-cells are used to divide multiple target triangular facets into meshes, resulting in multiple discrete target points located inside the target triangular facets;
[0194] Select sub-units to select sampling points from multiple target discrete points according to the Poisson sampling method;
[0195] The third transformation subunit is used to inversely map the sampling points to three-dimensional space through matrix inverse transformation to obtain spatial point cloud data.
[0196] Optionally, dividing into sub-units is specifically used for:
[0197] Multiple target triangular facets are divided into meshes to obtain multiple first discrete points;
[0198] The area method is used to determine whether the first discrete point is located inside the corresponding target triangular facet, and the determination result is obtained.
[0199] Based on the judgment results, multiple target discrete points are obtained.
[0200] Optionally, the first obtaining module 502 is specifically used for:
[0201] Obtain the second target point set that is closest to the first target point set in the spatial point cloud data from the point cloud data of the design model;
[0202] Calculate the first transformation matrix of the first target point set relative to the second target point set using the transformation matrix method;
[0203] The point cloud data of the design model is transformed according to the first transformation matrix to obtain the first point cloud data.
[0204] When the relative distance error between the first point cloud data and the spatial point cloud data tends to remain constant, the first transformation matrix is determined as the target transformation matrix.
[0205] Optionally, the device further includes:
[0206] The judgment module is used to judge the registration effect between spatial point cloud data and design model point cloud data through an open graphics library;
[0207] The transformation module is used to perform point cloud attitude transformation on the target transformation matrix when the registration effect does not meet the optimal registration attitude.
[0208] Optionally, the second obtaining module 502 includes:
[0209] The second acquisition unit is used to acquire the theoretical line drawing trajectory;
[0210] The first obtaining unit is used to obtain the first drawn trajectory and the target normal vector matrix based on the target transformation matrix and the theoretical drawn trajectory;
[0211] The second obtaining unit is used to process the theoretical drawing trajectory based on the first drawing trajectory and the target normal vector matrix to obtain the target drawing trajectory.
[0212] Optionally, the second acquisition unit is specifically used for:
[0213] Based on the point cloud data of the design model, multiple design trajectories located on different surfaces are obtained;
[0214] Based on multiple design trajectories, the target coordinate points on each design trajectory are obtained;
[0215] Based on the target coordinate point, the corresponding normal vector coordinates of the target coordinate point, and the preset number, obtain the theoretical line trajectory.
[0216] Optionally, the second obtaining unit is specifically used for:
[0217] The target line trajectory is obtained by replacing the second preset data matrix in the theoretical line trajectory with the transposed matrices of the first preset data matrix and the target normal vector matrix in the first line trajectory.
[0218] It should be noted that the casting machining datum line generation device provided in this embodiment of the invention is a device capable of performing the above-described casting machining datum line generation method. Therefore, all embodiments of the above-described casting machining datum line generation method are applicable to this device and can achieve the same or similar technical effects.
[0219] This invention also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the casting machining baseline generation method as described above.
[0220] This invention also provides a readable storage medium storing a program that, when executed by a processor, implements the casting machining baseline generation method described above.
[0221] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0222] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of the range and any subranges in between.
[0223] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for generating a casting machining datum line, characterized in that, include: Acquire spatial point cloud data of the target casting blank; The spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model. The target line trajectory is obtained based on the target transformation matrix and the theoretical line trajectory obtained from the design model; The process of obtaining the target line trajectory based on the target transformation matrix and the theoretical line trajectory obtained from the design model includes: Obtain the theoretical line trajectory; Based on the target transformation matrix and the theoretical line trajectory, the first line trajectory and the target normal vector matrix are obtained; The first preset data matrix and the target normal vector matrix in the first drawn trajectory are transposed and horizontally concatenated to form a matrix, which replaces the second preset data matrix in the theoretical drawn trajectory to obtain the target drawn trajectory.
2. The method for generating casting machining datum lines according to claim 1, characterized in that, Acquire spatial point cloud data of the target casting blank, including: Using a 3D scanning device, the target casting blank is scanned into a 3D structured light modeling file; Based on the aforementioned 3D structured light modeling file, information on multiple triangular facets is obtained; The spatial point cloud data is obtained by discretizing the point cloud of multiple triangular facets.
3. The method for generating casting machining datum lines according to claim 2, characterized in that, The spatial point cloud data is obtained by discretizing multiple triangular facets, including: The multiple triangular facets are rotated and transformed so that the normal vector of each triangular facet coincides with the first coordinate axis; The multiple triangular facets that have undergone rotation transformation are then translated to obtain multiple target triangular facets; The target triangular facets are divided into meshes to obtain multiple discrete target points located inside the target triangular facets; According to the Poisson sampling method, sampling points are selected from the plurality of target discrete points; By performing inverse matrix transformation, the sampling points are mapped back to three-dimensional space to obtain the spatial point cloud data.
4. The method for generating casting machining datum lines according to claim 3, characterized in that, The target triangular facets are divided into meshes to obtain multiple discrete target points located inside the target triangular facets, including: The target triangular facets are divided into meshes to obtain multiple first discrete points; The area method is used to determine whether the first discrete point is located inside the corresponding target triangular facet, and the determination result is obtained. Based on the judgment result, multiple target discrete points are obtained.
5. The method for generating casting machining datum lines according to claim 1, characterized in that, The spatial point cloud data is registered with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model, including: Obtain the second target point set that is closest to the first target point set in the spatial point cloud data from the point cloud data of the design model; Calculate the first transformation matrix of the first target point set relative to the second target point set using the transformation matrix method; The design model point cloud data is transformed according to the first transformation matrix to obtain the first point cloud data. When the relative distance error between the first point cloud data and the spatial point cloud data tends to remain constant, the first transformation matrix is determined to be the target transformation matrix.
6. The method for generating casting machining datum lines according to claim 1, characterized in that, After registering the spatial point cloud data with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model, the method further includes: The registration effect between the spatial point cloud data and the design model point cloud data is determined by using an open graphics library. When the registration effect does not meet the optimal registration pose, point cloud pose transformation is performed on the target transformation matrix.
7. The method for generating casting machining datum lines according to claim 1, characterized in that, Obtaining the theoretical line trajectory includes: Based on the point cloud data of the design model, multiple design trajectories located on different surfaces are obtained; Based on the multiple design trajectories, the target coordinate point on each design trajectory is obtained; The theoretical line trajectory is obtained based on the target coordinate point, the normal vector coordinates corresponding to the target coordinate point, and the preset number.
8. A device for generating a casting machining baseline, characterized in that, include: The first acquisition module is used to acquire the spatial point cloud data of the target casting blank; The first acquisition module is used to register the spatial point cloud data with the point cloud data of the design model of the target casting blank to obtain the target transformation matrix of the target casting blank relative to the design model. The second obtaining module is used to obtain the target drawing trajectory based on the target transformation matrix and the theoretical drawing trajectory obtained from the design model; The second obtaining module includes: The second acquisition unit is used to acquire the theoretical line drawing trajectory; The first obtaining unit is used to obtain the first drawn trajectory and the target normal vector matrix based on the target transformation matrix and the theoretical drawn trajectory; The second obtaining unit is specifically used to replace the second preset data matrix in the theoretical drawing trajectory with a matrix formed by transposing and horizontally splicing the first preset data matrix and the target normal vector matrix in the first drawing trajectory, thereby obtaining the target drawing trajectory.
9. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the casting machining baseline generation method as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program that, when executed by a processor, implements the casting machining baseline generation method as described in any one of claims 1 to 7.