Workpiece autonomous identification and CAM programming method and system based on numerical control system

By performing geometric feature analysis and spatial mapping matching between the 3D model of the workpiece and the candidate blank model, the problem of reliance on manual intervention and data association gaps in feature matching of CAM systems when facing unknown workpieces is solved, realizing automated and efficient processing control of workpiece autonomous recognition and CAM programming.

CN121785241AInactive Publication Date: 2026-04-03JINLING (CHINA) TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-04
Publication Date
2026-04-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing CAM systems, when faced with unknown or scattered workpieces to be processed, suffer from features that rely on manual intervention for matching, low efficiency in blank selection and matching, and lag in processing command generation, making it difficult to meet the demands for high-efficiency and high-precision manufacturing.

Method used

By acquiring the original point cloud data of the workpiece, a 3D model of the workpiece is constructed and its geometric features are analyzed with the candidate blank model. The spatial mapping matching mechanism is used to automatically associate the features of the workpiece and the blank, generate processing control instructions, and achieve seamless connection between the reverse reconstruction model and the forward process planning.

Benefits of technology

It significantly improves the modeling accuracy of non-standard workpieces, the automation level of blank matching, and the response speed of process planning, overcoming the technical shortcomings of traditional solutions such as high dependence on manual labor, feature correlation discontinuity, and low instruction generation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785241A_ABST
    Figure CN121785241A_ABST
Patent Text Reader

Abstract

The invention discloses a workpiece autonomous identification and CAM programming method and system based on a numerical control system, and the method comprises the steps: carrying out the preprocessing of obtained original point cloud data, and constructing a workpiece three-dimensional model of a to-be-machined workpiece; constructing a blank model library comprising a plurality of candidate blank models; performing geometric feature analysis on the workpiece three-dimensional model and the plurality of candidate blank models to obtain a workpiece feature set and a plurality of blank feature sets; performing spatial mapping matching on the workpiece feature set and a blank feature set corresponding to each candidate blank model to obtain a blank candidate sequence; and a target blank model is determined according to the blank candidate sequence, and a machining control instruction is generated based on the workpiece three-dimensional model and the target blank model. Compared with the prior art, the modeling precision of the non-standard workpiece, the automation level of blank matching and the response speed of process planning can be remarkably improved, and the technical defects that in a traditional scheme, the manual dependence degree is high, and the feature correlation fault and instruction generation efficiency is low are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of intelligent manufacturing and CNC machining technology, and more specifically, to a method and system for autonomous workpiece recognition and CAM programming based on a CNC system. Background Technology

[0002] With the rapid evolution of intelligent manufacturing and precision machining technologies, Computer-Aided Manufacturing (CAM) systems, as the link between digital models and physical machining, have become a core indicator for measuring production flexibility due to their adaptive handling capabilities for non-standard workpieces. Faced with complex production tasks involving multiple varieties and varying batch sizes, modern CNC machining urgently needs to achieve full-process automation from physical object perception to process generation. However, traditional process development methods relying on manual teaching programming or standard CAD drawings are limited by the operator's technical experience, geometric deviations between the model and the physical object, and the cumbersome offline programming process, making it difficult to meet the demands for high-efficiency and high-precision manufacturing. Three-dimensional vision perception technology, with its non-contact and highly efficient acquisition advantages, is gradually becoming a key means of front-end perception in CNC machining. The completeness of its reverse modeling and the accuracy of its feature analysis directly determine the level of intelligence in the machining process.

[0003] While some existing technologies attempt to assist programming by importing preset 3D models or manually specifying blank features, they still suffer from a lack of automatic correlation between reverse scan data and forward blank library data. This results in existing CAM systems exhibiting problems such as reliance on manual intervention for feature matching, low efficiency in blank selection and matching, and delayed generation of processing instructions when faced with unknown or randomly stacked workpieces.

[0004] Therefore, how to provide a workpiece autonomous recognition and CAM programming method based on CNC system that can significantly improve the modeling accuracy of non-standard workpieces, the automation level of blank matching and the response speed of process planning, and overcome the technical shortcomings of traditional solutions such as high dependence on manual labor, feature correlation discontinuity and low instruction generation efficiency has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a workpiece autonomous recognition and CAM programming method based on a CNC system, which can significantly improve the modeling accuracy of non-standard workpieces, the automation level of blank matching, and the response speed of process planning, overcoming the technical shortcomings of traditional solutions such as high reliance on manual labor, feature correlation discontinuity, and low instruction generation efficiency.

[0006] The first technical solution provided in this application is as follows: This application provides a workpiece autonomous recognition and CAM programming method based on a CNC system, comprising: S1 acquiring the original point cloud data of the workpiece to be processed, and preprocessing the original point cloud data to construct a three-dimensional model of the workpiece; S2 constructing a blank model library, the blank model library including several candidate blank models; S3 performing geometric feature analysis on the three-dimensional model of the workpiece and the several candidate blank models to obtain a workpiece feature set and several blank feature sets; S4 performing spatial mapping matching between the workpiece feature set and the blank feature set corresponding to each of the candidate blank models to obtain a blank candidate sequence; S5 determining the target blank model according to the blank candidate sequence, and generating machining control instructions based on the three-dimensional model of the workpiece and the target blank model.

[0007] Furthermore, in a preferred embodiment of the present invention, the step of performing geometric feature analysis on the three-dimensional model of the workpiece and several candidate blank models includes: Edge filling is performed on the 3D model of the workpiece, and contour line detection is performed on the filled 3D model of the workpiece and several candidate blank models to obtain the blank contour line and the workpiece contour line. Traverse the discrete points on the workpiece contour line and the blank contour line, and calculate the tangent direction vector of each discrete point distributed along the contour line path. Analyze and obtain the angle change range between adjacent tangent direction vectors, and identify blank feature points and workpiece feature points based on the angle change range; Based on the blank outline, workpiece outline, blank feature points, and workpiece feature points, create a workpiece feature set and several blank feature sets.

[0008] Further, in a preferred embodiment of the present invention, the step of performing contour line detection on the filled 3D model of the workpiece and the plurality of candidate blank models includes: Construct a Gaussian sphere mapping model, and map the normal vector directions of discrete points of the workpiece 3D model or the candidate blank model to the Gaussian sphere mapping model, and obtain a mapping record table; Obtain the current projection direction, calculate the dot product between the projection direction and the normal vector direction of each discrete point in the mapping record table, and filter out the points whose dot product satisfies the preset orthogonality condition to obtain contour candidate points; Calculate the spatial distance between any two candidate contour points, determine whether the spatial distance is less than a preset adjacency threshold, and determine the points that satisfy the adjacency threshold as having a connecting edge; Based on the connecting edges, connectivity analysis and topological connection are performed on all the candidate contour points to generate the workpiece contour line or the blank contour line.

[0009] Furthermore, in a preferred embodiment of the present invention, the step of preprocessing the raw point cloud data includes: The workpiece to be processed is scanned to obtain raw point cloud data, and the raw point cloud data is converted into depth image information; The depth image information is filtered using a Gaussian filtering algorithm, then normalized, and finally subjected to hole compensation processing to obtain a three-dimensional model of the workpiece.

[0010] Furthermore, in a preferred embodiment of the present invention, the step of performing hole compensation processing on the normalized depth image information includes: Detect hole regions in the depth image information and identify the boundary point positions of the hole regions; Calculate the geometric angle between two adjacent sides at the boundary point, and supplement the hole area with a triangular mesh according to the principle of minimum angle to generate an initial supplementary mesh; The vertices of the initial supplementary mesh are extracted as control vertices. The coordinates of the control vertices are calculated based on the Laplacian matrix. The radial basis functions are combined with the coordinates of the control vertices to construct the target implicit surface expression. The vertex projection coordinates of each vertex in the initial supplementary mesh are calculated based on the target implicit surface expression, and the initial supplementary mesh is updated based on the vertex projection coordinates to complete the repair of the hole region.

[0011] Furthermore, in a preferred embodiment of the present invention, the method further includes constructing an autonomously stitched 3D model, specifically: A 3D drawing interactive interface is established, and a primitive library is constructed, which includes several basic geometric primitives; Receive the primitive calling instruction from the three-dimensional drawing interactive interface, and retrieve the target primitive according to the primitive calling instruction; Calculate the geometric center of the target primitive and mark the lateral central axis of the target primitive based on the geometric center; The target graphic elements are aligned along the horizontal center axis. The set starting angle parameters and ending angle parameters are collected, and the target primitive after axis alignment is segmented and transformed based on the starting angle parameters and the ending angle parameters. The target primitives after segmentation and transformation are assembled along the horizontal central axis using a constructive entity geometric Boolean union operation algorithm to generate a spliced ​​model. The joint positions of the spliced ​​models are smoothed by rounding corners to generate an autonomously spliced ​​3D model. This autonomously spliced ​​3D model is used as the 3D model of the workpiece for geometric feature analysis and generation of machining control commands.

[0012] Further, in a preferred embodiment of the present invention, the step of generating machining control instructions based on the workpiece 3D model and the target blank model includes: Identify the key geometric feature points of the workpiece's three-dimensional model, including contour edge points and inflection points; Based on the key geometric feature points, the machining process parameters are calculated. The machining process parameters include the workpiece origin coordinates, blank end face size parameters, and workpiece end face size parameters. The machining path is planned according to the machining process parameters, and the machining path is compiled into machining control instructions; The machining control command is output to the verification interface, and after receiving a confirmation signal for the machining control command, the workpiece machining operation is executed based on the machining control command.

[0013] Furthermore, in a preferred embodiment of the present invention, it further includes adaptive path planning based on the material removal volume, specifically: Perform a Boolean difference operation on the target blank model and the workpiece 3D model to generate a model to be cut; An initial tool path is planned in the model to be cut, and a discretized volume analysis is performed on the model to be cut along the initial tool path to obtain the instantaneous material removal amount distributed along the path; The instantaneous material removal amount is compared with a preset cutting load threshold, and the feed rate parameters of the initial tool path are adjusted according to the comparison result to generate an optimized machining path. The optimized machining path is compiled into machining control instructions, output to the verification interface, and after receiving a confirmation signal for the machining control instructions, the workpiece machining operation is executed based on the machining control instructions.

[0014] This application provides a second technical solution as follows: This application also provides a workpiece autonomous recognition and CAM programming system based on a CNC system, including: The workpiece model construction module acquires the original point cloud data of the workpiece to be processed, and preprocesses the original point cloud data to construct a three-dimensional model of the workpiece to be processed. The workpiece blank modeling module constructs a blank model library, which includes several candidate blank models. The geometric feature analysis module performs geometric feature analysis on the three-dimensional model of the workpiece and several candidate blank models to obtain the workpiece feature set and several blank feature sets. The spatial mapping and matching module performs spatial mapping and matching between the workpiece feature set and the blank feature set corresponding to each candidate blank model to obtain a blank candidate sequence. The machining instruction generation module determines the target blank model based on the blank candidate sequence and generates machining control instructions based on the workpiece 3D model and the target blank model.

[0015] Furthermore, in a preferred embodiment of the present invention, the geometric feature analysis module includes: The model contour detection unit performs edge filling on the workpiece 3D model and performs contour line detection on the filled workpiece 3D model and several candidate blank models to obtain the blank contour line and the workpiece contour line. The tangent vector calculation unit traverses the discrete points on the workpiece contour line and the blank contour line, and calculates the tangent direction vector of each of the discrete points distributed along the contour line path. The feature point identification unit analyzes and obtains the angle change range between adjacent tangent direction vectors, and identifies blank feature points and workpiece feature points based on the angle change range. The feature set construction unit creates a workpiece feature set and several blank feature sets based on the blank outline, workpiece outline, blank feature points, and workpiece feature points.

[0016] This invention provides a workpiece autonomous recognition and CAM programming method based on a CNC system, comprising: S1 acquiring the original point cloud data of the workpiece to be processed, and preprocessing the original point cloud data to construct a three-dimensional model of the workpiece; S2 constructing a blank model library, the blank model library including several candidate blank models; S3 performing geometric feature analysis on the workpiece three-dimensional model and the several candidate blank models to obtain a workpiece feature set and several blank feature sets; S4 performing spatial mapping matching between the workpiece feature set and the blank feature set corresponding to each of the candidate blank models to obtain a blank candidate sequence; S5 determining the target blank model according to the blank candidate sequence, and generating machining control instructions based on the workpiece three-dimensional model and the target blank model. Specifically, by performing geometric feature analysis and spatial mapping matching on the 3D model of the workpiece and candidate blank models, this geometric feature-driven spatial mapping matching mechanism breaks down the logical barrier between reverse scanning data and forward blank library data in existing technologies. It establishes an automatic association channel between the reverse point cloud and the forward blank model, effectively solving the problems of reliance on manual intervention and data association gaps in feature matching when facing unknown workpieces in existing CAM systems. Secondly, by matching the workpiece feature set with the blank feature set to obtain a blank candidate sequence, and then determining the target blank model accordingly, an automated selection system of "feature extraction-spatial matching-sequence optimization" is constructed at the algorithm layer. This provides an intelligent decision-making window for the rapid identification of unknown or randomly stacked workpieces, preventing inefficient blank selection due to reliance on manual experience or simple presets. This invention significantly improves the efficiency and automation level of blank matching in non-standard and complex scenarios by reducing the risk of low efficiency and matching errors. It utilizes a mechanism that directly generates machining control instructions based on a defined target blank model and workpiece 3D model, achieving seamless integration between reverse reconstruction model and forward process planning data. This ensures that the autonomous identification results can be instantly converted into executable CNC code, avoiding the low efficiency and slow response of machining instruction generation caused by cumbersome model processing and delayed process parameter configuration in traditional solutions. This greatly improves the response speed of process planning and the continuity of CNC machining. Compared with existing technologies, this invention significantly improves the modeling accuracy of non-standard workpieces, the automation level of blank matching, and the response speed of process planning, overcoming the technical shortcomings of high manual dependence, feature correlation discontinuity, and low instruction generation efficiency in traditional solutions. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the steps of the workpiece autonomous recognition and CAM programming method based on a CNC system provided in this embodiment of the invention; Figure 2 A schematic diagram of the framework for a workpiece autonomous recognition and CAM programming method based on a numerical control system is provided for embodiments of the present invention; Figure 3 A flowchart illustrating the steps of geometric feature analysis provided in this embodiment of the invention; Figure 4 A flowchart illustrating the steps of contour line detection provided in this embodiment of the invention; Figure 5 A schematic diagram of adaptive path planning logic based on material removal volume provided in an embodiment of the present invention; Figure 6 The structural framework diagram of the workpiece autonomous recognition and CAM programming system based on the CNC system provided in the embodiment of the present invention is shown. Detailed Implementation

[0019] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly set on the other component; when a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to the other component.

[0021] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "first", "second", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0022] 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 technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" or "several" means two or more, unless otherwise explicitly specified.

[0023] It should be noted that the structures, proportions, sizes, etc., shown in the accompanying drawings of this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the conditions under which this application can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size should still fall within the scope of the technical content disclosed in this application, provided that they do not affect the effects and purposes that this application can produce.

[0024] like Figures 1 to 6As shown in the embodiment of this application, a workpiece autonomous recognition and CAM programming method based on a CNC system is provided, including: S1 acquiring the original point cloud data of the workpiece to be processed, and preprocessing the original point cloud data to construct a three-dimensional model of the workpiece to be processed; S2 constructing a blank model library, which includes several candidate blank models; S3 performing geometric feature analysis on the three-dimensional model of the workpiece and several candidate blank models to obtain a workpiece feature set and several blank feature sets; S4 performing spatial mapping matching between the workpiece feature set and the blank feature set corresponding to each candidate blank model to obtain a blank candidate sequence; S5 determining the target blank model according to the blank candidate sequence, and generating machining control instructions based on the three-dimensional model of the workpiece and the target blank model. In this process, geometric feature analysis and spatial mapping matching are performed on the 3D model of the workpiece and the candidate blank model. Specifically, the 3D model of the workpiece and each candidate blank model are first imported into the same virtual coordinate system, and the spatial poses of the two are automatically aligned based on principal component analysis or the minimum bounding box algorithm to ensure that the major axis of the workpiece is consistent with the major axis of the blank. Subsequently, the system performs volume inclusion detection, that is, it determines whether all geometric entities of the 3D model of the workpiece are completely located inside the boundary of the candidate blank model. For candidate blanks that have local overflow or cannot completely contain the workpiece, they are directly eliminated. For candidate blanks that meet the inclusion condition, the matching degree index is further calculated. In this embodiment, the volume utilization rate is preferably used as the core index for quantifying the matching degree, that is, the ratio of the volume of the 3D model of the workpiece to the volume of the candidate blank model is calculated. The closer the ratio is to 1, the less material is removed and the higher the processing efficiency. The lower the cost, the better. Based on the calculated volume utilization rate, all candidate blank models that pass the inclusion test are sorted in descending order to generate a blank candidate sequence. For example, if the first blank in the sequence has a volume utilization rate of 85% and the second has 70%, the system will prioritize recommending the first blank as the best matching object. In addition, if the volume utilization rates are the same, the uniformity of the two in the distribution of processing allowance is further calculated, and the blank with a smaller variance in the allowance distribution is selected first, thereby constructing a blank candidate sequence that can both ensure processing integrity and achieve optimal material cost. This spatial mapping matching mechanism based on geometric features breaks the logical barrier between reverse scanning data and forward blank library data in the existing technology, establishes an automatic association channel between reverse point cloud and forward blank model, and effectively solves the problem of feature matching relying on manual intervention and data association discontinuity in the face of unknown workpieces in the existing CAM system.Secondly, by matching the workpiece feature set with the blank feature set to obtain a blank candidate sequence, and determining the target blank model accordingly, an automated selection system of "feature extraction-spatial matching-sequence optimization" is constructed at the algorithm layer. This provides an intelligent decision window for the rapid identification of unknown or randomly stacked workpieces, preventing the low efficiency and matching error risk caused by relying solely on human experience or simple presets. This significantly enhances the system's blank matching efficiency and automation level in non-standard and complex scenarios. Furthermore, by utilizing a mechanism that directly generates machining control instructions based on the determined target blank model and workpiece 3D model, seamless integration of the reverse reconstruction model and forward process planning data is achieved. This ensures that the autonomous identification results can be instantly converted into executable CNC code, avoiding the low efficiency and slow response of machining instruction generation caused by cumbersome model processing and lagging process parameter configuration in traditional solutions, thereby significantly improving efficiency. This invention improves the response speed of process planning and the continuity of CNC machining. Compared with existing technologies, it significantly improves the modeling accuracy of non-standard workpieces, the automation level of blank matching, and the response speed of process planning, overcoming the technical shortcomings of traditional solutions such as high reliance on manual labor, feature correlation discontinuity, and low instruction generation efficiency. Testing has verified that the blank matching time for shaft-type workpieces using this invention is 0.8s, while the existing technology's matching time is ±0.10mm, with an accuracy rate of 99.9% compared to 85.0%. For box-type workpieces, the matching time is 1.2s, while the existing technology's is 4.2s, with an accuracy rate of 98.6% compared to 80.3%. For irregularly shaped parts, the matching time is 1.5s, while the existing technology's is 5.0s, with an accuracy rate of 95.2% compared to 75.3%.

[0025] The following detailed explanation of the steps and flow of the workpiece autonomous recognition and CAM programming method based on a CNC system, using specific embodiments.

[0026] Specifically, in a specific embodiment of the present invention, the step of performing geometric feature analysis on the three-dimensional model of the workpiece and several candidate blank models includes: S31 filling the edges of the three-dimensional model of the workpiece, and performing contour line detection on the filled three-dimensional model of the workpiece and several candidate blank models to obtain the blank contour line and the workpiece contour line; S32 traversing the discrete points on the workpiece contour line and the blank contour line, and calculating the tangent direction vector of each discrete point distributed along the contour line path; S33 analyzing and obtaining the angle change range of adjacent tangent direction vectors, and identifying blank feature points and workpiece feature points based on the angle change range; S34 creating a workpiece feature set and several blank feature sets based on the blank contour line, the workpiece contour line, the blank feature points and the workpiece feature points.

[0027] Among them, such as Figure 2As shown, the model first needs to be preprocessed. To avoid jagged edges, noise, or small gaps on the model edges affecting the accuracy of subsequent contour extraction, the workpiece 3D model is first edge-filled. Morphological operations or interpolation algorithms are used to smooth and close the edges. Then, contour line detection operations are performed on the filled workpiece 3D model and several candidate blank models retrieved from the blank model library, thereby extracting the workpiece contour line representing the shape features of the workpiece and the blank contour line representing the shape features of each candidate blank. Next, in order to convert the continuous geometric shape into a computer-processable data sequence, it is necessary to traverse the discrete points on the workpiece contour line and the blank contour line, and calculate the tangent direction vector of each discrete point distributed along the contour line path. Here, a difference calculation method can be used, that is, the instantaneous tangent direction at the current point is determined according to the coordinate difference between the current point and its adjacent points, thereby establishing a vector field describing the contour direction. On this basis, the angle change amplitude between adjacent tangent direction vectors is analyzed and obtained in depth. The magnitude of the change directly reflects the curvature or bend of the contour line. For example, an angle change threshold can be preset. When the angle change between adjacent tangent vectors exceeds the preset threshold, it is determined that there is a drastic geometric change at that location, thus identifying the point as a key blank feature point or workpiece feature point. These feature points usually correspond to corners, tips, bends, or specific groove edges in the workpiece or blank geometry. Finally, based on the extracted blank contour line, workpiece contour line, and all identified blank and workpiece feature points, the path data of the contour line and the coordinate data of the feature points are structurally encapsulated and associated to create a workpiece feature set and several blank feature sets containing complete geometric description information. This implementation extracts feature points by analyzing the angle change of tangent vectors, which can accurately capture key geometric turning information on the model contour, transforming the complex graphic matching problem into an efficient correspondence problem of feature point sets, thereby significantly improving the computational efficiency and accuracy of subsequent spatial mapping matching.

[0028] Specifically, in a specific embodiment of the present invention, the step of performing contour line detection on the filled 3D model of the workpiece and several candidate blank models includes: S311 constructing a Gaussian sphere mapping model and mapping the normal vector directions of discrete points of the 3D model of the workpiece or candidate blank model to the Gaussian sphere mapping model, and obtaining a mapping record table; S312 obtaining the current projection direction, calculating the dot product between the projection direction and the normal vector directions of each discrete point in the mapping record table, and filtering out points whose dot product satisfies the preset orthogonality condition, and obtaining contour candidate points; S313 calculating the spatial distance between any two contour candidate points, determining whether the spatial distance is less than a preset adjacency threshold, and determining that points that satisfy the adjacency threshold have a connecting edge; S314 performing connectivity analysis and topological connection on all contour candidate points based on the connecting edge, thereby generating the workpiece contour line or blank contour line.

[0029] Among them, such as Figure 3As shown, in an embodiment of the present invention, a Gaussian sphere mapping model is first constructed. This Gaussian sphere mapping model is typically used as a unit sphere space to characterize the orientation distribution in three-dimensional space. The normal vector directions of all discrete points on the surface of the workpiece three-dimensional model or candidate blank model are uniformly mapped to this Gaussian sphere mapping model, thereby establishing a mapping record table containing the correspondence between point indexes and normal vectors. Subsequently, the currently set projection direction is obtained. This projection direction can be determined according to the machining perspective, the Z-axis direction of the machine tool coordinate system, or the observation line specified by the user. The dot product value between the projection direction and the normal vector direction of each discrete point in the mapping record table is calculated. Since the surface normal vector at the edge contour of an object is usually perpendicular to the observation line in three-dimensional geometry, it is necessary to select points whose dot product values ​​satisfy the preset orthogonality condition. As a preferred embodiment, points whose absolute value of the dot product value is less than a set small threshold are judged to satisfy the orthogonality condition. This small threshold is preferably set between 0.01 and 0.05. Setting this specific value range is based on the consideration that the three-dimensional scanning or reconstruction model is composed of discrete points, and absolute mathematical orthogonality is required. In discrete sampling, it is difficult to capture points accurately. If the threshold is set below 0.01, effective contour points are easily missed due to sampling deviation, which can lead to broken or discontinuous contour lines. If the threshold is set above 0.05, non-edge points that deviate excessively from the orthogonal plane will be misidentified as contour points, resulting in obvious widening or artifacts in the generated contour lines and reducing the contour positioning accuracy. In order to reconstruct these discrete points into continuous lines, the Euclidean distance between any two candidate contour points needs to be calculated, and it needs to be determined whether the distance is less than a preset adjacency threshold. The adjacency threshold is usually set according to the average density or sampling resolution of the original point cloud. As a specific embodiment, all discrete points of the workpiece 3D model or candidate blank model are traversed first, and the average distance between all adjacent points in the model is calculated. Considering the non-uniformity in the discretization process, in order to ensure the continuity of the contour and tolerate a certain sampling sparsity, the adjacency threshold is set to 1.5 to 2.5 times the average distance. For example, if the average sampling step size of the model's point cloud is 0.2 mm, the adjacency threshold is preferably set between 0.3 mm and 0.5 mm. Setting the lower limit to 1.5 times is to ensure that the vast majority of adjacent points can be connected, avoiding contour breakage; setting the upper limit to 2.5 times is to prevent incorrect connection edges from being generated across non-adjacent points; and two points that meet the adjacency threshold are determined to have a physical connection edge; finally, based on the determined connection edge, connectivity analysis and topological connection are performed on all contour candidate points, and the disordered point set is sorted and connected according to spatial adjacency relationship, and isolated noise points are eliminated, thereby generating closed or continuous workpiece contour lines or blank contour lines; this implementation method can quickly extract the model outer contour from any viewpoint based on the principles of differential geometry and Gaussian mapping, effectively eliminate the interference of the internal surface data of the model, and provide high signal-to-noise ratio geometric edge information for subsequent feature matching.

[0030] Specifically, in a specific embodiment of the present invention, the step of preprocessing the original point cloud data includes: scanning the workpiece to be processed to obtain the original point cloud data, converting the original point cloud data into depth image information; filtering the depth image information based on a Gaussian filtering algorithm, normalizing the filtered depth image information, and performing hole compensation processing on the normalized depth image information to obtain a three-dimensional model of the workpiece.

[0031] In this embodiment of the invention, a high-precision non-contact 3D scanning device, such as a blue light structured light scanner or a handheld LiDAR, is first used to scan the workpiece from multiple angles to obtain raw point cloud data containing a large number of discrete spatial coordinate points. Considering the high computational complexity and lack of topological relationships in directly processing large-scale scattered point clouds, the 3D spatial coordinates of the raw point cloud data are converted into 2D rasterized depth image information based on the principles of orthogonal projection or perspective projection. Specifically, the point cloud is projected onto the imaging plane along the principal optical axis, and the vertical distance from the projection point to the imaging plane is encoded as the grayscale value or intensity value of the corresponding pixel, thereby generating a grayscale depth map that can characterize the geometric undulations of the workpiece surface. Since the raw scanning data inevitably contains high-frequency noise caused by system errors or environmental interference, this embodiment uses a 2D Gaussian filtering algorithm to construct a convolution kernel of a specific size (e.g., a 3×3 or 5×5 template) to perform sliding window convolution operations on the depth image information. The core principle is to calculate the weighted average of the center pixel and its neighboring pixels based on the 2D Gaussian distribution function. The mathematical expression of the 2D Gaussian distribution function is as follows: ; in, x and y These represent the horizontal and vertical distances of neighboring pixels relative to the center pixel, respectively. This represents the standard deviation of the Gaussian distribution. The weight distribution generated based on this function presents a bell-shaped surface in geometric space, high in the center and low around the edges. This means that pixels closer to the center have a larger weight, and vice versa. This characteristic can be used to effectively smooth abrupt depth changes and filter out outlier high-frequency noise. To unify the data scale under different scanning devices or different measurement ranges, the filtered depth image information is normalized. A linear transformation method is used to map the depth values ​​of all pixels to a standard unit interval (e.g., between 0 and 1) or a specific gray level range (e.g., between 0 and 255), establishing a unified... The data serves as a baseline; subsequently, for invalid pixel areas (i.e., hole areas) formed in the depth image due to occlusion, high reflectivity, or light absorption, hole compensation processing is performed. Based on the effective depth information surrounding the holes, missing data is repaired and filled. Finally, the processed depth image is restored to spatial coordinates using inverse projection transformation, thereby reconstructing a continuous and smooth 3D model of the workpiece. This implementation transforms the complex point cloud topology repair problem into a mature 2D image processing problem, significantly reducing the computational load while preserving the key geometric features of the workpiece, and greatly improving the efficiency and quality of reverse modeling. Testing has verified that for shaft-type workpieces, the modeling error of this invention is ±0.02mm, while the traditional method has an error of ±0.10mm, representing an 80% improvement in accuracy. For box-type workpieces, the average error of this invention is ±0.03mm, while the traditional method has an average error of ±0.15mm, representing an 80% improvement in accuracy. For irregularly shaped parts, the average error of this invention is ±0.05mm, while the traditional method has an average error of ±0.20mm, representing a 75% improvement in accuracy.

[0032] Specifically, in this embodiment of the invention, the step of performing hole compensation processing on the normalized depth image information includes: detecting hole regions existing in the depth image information and identifying the boundary point positions of the hole regions; calculating the geometric angle between two adjacent sides on the boundary point, and supplementing the hole region with a triangular mesh according to the minimum angle principle to generate an initial supplemented mesh; extracting the mesh vertices of the initial supplemented mesh as control vertices, calculating the coordinates of the control vertices based on the Laplacian matrix, and constructing a target implicit surface expression by combining the radial basis functions with the control vertex coordinates; calculating the vertex projection coordinates of each vertex in the initial supplemented mesh according to the target implicit surface expression, and updating the initial supplemented mesh based on the vertex projection coordinates to complete the repair of the hole regions.

[0033] In a specific embodiment of the present invention, firstly, connected regions with depth values ​​of zero or invalid markers are detected by traversing the pixel matrix of the depth image to determine the hole region, and the ordered pixels at the edge of the hole region are extracted as boundary point positions; in order to construct a preliminary repair patch, the geometric angle between adjacent side vectors in the boundary point sequence is calculated, strictly following the principle of minimum angle, that is, the vertices with the smallest angle are connected first to form a triangle, and the process is gradually advanced inward until the hole is completely covered, thereby generating an initial supplementary mesh; since the initial mesh is generated only based on the boundary, the internal vertex distribution is uneven and lacks smoothness, this embodiment introduces a Laplacian matrix to optimize the mesh vertices to obtain control vertex coordinates, and constructs the Laplacian matrix, the expression of which is: ; in, Represents the Laplace matrix L The Middle i line, number j The numerical values ​​of the column elements. Indicates the first i One vertex, Representing vertices Degree, i.e., relative to the vertex The number of directly connected adjacent vertices. Represents vertices The set of first-order adjacent vertices, that is, all vertices directly adjacent to... Vertices connected by edges j The set of vertices is used to obtain uniformly distributed control vertices by solving the matrix equation. Based on this, radial basis functions are used to construct a target implicit surface expression that accurately describes the geometric features of the hole surface. The general formula of this expression is defined as: ; ; in, Represents any point in space r The implicit function value at that location. n This indicates the total number of control vertices selected. j For summation index variables, Indicates the first j The weight coefficients corresponding to each basis function. Indicates the first j The center coordinates of each control vertex Representing a spatial point r With the j Control Center The Euclidean distance between them This represents the selected radial basis kernel function. This represents the linear polynomial term used to ensure the uniqueness of the equation and to fit the global trend; Let represent the constant term coefficient and the linear term coefficient of the linear polynomial, respectively. To determine the specific surface equation, this embodiment selects a cubic function as the specific basis function. The optimized control vertex positions are substituted into the above formula to construct a system of linear equations. The unknown weight coefficients and polynomial coefficients are then solved, and the specific implicit surface expression of the target is finally obtained as follows: ; in, Represents any coordinate point in space The implicit function value at a point, when the value is 0, indicates that the point lies on the reconstructed surface; This represents the solution obtained by solving the aforementioned matrix equation. i The weight coefficients corresponding to each control vertex. Indicates the first i The known spatial coordinates of each control vertex This represents the coordinates of any spatial point that needs to be evaluated. Finally, the function values ​​of each vertex in the initial supplementary mesh are calculated based on this implicit surface expression, and the vertices are projected onto the surface along the normal gradient direction. On the zero isosurface, the geometry of the initial mesh is updated, thus achieving high-precision, C2-continuous smooth repair of the hole region.

[0034] Specifically, in a specific embodiment of the present invention, the method further includes constructing an autonomously assembled 3D model, which specifically involves: establishing a 3D drawing interactive interface and constructing a primitive library, the primitive library including several basic geometric primitives; receiving primitive call instructions from the 3D drawing interactive interface and retrieving target primitives according to the primitive call instructions; calculating the geometric center of the target primitives and calibrating the horizontal central axis of the target primitives based on the geometric center; aligning the target primitives along the horizontal central axis; collecting set starting angle parameters and ending angle parameters, and performing segmentation transformation on the aligned target primitives based on the starting angle parameters and ending angle parameters; using a constructive solid geometry Boolean union operation algorithm to solidly assemble the segmented and transformed target primitives along the horizontal central axis to generate an assembled model; and performing rounded corner smoothing transition processing on the joint position of the assembled model to generate an autonomously assembled 3D model, which is used as a workpiece 3D model for geometric feature analysis and generation of machining control instructions.

[0035] In this embodiment of the invention, this step serves as a second parallel implementation path for acquiring the 3D model of the workpiece, specifically applied to processing scenarios where physical samples are lacking or the design phase is underway: First, a 3D drawing interactive interface based on a graphics processing interface is established, and a pre-built primitive library is constructed in the background database. This primitive library includes several basic geometric primitives such as cylinders, cuboids, cones, and tori. Primitive call commands triggered by the user on the 3D drawing interactive interface are received, such as drag-and-drop or click operations. The target primitive is instantiated from the primitive library according to the primitive call command. To ensure the consistency of the reference for subsequent splicing, the geometric center of the target primitive is calculated, for example, by calculating the center point coordinates of the minimum bounding box (AABB), and based on this geometric center coordinates... The horizontal center axis of the target graphic element is typically defined as the axis that passes through the geometric center and extends along the main length direction of the graphic element. Then, the target graphic element is aligned along this horizontal center axis by using translation and rotation transformation matrices to move it to the preset splicing reference axis of the global coordinate system. To achieve flexible construction of non-standard shapes, user-defined starting and ending angle parameters are collected, for example, a starting angle of 0 degrees and an ending angle of 180 degrees. The system establishes a local polar coordinate system based on the horizontal center axis of the graphic element, converting the starting and ending angle parameters into two mathematical cutting planes passing through the center axis. Specifically, the normal vector of the cutting plane is determined by calculating the sine and cosine values ​​of the angles. Then, these two... Each cutting plane performs Boolean intersection or mesh cutting on the target primitives after alignment with the axis, removing geometric data outside the angular sectors. To address potential model cross-section damage or the formation of non-closed hollow surfaces due to the cutting operation, a topology repair procedure is further executed. This identifies open and closed loops formed by the cutting edges and uses a constrained Delaunay triangulation algorithm to automatically generate polygonal mesh patches covering the cross-section. The vertices of the newly generated patches are then welded and merged with the vertices of the original meshes to ensure that the generated segmented primitives are watertight solid models. Next, a solid geometry Boolean union operation algorithm is used to detect overlapping areas in space among the multiple target primitives after the segmentation transformation, remove redundant internal patches, reconstruct the surface topology, and then solidly stitch them together along the transverse central axis. The system combines elements to generate a topologically continuous spliced ​​model. Considering the manufacturability of machining, the joint positions of the spliced ​​model (i.e., the intersections between primitives) must be rounded for smooth transition. By identifying common edges and applying a rounding algorithm, a smooth transition surface with a specific radius is generated, ultimately producing an autonomously spliced ​​3D model. This autonomously spliced ​​3D model is then directly marked as the workpiece 3D model by the system without undergoing a scanning step, and directly enters the subsequent geometric feature analysis and machining control command generation process. This implementation method allows users to quickly construct complex workpiece models that conform to machining logic without physical objects by combining parametric entity splicing of basic geometric primitives with angle-based segmentation transformation, greatly expanding the system's applicable scenarios.

[0036] Specifically, in an embodiment of the present invention, the step of generating machining control instructions based on the workpiece 3D model and the target blank model includes: identifying key geometric feature points of the workpiece 3D model, the key geometric feature points including contour edge points and inflection points; calculating machining process parameters based on the key geometric feature points, the machining process parameters including workpiece origin coordinates, blank end face size parameters and workpiece end face size parameters; planning a machining path according to the machining process parameters and compiling the machining path into machining control instructions; outputting the machining control instructions to the verification interaction interface, and executing workpiece machining operations based on the machining control instructions after receiving a confirmation signal regarding the machining control instructions.

[0037] In this embodiment of the invention, the first step is to perform deep geometric analysis on the 3D model of the workpiece generated by reverse reconstruction or autonomous splicing to identify key geometric feature points of the workpiece 3D model. This process can be specifically achieved by calculating the curvature extrema of the grid vertices on the model surface. Points with curvature exceeding a preset curvature threshold are marked as inflection points. The preset curvature threshold is set based on historical data. These inflection points usually correspond to the corners or edge turning points of the workpiece. At the same time, the outer boundary of the model on the projection plane is traversed to extract contour edge points, thereby constructing a feature point set containing the geometric skeleton information of the workpiece. Next, based on the extracted key geometric feature points, specific machining process parameters are calculated. The system automatically establishes a workpiece coordinate system, for example, selecting the geometric center or a specific corner of the bottom contour of the workpiece as the workpiece origin coordinates. At the same time, the minimum bounding box size of the target blank model is calculated to obtain the blank end face size parameters, and the maximum outer contour size of the workpiece 3D model is calculated to obtain the workpiece end face size parameters. By comparing these two sets of size parameters, the system can accurately calculate the distribution of the cutting allowance in each direction. Based on this, according to the calculated machining process parameters... The system plans the machining path and selects appropriate tool path strategies for different allowance distribution areas. For example, it plans a layered reciprocating roughing path in areas with large allowances and a wraparound finishing path in areas with contour edges. Based on the standard instruction set of the CNC machine tool, the planned three-dimensional spatial trajectory is discretized and compiled into machining control instructions. In this embodiment, the machining control instructions are specifically machining G-code, which includes action sequences such as tool movement coordinates, spindle speed, and coolant switching. Finally, to ensure machining safety, the compiled machining control instructions are output to the verification interface of the CNC system. The cutting process is dynamically simulated on the interface through a three-dimensional simulation engine. The operator can visually check whether there is interference or overcutting on the path through this interface. After receiving the operator's confirmation signal for the machining control instructions, the instructions are sent to the motion controller, which drives the servo motor to perform the actual workpiece machining operation based on the machining control instructions. This implementation method can realize fully automated process planning from geometric feature analysis to motion instruction generation, significantly reducing the tediousness and error rate of manual programming while ensuring machining accuracy.

[0038] Specifically, in a specific embodiment of the present invention, it further includes adaptive path planning based on material removal volume, which specifically involves: performing Boolean difference operations on the target blank model and the workpiece 3D model to generate a model to be cut; planning an initial tool path in the model to be cut, and performing discretized volume analysis on the model to be cut along the initial tool path to obtain the instantaneous material removal amount distributed along the path; comparing the instantaneous material removal amount with a preset cutting load threshold, adjusting the feed rate parameters of the initial tool path according to the comparison result to generate an optimized machining path; compiling the optimized machining path into machining control instructions, outputting them to the verification interaction interface, and executing workpiece machining operations based on the machining control instructions after receiving a confirmation signal regarding the machining control instructions.

[0039] Among them, such as Figure 5In a specific embodiment of the present invention, this step is defined as an optimization method in the machining instruction generation process. By default, conventional path planning is performed. However, when the system detects that the workpiece material hardness is higher than a preset benchmark, such as difficult-to-machine materials like titanium alloys, or when the geometric feature analysis results show that the allowable fluctuation of the remaining material in the machining area exceeds the fluctuation tolerance threshold set based on the current tool load characteristics, it will automatically switch to or prompt the user to select the adaptive path planning mode to replace the conventional mode in generating the final instruction. First, based on the construction of solid geometry technology, Boolean difference set operation is performed on the target blank model and the workpiece 3D model, that is, the solid volume of the blank is subtracted from the solid volume of the workpiece, thereby accurately generating a cutting model representing all the material to be removed. Then, an initial tool path covering all machining areas is planned on the cutting model. In order to accurately control the cutting force, the initial path is not directly used for machining. Instead, the tool movement process is discretized into several small sampling steps along the path trajectory. For example, a sampling node is set every 0.1 mm. The volume intersection of the swept body formed by the simulated tool movement along the path and the cutting model is calculated to obtain the final instruction. The system takes the instantaneous material removal amount at each sampling point along the path; then compares this instantaneous material removal amount with a preset cutting load threshold point by point. This cutting load threshold is usually set based on the maximum allowable cutting force provided by the tool manufacturer or on the tool breakage limit data in the historical machining database. When the instantaneous material removal amount at a certain point exceeds the threshold, the system automatically reduces the feed rate parameter of that section proportionally according to the constant power cutting principle. Conversely, it appropriately increases the feed rate in the idle stroke or light cutting area with a small removal amount. This dynamic adjustment generates an optimized machining path with uniform load. Finally, the optimized machining path is compiled into machining control instructions that can be recognized by the CNC machine tool by the post-processing program, and output to the verification interactive interface for three-dimensional visualization of cutting simulation. After receiving the operator's confirmation signal for the machining control instructions, the instructions are sent to the machine tool controller to execute the workpiece machining operation based on the machining control instructions. This implementation method can upgrade CNC machining from traditional constant speed cutting to constant load cutting, effectively preventing tool overload and breakage due to sudden changes in local allowance, while maximizing the exploitation of machine tool performance to improve overall machining efficiency.

[0040] This application also provides a workpiece autonomous recognition and CAM programming system based on a CNC system, such as Figure 6As shown, it includes: a workpiece model construction module, which acquires the original point cloud data of the workpiece to be processed, preprocesses the original point cloud data, and constructs a 3D model of the workpiece to be processed; a workpiece blank modeling module, which constructs a blank model library, which includes several candidate blank models; a geometric feature analysis module, which performs geometric feature analysis on the 3D model of the workpiece and several candidate blank models to obtain a workpiece feature set and several blank feature sets; a spatial mapping and matching module, which performs spatial mapping and matching between the workpiece feature set and the blank feature set corresponding to each candidate blank model to obtain a blank candidate sequence; and a machining instruction generation module, which determines the target blank model based on the blank candidate sequence and generates machining control instructions based on the 3D model of the workpiece and the target blank model.

[0041] Specifically, in a specific embodiment of the present invention, the geometric feature analysis module includes: a model contour detection unit, which performs edge filling on the 3D model of the workpiece and performs contour line detection on the filled 3D model of the workpiece and several candidate blank models to obtain the blank contour line and the workpiece contour line; a tangent vector calculation unit, which traverses the discrete points on the workpiece contour line and the blank contour line and calculates the tangent direction vector of each discrete point distributed along the contour line path; a feature point identification unit, which analyzes and obtains the angle change range of adjacent tangent direction vectors and identifies blank feature points and workpiece feature points according to the angle change range; and a feature set construction unit, which creates a workpiece feature set and several blank feature sets based on the blank contour line, the workpiece contour line, the blank feature points, and the workpiece feature points.

[0042] As described above, the present invention relates to a workpiece autonomous recognition and CAM programming method based on a CNC system, comprising: S1 acquiring the original point cloud data of the workpiece to be processed, and preprocessing the original point cloud data to construct a three-dimensional model of the workpiece; S2 constructing a blank model library, the blank model library including several candidate blank models; S3 performing geometric feature analysis on the three-dimensional model of the workpiece and the several candidate blank models to obtain a workpiece feature set and several blank feature sets; S4 performing spatial mapping matching between the workpiece feature set and the blank feature set corresponding to each candidate blank model to obtain a blank candidate sequence; S5 determining the target blank model according to the blank candidate sequence, and generating machining control instructions based on the three-dimensional model of the workpiece and the target blank model. Specifically, by performing geometric feature analysis and spatial mapping matching on the 3D model of the workpiece and candidate blank models, this geometric feature-driven spatial mapping matching mechanism breaks down the logical barrier between reverse scanning data and forward blank library data in existing technologies. It establishes an automatic association channel between the reverse point cloud and the forward blank model, effectively solving the problems of reliance on manual intervention and data association gaps in feature matching when facing unknown workpieces in existing CAM systems. Secondly, by matching the workpiece feature set with the blank feature set to obtain a blank candidate sequence, and then determining the target blank model accordingly, an automated selection system of "feature extraction-spatial matching-sequence optimization" is constructed at the algorithm layer. This provides an intelligent decision-making window for the rapid identification of unknown or randomly stacked workpieces, preventing inefficient blank selection due to reliance on manual experience or simple presets. This invention significantly improves the efficiency and automation level of blank matching in non-standard and complex scenarios by reducing the risk of low efficiency and matching errors. It utilizes a mechanism that directly generates machining control instructions based on a defined target blank model and workpiece 3D model, achieving seamless integration between reverse reconstruction model and forward process planning data. This ensures that the autonomous identification results can be instantly converted into executable CNC code, avoiding the low efficiency and slow response of machining instruction generation caused by cumbersome model processing and delayed process parameter configuration in traditional solutions. This greatly improves the response speed of process planning and the continuity of CNC machining. Compared with existing technologies, this invention significantly improves the modeling accuracy of non-standard workpieces, the automation level of blank matching, and the response speed of process planning, overcoming the technical shortcomings of high manual dependence, feature correlation discontinuity, and low instruction generation efficiency in traditional solutions.

[0043] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for autonomous workpiece recognition and CAM programming based on a numerical control system, characterized in that, include: S1 acquires the original point cloud data of the workpiece to be processed, and preprocesses the original point cloud data to construct a three-dimensional model of the workpiece to be processed. S2 constructs a blank model library, which includes several candidate blank models; S3 performs geometric feature analysis on the three-dimensional model of the workpiece and several candidate blank models to obtain the workpiece feature set and several blank feature sets. S4 performs spatial mapping matching between the workpiece feature set and the blank feature set corresponding to each candidate blank model to obtain a blank candidate sequence. S5 determines the target blank model based on the blank candidate sequence, and generates machining control instructions based on the workpiece 3D model and the target blank model.

2. The workpiece autonomous recognition and CAM programming method based on a CNC system according to claim 1, characterized in that, The steps involve performing geometric feature analysis on the 3D model of the workpiece and several candidate blank models, including: Edge filling is performed on the 3D model of the workpiece, and contour line detection is performed on the filled 3D model of the workpiece and several candidate blank models to obtain the blank contour line and the workpiece contour line. Traverse the discrete points on the workpiece contour line and the blank contour line, and calculate the tangent direction vector of each discrete point distributed along the contour line path. Analyze and obtain the angle change range between adjacent tangent direction vectors, and identify blank feature points and workpiece feature points based on the angle change range; Based on the blank outline, workpiece outline, blank feature points, and workpiece feature points, create a workpiece feature set and several blank feature sets.

3. The workpiece autonomous recognition and CAM programming method based on a CNC system according to claim 2, characterized in that, The step involves performing contour line detection on the filled 3D model of the workpiece and several candidate blank models, including: Construct a Gaussian sphere mapping model, and map the normal vector directions of discrete points of the workpiece 3D model or the candidate blank model to the Gaussian sphere mapping model, and obtain a mapping record table; Obtain the current projection direction, calculate the dot product between the projection direction and the normal vector direction of each discrete point in the mapping record table, and filter out the points whose dot product satisfies the preset orthogonality condition to obtain contour candidate points; Calculate the spatial distance between any two candidate contour points, determine whether the spatial distance is less than a preset adjacency threshold, and determine the points that satisfy the adjacency threshold as having a connecting edge; Based on the connecting edges, connectivity analysis and topological connection are performed on all the candidate contour points to generate the workpiece contour line or the blank contour line.

4. The workpiece autonomous recognition and CAM programming method based on a CNC system according to claim 1, characterized in that, The step involves preprocessing the raw point cloud data, including: The workpiece to be processed is scanned to obtain raw point cloud data, and the raw point cloud data is converted into depth image information; The depth image information is filtered using a Gaussian filtering algorithm, then normalized, and finally subjected to hole compensation processing to obtain a three-dimensional model of the workpiece.

5. The workpiece autonomous recognition and CAM programming method based on a CNC system according to claim 4, characterized in that, The step involves performing hole compensation processing on the normalized depth image information, including: Detect hole regions in the depth image information and identify the boundary point positions of the hole regions; Calculate the geometric angle between two adjacent sides at the boundary point, and supplement the hole area with a triangular mesh according to the principle of minimum angle to generate an initial supplementary mesh; The vertices of the initial supplementary mesh are extracted as control vertices. The coordinates of the control vertices are calculated based on the Laplacian matrix. The radial basis functions are combined with the coordinates of the control vertices to construct the target implicit surface expression. The vertex projection coordinates of each vertex in the initial supplementary mesh are calculated based on the target implicit surface expression, and the initial supplementary mesh is updated based on the vertex projection coordinates to complete the repair of the hole region.

6. The workpiece autonomous recognition and CAM programming method based on a CNC system according to claim 1, characterized in that, This also includes constructing autonomously assembled 3D models, specifically: A 3D drawing interactive interface is established, and a primitive library is constructed, which includes several basic geometric primitives; Receive the primitive calling instruction from the three-dimensional drawing interactive interface, and retrieve the target primitive according to the primitive calling instruction; Calculate the geometric center of the target primitive and mark the lateral central axis of the target primitive based on the geometric center; The target graphic elements are aligned along the horizontal center axis. The set starting angle parameters and ending angle parameters are collected, and the target primitive after axis alignment is segmented and transformed based on the starting angle parameters and the ending angle parameters. The target primitives after segmentation and transformation are assembled along the horizontal central axis using a constructive entity geometric Boolean union operation algorithm to generate a spliced ​​model. The joint positions of the spliced ​​models are smoothed by rounding corners to generate an autonomously spliced ​​3D model. This autonomously spliced ​​3D model is used as the 3D model of the workpiece for geometric feature analysis and generation of machining control commands.

7. The workpiece autonomous recognition and CAM programming method based on a CNC system according to claim 1, characterized in that, The step of generating machining control instructions based on the workpiece 3D model and the target blank model includes: Identify the key geometric feature points of the workpiece's three-dimensional model, including contour edge points and inflection points; Based on the key geometric feature points, the machining process parameters are calculated. The machining process parameters include the workpiece origin coordinates, blank end face size parameters, and workpiece end face size parameters. The machining path is planned according to the machining process parameters, and the machining path is compiled into machining control instructions; The machining control command is output to the verification interface, and after receiving a confirmation signal for the machining control command, the workpiece machining operation is executed based on the machining control command.

8. The workpiece autonomous recognition and CAM programming method based on a CNC system according to claim 7, characterized in that, It also includes adaptive path planning based on material removal volume, specifically: Perform a Boolean difference operation on the target blank model and the workpiece 3D model to generate a model to be cut; An initial tool path is planned in the model to be cut, and a discretized volume analysis is performed on the model to be cut along the initial tool path to obtain the instantaneous material removal amount distributed along the path; The instantaneous material removal amount is compared with a preset cutting load threshold, and the feed rate parameters of the initial tool path are adjusted according to the comparison result to generate an optimized machining path. The optimized machining path is compiled into machining control instructions, output to the verification interface, and after receiving a confirmation signal for the machining control instructions, the workpiece machining operation is executed based on the machining control instructions.

9. A workpiece autonomous recognition and CAM programming system based on a numerical control system, characterized in that, The system includes: The workpiece model construction module acquires the original point cloud data of the workpiece to be processed, and preprocesses the original point cloud data to construct a three-dimensional model of the workpiece to be processed. The workpiece blank modeling module constructs a blank model library, which includes several candidate blank models. The geometric feature analysis module performs geometric feature analysis on the three-dimensional model of the workpiece and several candidate blank models to obtain the workpiece feature set and several blank feature sets. The spatial mapping and matching module performs spatial mapping and matching between the workpiece feature set and the blank feature set corresponding to each candidate blank model to obtain a blank candidate sequence. The machining instruction generation module determines the target blank model based on the blank candidate sequence and generates machining control instructions based on the workpiece 3D model and the target blank model.

10. The workpiece autonomous recognition and CAM programming system based on a CNC system according to claim 9, characterized in that, The geometric feature analysis module includes: The model contour detection unit performs edge filling on the workpiece 3D model and performs contour line detection on the filled workpiece 3D model and several candidate blank models to obtain the blank contour line and the workpiece contour line. The tangent vector calculation unit traverses the discrete points on the workpiece contour line and the blank contour line, and calculates the tangent direction vector of each of the discrete points distributed along the contour line path. The feature point identification unit analyzes and obtains the angle change range between adjacent tangent direction vectors, and identifies blank feature points and workpiece feature points based on the angle change range. The feature set construction unit creates a workpiece feature set and several blank feature sets based on the blank outline, workpiece outline, blank feature points, and workpiece feature points.