Wooden door three-dimensional model parameterization design and numerical control code generation method and system
By employing multispectral imaging and intelligent adaptive planning methods, the problem of insufficient identification of internal wood defects and textures in wooden door processing has been solved, enabling high-precision, adaptive CNC machining and improving finished product quality and material utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-04-14
AI Technical Summary
Existing visible light-based vision systems struggle to accurately identify subtle defects and textures within wood during the processing of wooden doors. This results in a mismatch between carved textures and natural textures, leading to burrs or chipped edges, which negatively impacts the quality of the finished product and the utilization rate of materials.
Multispectral imaging equipment is used to acquire multi-band images of the wood surface. The contrast between texture and defect features is enhanced by band weighting and edge enhancement algorithms. A mapping rule base is established by combining historical data, and the tool path and cutting parameters are adaptively adjusted to generate CNC code that matches the characteristics of the wood.
It achieves high-precision, adaptive CNC machining, avoiding defective areas and following the wood grain, thereby improving the quality of finished products and the utilization rate of materials.
Smart Images

Figure CN121859533A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of woodworking CNC machining and computer vision technology, and in particular to a method and system for parametric design of three-dimensional models of wooden doors and generation of CNC codes. Background Technology
[0002] In modern high-end customized wooden door manufacturing, there is a demand for processing complex relief patterns on the surface of wooden doors. This application scenario requires CNC machining systems to not only identify macroscopic defects on the wood surface (such as knots and cracks), but also to adapt to its natural grain direction and hardness distribution in order to achieve high-quality automated carving and preserve the natural beauty of the wood to the greatest extent.
[0003] Currently, one existing solution to address this technological need is to use a visible light-based machine vision system. This solution acquires high-resolution images of the wood surface using an industrial camera and employs traditional image processing algorithms (such as thresholding and edge detection) to identify obvious defect areas. Subsequently, the system performs simple Boolean operations on a pre-set 3D relief model and the identified defect locations, thereby avoiding these areas when generating toolpaths and ultimately generating standardized CNC machining code.
[0004] However, the existing solution has significant drawbacks: First, visible light imaging is easily affected by ambient light, wood surface reflection, and color depth, making it insufficient for identifying internal defects with blurred textures and slight color differences (such as dark cracks and insect infestation) as well as texture direction, leading to missed or false detections of defects; Second, its obstacle avoidance strategy is mechanically rigid, simply skipping over defect areas without dynamically adjusting the tool feed rate, cutting depth, and tool path according to texture direction and hardness changes, often resulting in mismatch between the carved texture and the natural wood texture, and burrs or chipping during processing in areas surrounding defects, seriously affecting the quality of finished products and material utilization. Summary of the Invention
[0005] The purpose of this application is to provide a method, system, electronic device and storage medium for parametric design of three-dimensional models of wooden doors and generation of CNC codes, so as to solve the problem that the existing visible light-based vision system has insufficient ability to identify internal defects and fine textures of wood.
[0006] To address the aforementioned technical problems, in a first aspect, this application provides a method for parametric design of a 3D model of a wooden door and generation of CNC code, comprising: A multispectral imaging device is set up at the raw material feeding station. The multispectral imaging device is used to collect surface image data of the wood board to be processed, and multiple light sources of specific wavelengths are used to illuminate the surface of the wood board to obtain multispectral images under different bands. The multispectral image is processed by optical signal processing based on band weighting algorithm and edge enhancement algorithm, and the contrast between wood surface texture and defect features is enhanced by fusing the surface image data corresponding to different bands to generate a high-definition wood feature map. Based on predefined empirical rules and historical processing data, a mapping rule base between the wood feature atlas and CNC machining parameters is established. The wood feature map is superimposed and analyzed with the preset three-dimensional relief model. Based on the tool selection strategy and cutting parameter combination corresponding to different texture features in the mapping rule library, texture adaptive path planning is applied to adjust the tool path, cutting depth and feed rate of CNC tool so that the engraved pattern avoids the defect area of wood and is optimized along the texture direction. Based on the results of overlay analysis and path adjustment, CNC code matching the characteristics of raw materials is generated. At the same time, the spindle speed is adjusted according to the hardness distribution of the wood to be processed, which is used to control the CNC machine tool to complete the processing of wooden doors.
[0007] Optionally, the wood feature map is overlaid and analyzed with a preset 3D relief model, and based on the tool selection strategy and cutting parameter combination corresponding to different texture features in the mapping rule base, texture adaptive path planning is applied to adjust the tool path, cutting depth, and feed rate of the CNC tool, including: The wood feature map is matched with the three-dimensional relief model in the spatial coordinate system. The mapping relationship between each position point on the surface of the three-dimensional relief model and the wood feature information is established. The texture direction data, defect area marking data and material hardness data of each position point are extracted from the wood feature map. Based on the mapping rule base, query the recommended tool type, recommended depth of cut range, and recommended feed rate range corresponding to the feature type of each location point; The tool path direction is adjusted according to the texture direction data, and the defect boundary position is identified according to the defect area marking data. The tool movement trajectory is replanned to avoid the defect area, and a protection range is set around the defect area. Based on the material hardness data, interpolation calculations are performed within the recommended cutting depth range and the recommended feed rate range to determine the specific cutting depth value and feed rate value for each position point. Connect the adjusted toolpaths of each position point to form a continuous machining path, and record the tool type, depth of cut, and feed rate parameters corresponding to each path segment.
[0008] Optionally, based on the material hardness data, interpolation calculations are performed within the recommended depth of cut range and the recommended feed rate range to determine the specific depth of cut and feed rate value at each location point, including: Convert the material hardness data at each location point into a relative hardness percentage value, representing the ratio between the current location hardness and the maximum hardness value; Obtain the recommended cutting depth range and recommended feed rate range provided for the feature type from the mapping rule base; Based on the relative hardness percentage value, the specific cutting depth value is calculated within the recommended cutting depth range using an inverse linear relationship, and the specific feed rate value is calculated within the recommended feed rate range using an inverse linear relationship. The above interpolation calculation process is performed sequentially for each position point on the machining path to obtain the final cutting depth parameters and feed rate parameters for all position points. The calculated cutting parameters are associated with and stored with the corresponding position coordinate information to form a complete machining parameter dataset.
[0009] Optionally, optical signal processing is performed on the multispectral image based on a band-weighted algorithm and an edge enhancement algorithm, and the contrast between wood surface texture and defect features is enhanced by fusing the surface image data corresponding to different bands, generating a high-definition wood feature map, including: Analyze the prominence of features in each band image and assign an importance coefficient to each band image based on the prominence. Images of each band with importance coefficients are superimposed and fused to generate a preliminary composite image. The preliminary composite image is then subjected to contour enhancement processing to improve the clarity of wood surface texture and defect boundaries. The image after contour enhancement is fused with the images of each band to generate a high-definition wood feature map containing wood texture direction, defect identification and material hardness data.
[0010] Optionally, based on predefined empirical rules and historical processing data, a mapping rule base between the wood feature atlas and CNC machining parameters is established, including: Collect feature data, CNC machining parameters, and processing quality data from historical processing processes, and group the feature data, CNC machining parameters, and processing quality data according to the type of wood characteristics; Based on preset empirical rules, recommended initial CNC machining parameters are set for each of the aforementioned wood feature types, and the recommended values are optimized and adjusted based on historical data. Establish the correspondence between the wood feature types and the recommended values of the optimized and adjusted CNC machining parameters, organize the correspondence into a mapping rule library.
[0011] Optionally, based on the results of overlay analysis and path adjustment, CNC code matching the characteristics of the raw materials is generated, including: Obtain toolpath data after texture-adaptive path planning adjustment, including path coordinate sequence and cutting depth parameters and feed rate parameters at each position point; The path coordinate sequence is converted into motion commands that can be recognized by the CNC machine tool to ensure a smooth transition of the machining path; For each position point, a corresponding depth control command is generated based on the cutting depth parameter to achieve precise control of the cutting depth. At the same time, a corresponding speed control command is generated based on the feed rate to achieve dynamic adjustment of the feed rate. The motion commands, depth control commands, and speed control commands are arranged and combined in the processing order, and necessary machine tool auxiliary function commands are added to finally generate a CNC machining code file that perfectly matches the characteristics of the wood raw material.
[0012] Optionally, the spindle speed can be adjusted simultaneously according to the hardness distribution of the wood to be processed, in order to control the CNC machine tool to complete the processing of wooden doors, including: Extract the hardness distribution data of the area to be processed from the wood feature map, and obtain the hardness value of each processing position on the tool processing path; Based on the preset correspondence between the hardness value and the spindle speed, the spindle speed value corresponding to each machining position is determined; During the CNC code generation process, corresponding spindle speed control instructions are added for each machining position; The spindle speed control command is associated with the corresponding machining position command to generate a complete CNC machining program that includes dynamic spindle speed adjustment function.
[0013] Secondly, this application provides a parametric design and CNC code generation system for a three-dimensional model of a wooden door, including: The acquisition module is used to set the multispectral imaging device at the raw material feeding station, acquire surface image data of the wood board to be processed through the multispectral imaging device, and illuminate the surface of the wood board with multiple specific wavelength light sources to obtain multispectral images under different bands. The fusion module is used to perform optical signal processing on the multispectral image based on the band weighting algorithm and the edge enhancement algorithm, and enhance the contrast of wood surface texture and defect features by fusing the surface image data corresponding to different bands to generate a high-definition wood feature map. A module is established to create a mapping rule base between the wood feature atlas and CNC machining parameters based on predefined empirical rules and historical processing data. The adjustment module is used to overlay and analyze the wood feature map with the preset three-dimensional relief model, and apply texture adaptive path planning to adjust the tool path, cutting depth and feed rate of the CNC tool according to the tool selection strategy and cutting parameter combination corresponding to different texture features in the mapping rule library, so that the engraved pattern avoids the defect area of the wood and is optimized along the texture direction. The analysis module generates CNC code that matches the characteristics of the raw materials based on the results of overlay analysis and path adjustment. At the same time, it adjusts the spindle speed according to the hardness distribution of the wood to be processed, which is used to control the CNC machine tool to complete the processing of wooden doors.
[0014] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the parametric design and CNC code generation method for a three-dimensional model of a wooden door as described in the first aspect above.
[0015] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps of the parametric design and CNC code generation method for a three-dimensional model of a wooden door as described in the first aspect above.
[0016] This application provides a method for parametric design of a 3D model of a wooden door and generation of CNC code. By setting a multispectral imaging device at the raw material loading station and using multi-wavelength light sources to acquire multispectral images, it can obtain raw data containing deep information about the wood surface. Through optical signal processing and data fusion based on band weighting and edge enhancement algorithms, it can significantly enhance the contrast of wood texture and defect features, generating a high-definition feature map. By establishing a mapping rule base between the feature map and processing parameters based on empirical rules and historical data, it can transform visual features into executable processing strategies. By superimposing and analyzing the feature map with a 3D relief model and applying texture adaptive path planning, it can intelligently adjust the tool path and cutting parameters to avoid defects and follow the grain. By generating CNC code that matches the characteristics of the raw materials and adjusting the spindle speed according to the hardness, it ultimately achieves high-precision, adaptive CNC machining, improving the quality of finished products and material utilization.
[0017] Furthermore, by precisely mapping the wood feature map to the 3D model in spatial coordinates, the texture direction, defect markers, and hardness data of each location point are extracted. The mapping rule library is then consulted to obtain the corresponding recommended range of tools and parameters. The tool path is adjusted according to the texture direction, the trajectory is replanned based on the defect markers, and a protection range is set. Finally, specific cutting parameters are determined by interpolation based on the hardness data, and these are connected to form a continuous, optimized machining path. This achieves refined and dynamic adjustment of the machining path and parameters, ensuring that the carving process not only accurately avoids defects but also follows the natural grain of the wood and adapts to changes in hardness, thereby greatly improving machining accuracy, surface quality, and tool life. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of 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.
[0019] Figure 1 A flowchart illustrating a method for parametric design of a three-dimensional model of a wooden door and generation of CNC code, provided in an embodiment of this application; Figure 2 This is a schematic diagram of a parametric design and CNC code generation system for a three-dimensional model of a wooden door, provided in an embodiment of this application. Detailed Implementation
[0020] Currently, in the field of CNC relief carving for wooden doors, visible light-based visual inspection systems have significant limitations. These systems are easily affected by ambient light and reflections from the wood surface, making it difficult to accurately identify subtle internal defects (such as cracks and insect damage) and precisely determine the direction of natural grain. Furthermore, their processing strategies typically only mechanically avoid identified defect areas, failing to dynamically adjust processing parameters based on the natural grain direction and local hardness variations of the wood. This leads to problems such as grain mismatch, chipping around defects, or burrs during processing, affecting not only the aesthetics and quality of the finished product but also reducing the utilization rate of high-quality wood.
[0021] To address the aforementioned issues, this application proposes a method for 3D modeling and CNC machining of wooden doors based on multispectral imaging and intelligent adaptive planning. The core of this method lies in: acquiring multi-band images of the wood surface using multispectral imaging technology, and employing a dedicated algorithm to enhance the contrast between texture and defect features, generating a high-resolution feature map; then, constructing a mapping rule base between the map features and machining parameters by combining historical data; finally, dynamically adjusting the tool path, cutting parameters, and spindle speed by overlaying and analyzing the feature map with a 3D relief model. This method not only more accurately identifies various wood defects but also enables the carving path to actively adapt to the wood texture direction and hardness distribution, thereby significantly improving processing quality and material utilization while avoiding defects, achieving a technological leap from "passive avoidance" to "active adaptation."
[0022] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] The core of this application is to provide a method for parametric design of 3D models of wooden doors and CNC code generation. A flowchart of one specific implementation is shown below. Figure 1 As shown, the method includes: S101. Set the multispectral imaging device at the raw material feeding station, collect surface image data of the wood board to be processed through the multispectral imaging device, and irradiate the surface of the wood board with multiple specific wavelength light sources to obtain multispectral images under different bands. In the above scheme, multispectral imaging equipment refers to a specialized acquisition device that can simultaneously capture image data at multiple specific wavelengths, used to obtain the reflection or transmission characteristics of an object's surface in different spectral bands; raw material loading station refers to the initial workstation in a wood processing production line specifically used for placing and positioning raw materials to be processed; wood boards to be processed refer to raw wood doors prepared for CNC carving; surface image data refers to digital images of the wood surface acquired by the imaging device, containing visual information such as texture, color, and defects; specific wavelength light source refers to a lighting device capable of emitting narrowband spectra, such as LED or laser light sources, used to enhance the display of specific surface features; multispectral image refers to a series of images acquired using light sources of different wavelengths in the same scene, with each wavelength image highlighting different material properties.
[0024] In this embodiment, firstly, the multispectral imaging device is fixedly installed on the support above the raw material loading station through equipment positioning and configuration. The height and angle of the device are adjusted to face the surface of the wood board to be processed, and multiple light source modules of specific wavelengths are configured, such as 450 nm blue light source, 550 nm green light source, and 850 nm infrared light source modules, to ensure that each light source uniformly illuminates the entire surface of the wood board. Secondly, through multi-band image acquisition, the multispectral imaging device is activated, and different wavelength light source modules are activated sequentially. High-resolution image data of the wood board surface are acquired under each light source illumination. For example, images highlighting surface texture are first acquired under blue light illumination, and then images penetrating the internal structure are acquired under infrared light illumination, ultimately obtaining a set of multispectral images containing information from different wavelength bands. Finally, through data preprocessing and storage, the acquired multispectral images undergo preliminary preprocessing, including image denoising, geometric correction, and format unification. The processed multispectral image data is then stored in a dedicated database to provide complete input for subsequent processing steps.
[0025] In practical applications, in the wooden door processing workshop of Furniture Manufacturing Company A, the loading station in Area B is equipped with a Type C multispectral imaging system. When the D type of wood board is conveyed to the station, the system automatically activates the LED light source group of the E wavelength series, and sequentially collects surface images under F different wavelengths, including the G band for detecting moisture distribution and the H band for identifying texture direction. Finally, it obtains I sets of multispectral image data and transmits them to the central processing system.
[0026] This solution, through a systematic multispectral image acquisition process, can comprehensively acquire detailed feature data of the wood surface and shallow interior, providing a rich and reliable information foundation for subsequent defect identification and texture analysis, and ensuring that the processing system can accurately perceive the characteristics of the raw materials.
[0027] S102. Optical signal processing is performed on the multispectral image based on the band weighting algorithm and the edge enhancement algorithm, and the contrast between the surface texture and defect features of the wood is enhanced by fusing the surface image data corresponding to different bands to generate a high-definition wood feature map. Optionally, step S102 may specifically include the following steps: S1021. Analyze the prominence of features in each band image and assign an importance coefficient to each band image based on the prominence. S1022. Superimpose and fuse the images of each band with importance coefficients to generate a preliminary composite image, and perform contour enhancement processing on the preliminary composite image to enhance the clarity of wood surface texture and defect boundaries. S1023. The image after contour enhancement is fused with the images of each band to generate a high-definition wood feature map containing the wood texture direction, defect identification and material hardness data.
[0028] In the above scheme, a band image refers to an image of the wood surface acquired through a light source of a specific wavelength, with each band highlighting different features; the importance coefficient is a numerical weight that reflects the importance of each band image in the fusion process; the clarity refers to the visibility and sharpness of features such as texture or defects in the image; overlay fusion is the process of merging multiple images into one image according to their weights; contour enhancement is an image processing technique used to enhance the sharpness of edges and boundaries; secondary fusion is the process of merging the processed image with the original image again to retain more details; and the wood feature map is the final high-definition image that includes texture direction, defect location, and hardness information.
[0029] In this embodiment, firstly, in S1021, the clarity of the band images is analyzed and importance coefficients are assigned. Feature analysis is performed on each band image, for example, using variance calculation or contrast evaluation to quantify the clarity of features. Based on the clarity results, importance coefficients are assigned to each band, with higher coefficients assigned to bands with higher clarity. Secondly, in S1022, overlay fusion and contour enhancement are performed. The band images with importance coefficients are weighted and fused to generate a preliminary composite image. For example, a weighted average algorithm is used to merge the images. Then, an edge enhancement algorithm, such as the Sobel operator, is applied to the preliminary composite image to enhance the contours and clarity of the wood surface texture and defect boundaries. Finally, in S1023, a secondary fusion is performed to generate a feature map. The image after contour enhancement is fused with the band images, for example, using principal component analysis (PCA) to retain important features, generating a high-resolution wood feature map containing wood texture direction, defect identification, and material hardness data.
[0030] In practical applications, during the wood processing of furniture factory A, multiple band images of wood C were acquired using a type B multispectral device. Analysis showed that the texture of band D was clearly assigned a high coefficient. Weighted fusion was used to generate a preliminary image, which was then enhanced by algorithm E and fused with the original image a second time. Finally, the feature map F clearly showed the texture of G and defects of H.
[0031] This solution can significantly improve the contrast and clarity of wood surface features, ensuring that textures and defects are accurately identified in subsequent processing, providing a reliable data foundation for adaptive processing, while reducing misjudgments caused by unclear images and improving overall processing quality.
[0032] S103. Based on predefined empirical rules and historical processing data, establish a mapping rule base between the wood feature map and CNC machining parameters; Optionally, step S103 may specifically include the following steps: S1031. Collect feature data, CNC machining parameters, and processing quality data from historical processing processes, and group the feature data, CNC machining parameters, and processing quality data according to the type of wood characteristics; S1032. Based on preset empirical rules, set recommended initial CNC machining parameters for each type of wood feature, and optimize and adjust the recommended values based on historical data; S1033. Establish the correspondence between the wood feature types and the recommended values of the optimized and adjusted CNC machining parameters, organize the correspondence into a mapping rule library.
[0033] In the above scheme, feature data refers to quantitative indicators extracted from wood feature maps, including parameters such as texture density, defect size, and hardness distribution; CNC machining parameters refer to the settings that control the machining process, including tool type, spindle speed, feed rate, and depth of cut; machining quality data refers to the result indicators for evaluating the finished product, such as surface finish, dimensional accuracy, and defect treatment effect; wood feature type refers to the category divided according to feature data, such as high-density texture, large-size defects, or high-hardness areas; empirical rules refer to machining guidance principles formulated based on expert knowledge; recommended values refer to the machining parameter values suggested for specific feature types; and the mapping rule base refers to the data set that stores the correspondence between feature types and machining parameters.
[0034] In this embodiment, firstly, step S1031 collects various data recorded during historical processing, including feature data such as texture density and defect size obtained from wood feature maps, processing parameters such as spindle speed and feed rate used by CNC machine tools, and quality data such as surface finish measured after processing. Then, these data are grouped and categorized according to the similarity of wood features; for example, all cases with high texture density are grouped together. For instance, a furniture factory collects 100 sets of historical processing data, of which 30 sets have high texture density characteristics, and these data are grouped into the same group. Secondly, step S1032 sets preliminary processing parameter recommendations for each feature type based on the practical experience of experienced craftsmen. These recommendations are then optimized and adjusted using historical data, and mathematical methods are used to find the most suitable parameter combination. For example, for high texture density wood, the initial recommended spindle speed is 2000 rpm, but historical data shows that the best effect occurs at 1800 rpm, so the recommended value is optimized and adjusted to 1800 rpm. Finally, through step S1033, various wood feature types are mapped one by one to the optimized processing parameter recommendations, and systematically organized into a mapping rule base; for example, the correspondence between "high texture density → 1800 rpm spindle speed" is established, and all such correspondences are stored in the database to form a complete rule base, which is used to guide the subsequent wood processing process.
[0035] In practical applications, in the processing system of furniture factory A, historical processing data of type B wood is collected, and it is divided into C categories according to texture characteristics. Initial parameters are set based on the experience rules of expert D, and optimized and adjusted using historical data E. Finally, a rule base containing F mapping rules is established to guide the CNC processing of wood G.
[0036] This solution can establish a scientific and effective decision-making system for processing parameters. By using data-driven optimization, it can improve the accuracy of processing parameters and ensure that different types of wood can obtain the most suitable processing parameter configuration, thereby improving processing quality and efficiency and reducing trial and error costs.
[0037] S104. The wood feature map is superimposed and analyzed with the preset three-dimensional relief model. Based on the tool selection strategy and cutting parameter combination corresponding to different texture features in the mapping rule library, texture adaptive path planning is applied to adjust the tool path, cutting depth and feed rate of the CNC tool so that the engraved pattern avoids the wood defect area and is optimized along the texture direction. Optionally, step S104 may specifically include the following steps: S1041. The wood feature map and the three-dimensional relief model are positioned in the spatial coordinate system to establish the mapping relationship between each position point on the surface of the three-dimensional relief model and the wood feature information, and the texture direction data, defect area marking data and material hardness data of each position point are extracted from the wood feature map. S1042. Query the recommended tool type, recommended depth of cut range, and recommended feed rate range corresponding to the feature type of each position point according to the mapping rule base; S1043. Adjust the direction of the tool path according to the texture direction data, identify the defect boundary position according to the defect area marking data, replan the tool movement trajectory to avoid the defect area, and set a protection range around the defect area. S1044. Based on the material hardness data, interpolation calculations are performed within the recommended cutting depth range and the recommended feed rate range to determine the specific cutting depth value and feed rate value for each position point. S1045. Connect the adjusted toolpaths of each position point to form a continuous machining path, and record the tool type, depth of cut and feed rate parameters corresponding to each path segment.
[0038] Specifically, step S1044 may include the following processes: converting the material hardness data of each location point into a relative hardness percentage value, representing the ratio between the current location hardness and the maximum hardness value; obtaining the recommended cutting depth range and recommended feed rate range provided for the feature type in the mapping rule base; calculating the specific cutting depth value within the recommended cutting depth range using an inverse linear relationship based on the relative hardness percentage value, and calculating the specific feed rate value within the recommended feed rate range using an inverse linear relationship; sequentially performing the above interpolation calculation process on each location point on the machining path to obtain the final cutting depth parameters and feed rate parameters for all location points; and associating and storing the calculated cutting parameters with the corresponding location coordinate information to form a complete machining parameter dataset.
[0039] In the above scheme, the three-dimensional relief model refers to a pre-designed digital model of a three-dimensional carving pattern; the spatial coordinate system refers to a three-dimensional coordinate system used to determine the positional relationship between the model and the wood surface; the position point refers to the specific coordinate position of the model surface; the texture direction data refers to the angle information of the wood texture at various positions; the defect area marking data refers to the area data that identifies the location of defects on the wood surface; the material hardness data refers to the measured value reflecting the hardness of different locations of the wood; the recommended tool type refers to the type of tool recommended based on the feature type; the recommended cutting depth range refers to the recommended minimum and maximum cutting depth range; the recommended feed rate range refers to the recommended minimum and maximum feed rate range; the protection range refers to the safe machining boundary set around the defect area; the relative hardness percentage value refers to the ratio of the hardness at the current position to the maximum hardness; the interpolation calculation refers to the mathematical method of calculating intermediate values based on known data points; and the machining parameter dataset refers to a complete data set containing machining parameters for all position points.
[0040] In this embodiment, firstly, step S1041 precisely aligns the wood feature map and the 3D relief model in a spatial coordinate system, establishing the correspondence between each model location point and the wood feature, and extracting the texture direction data, defect area marker data, and material hardness data for each point; for example, aligning the flower relief model with the oak wood feature map, extracting the texture direction and hardness data of the petal positions. Secondly, step S1042 queries the recommended processing parameters corresponding to the feature type of each location point according to the mapping rule base; for example, if the query finds that a diamond tool is recommended for a high-hardness area, with a cutting depth range of 0.5-1.0 mm. Then, step S1043 adjusts the tool path direction according to the texture direction, making the tool path direction follow the wood grain direction, while identifying defect boundaries and replanning the path to avoid defect areas, setting a protection range around the defects; for example, when encountering a knot defect, the tool path automatically detours and leaves a 2 mm safety distance around it. Next, in step S1044, interpolation calculations are performed based on the material hardness data to convert the material hardness data at each location point into a relative hardness percentage value, representing the ratio between the current location's hardness and the maximum hardness value. Specific machining parameters are then calculated using an inverse linear relationship formula, where the cutting depth is calculated using the formula d = -( - )×h where d represents the final depth of cut, and These represent the maximum and minimum values of the recommended depth range, respectively, and h represents the relative hardness percentage. Similarly, the feed rate is calculated using the formula v = -( - )×h where v represents the final feed rate, and These represent the maximum and minimum values of the recommended speed range; for example, if the relative hardness of a point is 80% and the recommended depth of cut range is 0.5-1.0 mm, then the calculated depth of cut is 0.6 mm. The calculated cutting parameters are associated with and stored with the corresponding position coordinate information to form a complete machining parameter dataset. Finally, step S1045 connects all the adjusted position point paths into a continuous machining path, and records the corresponding tool type, depth of cut, and feed rate parameters for each path segment, forming a complete machining instruction set.
[0041] In practical applications, during the production process of furniture factory A, relief model C is used to process type B wood. First, the model is aligned with the wood features, the texture and hardness data of position D are extracted, tool type E is selected according to the rule library, the path is automatically adjusted to avoid the defect area F, and the specific processing parameters are calculated according to the hardness value G, and finally a complete processing path and parameter settings are generated.
[0042] This solution enables intelligent processing path planning, ensuring that the carved pattern perfectly matches the natural characteristics of the wood, effectively avoiding defective areas, and dynamically optimizing processing parameters based on the material hardness, significantly improving processing quality and efficiency, and reducing tool wear and material waste.
[0043] S105. Based on the results of overlay analysis and path adjustment, generate CNC code that matches the characteristics of the raw materials. At the same time, adjust the spindle speed according to the hardness distribution of the wood to be processed to control the CNC machine tool to complete the processing of wooden doors.
[0044] Optionally, step S105 may specifically include the following steps: S1051. Obtain tool path data after texture adaptive path planning adjustment, including path coordinate sequence and cutting depth parameters and feed rate parameters at each position point; S1052. Convert the path coordinate sequence into motion commands that can be recognized by the CNC machine tool to ensure a smooth transition of the machining path; S1053. For each position point, generate corresponding depth control commands based on the cutting depth parameters to achieve precise control of the cutting depth. At the same time, generate corresponding speed control commands based on the feed rate to achieve dynamic adjustment of the feed rate. S1054. Arrange and combine the motion instructions, depth control instructions and speed control instructions in the processing order, and add necessary machine tool auxiliary function instructions to finally generate a CNC machining code file that is completely matched with the characteristics of the wood raw material.
[0045] S1055. Extract the hardness distribution data of the area to be processed from the wood feature map, and obtain the hardness value of each processing position on the tool processing path. S1056. Determine the spindle speed value corresponding to each machining position according to the preset correspondence between the hardness value and the spindle speed. S1057. During the generation of CNC code, add corresponding spindle speed control instructions for each machining position; S1058. Associate the spindle speed control command with the corresponding machining position command to generate a complete CNC machining program that includes dynamic spindle speed adjustment function.
[0046] In the above scheme, toolpath data refers to the optimized machining trajectory information, including coordinate sequences and corresponding machining parameters; motion commands refer to G-code commands that control the movement of each axis of the CNC machine tool; depth control commands refer to machining commands specifically controlling the cutting depth Z-axis; speed control commands refer to machining commands that control the feed rate F; machine tool auxiliary function commands refer to M-code commands that include auxiliary operations such as tool selection and coolant switching; CNC machining code file refers to the final generated complete machining program file; hardness distribution data refers to the hardness values at each location extracted from the feature map; spindle speed control commands refer to machining commands that control the spindle rotation speed S; dynamic spindle speed adjustment refers to the function of changing the spindle speed in real time according to the hardness of the machining location.
[0047] In this embodiment, firstly, step S1051 acquires complete toolpath data adjusted by texture adaptive path planning, including the coordinate sequence of all machining positions and the cutting depth and feed rate parameters for each point; for example, acquiring path data containing 1000 machining points, each point having specific X, Y, Z coordinates and machining parameters. Secondly, step S1052 converts these coordinate sequences into motion commands that can be recognized and executed by the CNC machine tool, using an interpolation algorithm to ensure smooth transition of the toolpath; for example, converting straight paths into G01 commands and circular paths into G02 / G03 commands. Then, step S1053 generates corresponding depth control commands and speed control commands for each position point based on the cutting depth parameters, achieving precise control of the cutting depth and feed rate; for example, generating a Z-1.5 command for a point with a depth of 1.5mm and an F1200 command for a point with a feed rate of 1200mm / min. Next, in step S1054, all instructions, including the motion instructions, depth control instructions, and speed control instructions, are arranged and combined according to the processing sequence, and necessary machine tool auxiliary function instructions are added to finally generate a complete CNC machining code file; for example, adding the tool selection instruction T01 and the coolant activation instruction M08. Simultaneously, in step S1055, hardness distribution data of the processing area is extracted from the wood feature map to obtain the specific hardness value of each processing location; for example, the hardness value of one point is 80HB. In step S1056, the spindle speed value of each processing location is determined according to the preset hardness-speed correspondence; for example, a hardness of 80HB corresponds to a speed of 18000rpm. In step S1057, corresponding spindle speed control instructions are added to each processing location during the CNC code generation process; for example, adding the S18000 instruction. Finally, in step S1058, all speed control instructions are associated with the corresponding processing location instructions to generate a complete CNC machining program including dynamic spindle speed adjustment functionality.
[0048] In practical applications, in the wooden door processing project of Furniture Factory A, a C-type relief pattern is used for type B wood. The system first obtains the optimized tool path data, which includes the coordinates and parameters of D processing points. This data is then converted into E motion instructions. Based on the hardness distribution of each point, corresponding spindle speed instructions are added. Finally, a complete machining program containing F lines of code is generated to control the CNC machine tool to complete high-quality machining.
[0049] This solution can generate highly customized CNC machining programs, achieving precise matching between machining parameters and wood properties. Through dynamic speed adjustment, it ensures optimal machining results in different hardness zones, significantly improving the consistency of machining quality, reducing tool wear, and increasing production efficiency.
[0050] This application provides a method for parametric design of a 3D model of a wooden door and generation of CNC code. Step S101, multispectral image acquisition, comprehensively acquires feature information of the wood surface and interior, providing a rich and accurate data foundation for subsequent processing. Step S102, image processing and feature enhancement, significantly improves the contrast and clarity of wood texture and defect features, generating a high-precision feature map. Step S103, establishing a mapping rule base, constructs an intelligent processing parameter decision system, achieving data-driven processing parameter optimization. Step S104, adaptive path planning and parameter optimization, achieves precise matching between the processing path and wood characteristics, effectively avoiding defect areas and optimizing the processing trajectory. Step S105, CNC code generation and dynamic speed adjustment, generates an executable processing program that perfectly matches the characteristics of the raw material, achieving precise control and adaptive adjustment of the processing process. The overall solution significantly improves the quality and efficiency of wooden door processing, ensuring perfect integration of carved patterns and natural wood texture, reducing material waste and tool wear, while reducing reliance on operator skills, achieving intelligent, personalized, and high-quality production.
[0051] Figure 2 This is a schematic diagram illustrating a specific implementation of a parametric design and CNC code generation system for a three-dimensional model of a wooden door, as provided in this application. (Refer to...) Figure 2 The system may include: The acquisition module 21 is used to set the multispectral imaging device at the raw material feeding station, acquire surface image data of the wood board to be processed through the multispectral imaging device, and irradiate the surface of the wood board with multiple specific wavelength light sources to obtain multispectral images under different bands. The fusion module 22 is used to perform optical signal processing on the multispectral image based on the band weighting algorithm and the edge enhancement algorithm, and enhance the contrast of wood surface texture and defect features by fusing the surface image data corresponding to different bands to generate a high-definition wood feature map. Module 23 is used to establish a mapping rule library between the wood feature map and CNC machining parameters based on predefined empirical rules and historical processing data. The adjustment module 24 is used to overlay and analyze the wood feature map with the preset three-dimensional relief model, and apply texture adaptive path planning to adjust the tool path, cutting depth and feed rate of the CNC tool according to the tool selection strategy and cutting parameter combination corresponding to different texture features in the mapping rule library, so that the engraved pattern avoids the wood defect area and is optimized along the texture direction. Analysis module 25 is used to generate CNC code that matches the characteristics of raw materials based on the results of overlay analysis and path adjustment. At the same time, it adjusts the spindle speed according to the hardness distribution of the wood to be processed, so as to control the CNC machine tool to complete the processing of wooden doors.
[0052] This application provides a system for parametric design and CNC code generation of a 3D model of a wooden door, which is used to implement the aforementioned method for parametric design and CNC code generation of a 3D model of a wooden door. Therefore, the specific implementation of the system for parametric design and CNC code generation of a 3D model of a wooden door can be found in the embodiment section of the method for parametric design and CNC code generation of a 3D model of a wooden door described above. The specific implementation can be referred to the description of the corresponding embodiments, which will not be repeated here.
[0053] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the parametric design and CNC code generation method for a three-dimensional model of a wooden door as described above.
[0054] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described methods for parametric design of a three-dimensional model of a wooden door and generation of CNC code.
[0055] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory, random access memory, portable hard drives, magnetic disks, or optical disks.
[0056] The embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the parametric design and CNC code generation method for three-dimensional wooden door models.
[0057] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0058] The foregoing has provided a detailed description of the parametric design method, system, electronic device, and storage medium for a three-dimensional model of a wooden door and the generation of CNC code provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A method for parametric design of a three-dimensional model of a wooden door and generation of CNC code, characterized in that, include: A multispectral imaging device is set up at the raw material feeding station. The multispectral imaging device is used to collect surface image data of the wood board to be processed, and multiple light sources of specific wavelengths are used to illuminate the surface of the wood board to obtain multispectral images under different bands. The multispectral image is processed by optical signal processing based on band weighting algorithm and edge enhancement algorithm, and the contrast between wood surface texture and defect features is enhanced by fusing the surface image data corresponding to different bands to generate a high-definition wood feature map. Based on predefined empirical rules and historical processing data, a mapping rule base between the wood feature atlas and CNC machining parameters is established. The wood feature map is superimposed and analyzed with the preset three-dimensional relief model. Based on the tool selection strategy and cutting parameter combination corresponding to different texture features in the mapping rule library, texture adaptive path planning is applied to adjust the tool path, cutting depth and feed rate of CNC tool so that the engraved pattern avoids the defect area of wood and is optimized along the texture direction. Based on the results of overlay analysis and path adjustment, CNC code matching the characteristics of raw materials is generated. At the same time, the spindle speed is adjusted according to the hardness distribution of the wood to be processed, which is used to control the CNC machine tool to complete the processing of wooden doors.
2. The method according to claim 1, characterized in that, The wood feature atlas is overlaid and analyzed with a preset 3D relief model. Based on the tool selection strategy and cutting parameter combinations corresponding to different texture features in the mapping rule base, texture adaptive path planning is applied to adjust the tool path, depth of cut, and feed rate of the CNC tool, including: The wood feature map is matched with the three-dimensional relief model in the spatial coordinate system. The mapping relationship between each position point on the surface of the three-dimensional relief model and the wood feature information is established. The texture direction data, defect area marking data and material hardness data of each position point are extracted from the wood feature map. Based on the mapping rule base, query the recommended tool type, recommended depth of cut range, and recommended feed rate range corresponding to the feature type of each location point; The tool path direction is adjusted according to the texture direction data, and the defect boundary position is identified according to the defect area marking data. The tool movement trajectory is replanned to avoid the defect area, and a protection range is set around the defect area. Based on the material hardness data, interpolation calculations are performed within the recommended cutting depth range and the recommended feed rate range to determine the specific cutting depth value and feed rate value for each position point. Connect the adjusted toolpaths of each location point to form a continuous machining path, and record the tool type, depth of cut, and feed rate parameters corresponding to each path segment.
3. The method according to claim 2, characterized in that, Based on the material hardness data, interpolation calculations are performed within the recommended depth of cut range and the recommended feed rate range to determine the specific depth of cut and feed rate values at each location point, including: Convert the material hardness data at each location point into a relative hardness percentage value, representing the ratio between the current location hardness and the maximum hardness value; Obtain the recommended cutting depth range and recommended feed rate range provided for the feature type from the mapping rule base; Based on the relative hardness percentage value, the specific cutting depth value is calculated within the recommended cutting depth range using an inverse linear relationship, and the specific feed rate value is calculated within the recommended feed rate range using an inverse linear relationship. The above interpolation calculation process is performed sequentially for each position point on the machining path to obtain the final cutting depth parameters and feed rate parameters for all position points. The calculated cutting parameters are associated with and stored with the corresponding position coordinate information to form a complete machining parameter dataset.
4. The method according to claim 1, characterized in that, Optical signal processing is performed on the multispectral image based on band weighting and edge enhancement algorithms. The contrast between wood surface texture and defect features is enhanced by fusing surface image data from different bands, generating a high-resolution wood feature map, including: Analyze the prominence of features in each band image and assign an importance coefficient to each band image based on the prominence. Images of each band with importance coefficients are superimposed and fused to generate a preliminary composite image. The preliminary composite image is then subjected to contour enhancement processing to improve the clarity of wood surface texture and defect boundaries. The image after contour enhancement is fused with the images of each band to generate a high-definition wood feature map containing wood texture direction, defect identification and material hardness data.
5. The method according to claim 1, characterized in that, Based on predefined empirical rules and historical processing data, a mapping rule base is established between the wood feature atlas and CNC machining parameters, including: Collect feature data, CNC machining parameters, and processing quality data from historical processing processes, and group the feature data, CNC machining parameters, and processing quality data according to the type of wood characteristics; Based on preset empirical rules, recommended initial CNC machining parameters are set for each of the aforementioned wood feature types, and the recommended values are optimized and adjusted based on historical data. Establish the correspondence between the wood feature types and the recommended values of the optimized and adjusted CNC machining parameters, organize the correspondence into a mapping rule library.
6. The method according to claim 1, characterized in that, Based on the results of overlay analysis and path adjustment, CNC code matching the characteristics of the raw materials is generated, including: Obtain toolpath data after texture-adaptive path planning adjustment, including path coordinate sequence and cutting depth parameters and feed rate parameters at each position point; The path coordinate sequence is converted into motion commands that can be recognized by the CNC machine tool to ensure a smooth transition of the machining path; For each position point, a corresponding depth control command is generated based on the cutting depth parameter to achieve precise control of the cutting depth. At the same time, a corresponding speed control command is generated based on the feed rate to achieve dynamic adjustment of the feed rate. The motion commands, depth control commands, and speed control commands are arranged and combined in the processing order, and necessary machine tool auxiliary function commands are added to finally generate a CNC machining code file that perfectly matches the characteristics of the wood raw material.
7. The method according to claim 1, characterized in that, Simultaneously, the spindle speed is adjusted according to the hardness distribution of the wood to be processed, which is used to control the CNC machine tool to complete the processing of wooden doors, including: Extract the hardness distribution data of the area to be processed from the wood feature map, and obtain the hardness value of each processing position on the tool processing path; Based on the preset correspondence between the hardness value and the spindle speed, the spindle speed value corresponding to each machining position is determined; During the CNC code generation process, corresponding spindle speed control instructions are added for each machining position; The spindle speed control command is associated with the corresponding machining position command to generate a complete CNC machining program that includes dynamic spindle speed adjustment function.
8. A parametric design and CNC code generation system for a three-dimensional model of a wooden door, characterized in that, include: The acquisition module is used to set the multispectral imaging device at the raw material feeding station, acquire surface image data of the wood board to be processed through the multispectral imaging device, and illuminate the surface of the wood board with multiple specific wavelength light sources to obtain multispectral images under different bands. The fusion module is used to perform optical signal processing on the multispectral image based on the band weighting algorithm and the edge enhancement algorithm, and enhance the contrast of wood surface texture and defect features by fusing the surface image data corresponding to different bands to generate a high-definition wood feature map. A module is established to create a mapping rule base between the wood feature atlas and CNC machining parameters based on predefined empirical rules and historical processing data. The adjustment module is used to overlay and analyze the wood feature map with the preset three-dimensional relief model, and apply texture adaptive path planning to adjust the tool path, cutting depth and feed rate of the CNC tool according to the tool selection strategy and cutting parameter combination corresponding to different texture features in the mapping rule library, so that the engraved pattern avoids the defect area of the wood and is optimized along the texture direction. The analysis module generates CNC code that matches the characteristics of the raw materials based on the results of overlay analysis and path adjustment. At the same time, it adjusts the spindle speed according to the hardness distribution of the wood to be processed, which is used to control the CNC machine tool to complete the processing of wooden doors.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the parametric design and CNC code generation method for a three-dimensional model of a wooden door as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, enables a method for parametric design of a three-dimensional model of a wooden door and generation of CNC code as described in any one of claims 1 to 7.
Citation Information
Cited By
A parametric CNC machining method and system for timber structure component joints
CN122131687A