Method and device for manufacturing a stereoscopic layered puzzle, electronic device and storage medium

By preprocessing and enhancing the stereoscopic effect of two-dimensional design images, a three-dimensional model is generated and processed in layers. Combined with genetic algorithms to optimize the arrangement layout, the problems of complex design and high cost of three-dimensional layered puzzle toys are solved, and automated manufacturing and improved material utilization are achieved.

CN121482286BActive Publication Date: 2026-05-08TIANJIN LINGJIAO CREATIVE TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN LINGJIAO CREATIVE TECH CO LTD
Filing Date
2025-12-31
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing 3D layered puzzle toys have complex designs, require separate design and prototyping, involve complicated manufacturing steps, have high production costs, and are difficult to mass-produce.

Method used

By preprocessing two-dimensional design images, enhancing their stereoscopic effect, generating three-dimensional models and processing them in layers, and using AI image generation tools and genetic algorithms to optimize the arrangement and layout, standardized layered cutting files are generated, and a jigsaw puzzle module is automatically prepared.

Benefits of technology

It enables automated conversion from two-dimensional graphics to three-dimensional models and layered mosaic design, reducing production costs, improving material utilization, and simplifying the preparation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121482286B_ABST
    Figure CN121482286B_ABST
Patent Text Reader

Abstract

The application provides a preparation method and device of a three-dimensional layered jigsaw puzzle, electronic equipment and a storage medium, comprising the following steps: obtaining a two-dimensional design image, preprocessing the two-dimensional design image; performing stereoscopic enhancement processing on the preprocessed two-dimensional design image to generate a preliminary three-dimensional image; processing the preliminary three-dimensional image to generate a three-dimensional model; performing layered processing on the three-dimensional model to form a plurality of target layers; arranging and laying out the plurality of target layers to output a drawing including the plurality of target layers in an optimal arrangement and layout; generating a layered cutting file according to the drawing, and receiving the layered cutting file by a manufacturing device to prepare a jigsaw puzzle layer module. The application has the beneficial effect that the preparation process of the jigsaw puzzle is fully automated, and no manual intervention is required from two-dimensional drawing to layered jigsaw design, thereby breaking through the limitation of traditional reliance on designers, directly connecting the output file to the production equipment, having industrial practicability, and reducing manufacturing cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of children's toy technology, and in particular relates to a method, apparatus, electronic device and storage medium for preparing a three-dimensional layered puzzle. Background Technology

[0002] Existing three-dimensional children's toys generally require the creation of molds and then mass production using mechanical manufacturing. However, for three-dimensional puzzle toys in the fields of cultural and creative products and educational toys, especially three-dimensional layered stacking puzzles, the design relies on designers. Each product needs to be designed and sampled individually, making the manufacturing process complex, the new product development time long, and the production cost high. Summary of the Invention

[0003] In view of the above problems, the present invention provides a method, apparatus, electronic device and storage medium for preparing a three-dimensional layered puzzle, so as to solve the above or other problems existing in the prior art.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for preparing a three-dimensional layered jigsaw puzzle, comprising the following steps:

[0005] Obtain the two-dimensional design image and preprocess it.

[0006] The preprocessed 2D design image is subjected to stereoscopic enhancement processing to generate a preliminary 3D image;

[0007] Process the preliminary 3D image to generate a 3D model;

[0008] The 3D model is layered to form multiple desired target layers;

[0009] Arrange and layout multiple target layers, and output drawings of multiple target layers including the optimal arrangement and layout;

[0010] The layered cutting file is generated based on the drawings. The manufacturing equipment receives the layered cutting file and prepares the layer module.

[0011] Furthermore, the preprocessing of the two-dimensional design image includes the following steps:

[0012] Denoising the 2D design image: Use a Gaussian filtering algorithm to remove noise from the 2D design image while preserving edge contour information;

[0013] Optimize edge contours: Extract the edge contours of the denoised 2D design image and fill in any breaks in the edge contours;

[0014] The two-dimensional design image after edge contour optimization is processed to standardize the format and convert it into a unified format;

[0015] The colors of the 2D design image after format standardization are simplified.

[0016] Furthermore, in the step of enhancing the stereoscopic effect of the preprocessed two-dimensional design image to generate a preliminary three-dimensional image, an AI image generation tool based on a diffusion model is used to process the preprocessed two-dimensional design image to generate a preliminary three-dimensional image.

[0017] Furthermore, the preprocessed 2D design image undergoes stereoscopic enhancement processing to generate a preliminary 3D image, including the following steps:

[0018] Load the pre-trained diffusion model and input the pre-processed two-dimensional design image into the pre-trained diffusion model. The pre-trained diffusion model is a diffusion model based on the U-Net structure using the Stable Diffusion open-source framework.

[0019] Image encoding: The preprocessed two-dimensional design image is normalized and then successively superimposed with noise that conforms to a normal distribution, which is encoded into a latent space vector;

[0020] Set conditional controls: Configure edge contour information and prompt word information;

[0021] Image decoding: Noise is removed by inverse diffusion based on the set edge contour information and prompt word information. In the U-Net decoder, shallow detail features and deep semantic features are fused, and the stereoscopic effect of the two-dimensional design image is adjusted by controlling the prompt words and control net weight allocation.

[0022] Furthermore, in the step of processing the preliminary 3D image to generate a 3D model, a large model is generated based on the 3D model, and the stereoscopic image is converted into a 3D mesh model, including:

[0023] Geometric models are generated from conditional images using shape generation models;

[0024] Texture maps are synthesized from geometric models using a texture synthesis model and a large-scale diffusion model.

[0025] Furthermore, in the step of layering the 3D model to form multiple target layers, the number of layers and the cutting contours are determined by dynamic programming algorithm based on the geometric features of the 3D model to form multiple target layers.

[0026] Furthermore, the 3D model is layered to form multiple required target layers, including:

[0027] Analyze the 3D model: Read the 3D model information and cut the 3D model into a series of parallel 2D candidate layers along the height direction;

[0028] Slicing: For each candidate layer, intersect the plane with the grid, extract the set of intersection lines, convert the intersection lines into closed polygons, and generate the contour path;

[0029] Determine the target number of layers: Discretize the 3D model along the height direction into N candidate layer positions, and determine the target number of layers based on the volume of the 3D model and the thickness of the selected material;

[0030] Determine each target layer: Based on the number of target layers and the total number of candidate layers, determine the final required initial selection layers. Perform edge recognition on each candidate layer in the search domain of each initial selection layer, and calculate the significant contour feature value of each candidate layer. Obtain the candidate layers that contain or approximate the significant contour lines of the initial selection layer, and adjust the candidate layers that contain or approximate the significant contour lines of the initial selection layer to the target layers corresponding to the initial selection layer.

[0031] Furthermore, in the step of arranging and laying out multiple target layers and outputting a drawing containing the optimal arrangement of multiple target layers, a genetic algorithm is applied to optimize the arrangement of multiple target layers on the planar drawing with the goal of minimizing material waste, and outputs a visual drawing containing layer numbers.

[0032] Furthermore, the steps of arranging and laying out multiple target layers to output drawings including the optimal arrangement of multiple target layers include:

[0033] Preprocess the cutting contour of each target layer and record the position and rotation angle of the cutting contour of each target layer;

[0034] Calculate material utilization rate and overlap penalty, and calculate a score based on material utilization rate and overlap penalty;

[0035] The optimal solution is calculated by using a genetic algorithm and combining it with scores, and a visual drawing is output.

[0036] Furthermore, when using a genetic algorithm combined with scores to calculate the optimal permutation solution, the population is initialized, and multiple different permutations are randomly generated. The following operations are then performed:

[0037] Selection: Select the highest-scoring individuals from the population and retain them directly for the next generation;

[0038] Crossover: Randomly select two permutations and swap some of the target layers;

[0039] Mutation: Randomly modifies the coordinates or angles of a target layer;

[0040] Repeat the selection, crossover, and mutation steps multiple times until the score no longer improves, at which point the optimal permutation is obtained.

[0041] An apparatus for preparing a three-dimensional layered jigsaw puzzle, comprising:

[0042] A two-dimensional design image preprocessing unit is used to acquire two-dimensional design images and preprocess them.

[0043] The preliminary 3D image generation unit is used to enhance the stereoscopic effect of the preprocessed 2D design image and generate a preliminary 3D image.

[0044] The 3D model generation unit is used to process the preliminary 3D image and generate a 3D model.

[0045] Layered units are used to process 3D models into layers, forming multiple desired target layers;

[0046] The drawing generation and output unit is used to arrange and layout multiple target layers, output drawings of multiple target layers including the optimal arrangement and layout, and generate layer cutting files based on the drawings.

[0047] An electronic device includes a memory and a processor, wherein the processor is coupled to the memory to read and execute instructions in the memory, thereby enabling the electronic device to implement the above-described method for preparing a three-dimensional layered mosaic.

[0048] A readable storage medium storing a computer program, which, when executed, implements the above-described method for preparing a three-dimensional layered jigsaw puzzle.

[0049] By employing the above technical solution, this method for preparing three-dimensional layered puzzles transforms any two-dimensional graphic into a three-dimensional model. The three-dimensional model is then layered to determine the target layer for producing the puzzle pieces. This target layer is then arranged to improve material utilization, outputting a visual drawing. This visual drawing is then used to generate a standardized layered cutting file. Cutting equipment then prepares the puzzle toy product based on this cutting file. The entire puzzle toy manufacturing process is automated, requiring no manual intervention from two-dimensional drawing to layered puzzle design. This overcomes the limitations of traditional methods that rely on designers. The output file directly connects to production equipment, making it industrially practical, reducing manufacturing costs, and widely applicable to educational toys, cultural and creative products, and other fields. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of the logic flow of an embodiment of the present invention;

[0051] Figure 2 This is a two-dimensional design image of an embodiment of the present invention;

[0052] Figure 3 This is a preprocessed two-dimensional design image according to an embodiment of the present invention;

[0053] Figure 4 This is a preliminary three-dimensional design image of an embodiment of the present invention;

[0054] Figure 5 This is a three-dimensional model diagram of an embodiment of the present invention;

[0055] Figure 6 This is a layered image according to an embodiment of the present invention;

[0056] Figure 7 This is a drawing of the target layer according to an embodiment of the present invention;

[0057] Figure 8 This is a picture of the assembled object according to an embodiment of the present invention. Detailed Implementation

[0058] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0059] Figure 1 The diagram illustrates a logic flowchart of an embodiment of the present invention. This embodiment relates to a method, apparatus, electronic device, and storage medium for preparing a three-dimensional layered puzzle. It is applied to the preparation of cultural and creative products, children's toys, educational toys, etc. By converting a user-drawn two-dimensional graphic into a three-dimensional model, and then layering the three-dimensional model to form a visual drawing of the layered puzzle arrangement, the visual drawing is used to generate a standard layered cutting file, which is then transmitted to manufacturing equipment such as laser cutting equipment to manufacture each layered puzzle module. The output file can be directly connected to production equipment. From the two-dimensional design drawing to the layered puzzle design, no manual intervention is required, resulting in a high degree of automation and low manufacturing cost.

[0060] A method for preparing a three-dimensional layered jigsaw puzzle includes the following steps:

[0061] The process involves acquiring a 2D design image, preprocessing it to remove noise, and preserving edge contour details to obtain a clear image with well-defined edges and a uniform format.

[0062] The preprocessed 2D design image is subjected to stereoscopic enhancement processing to generate a preliminary 3D image. This preliminary 3D image is an image with a pseudo-3D stereoscopic effect. In other words, the preprocessed 2D design image is redrawn with a stereoscopic effect, and the preprocessed 2D design image is converted into an image with a pseudo-3D stereoscopic effect.

[0063] The initial 3D image is processed to generate a 3D model, that is, the stereoscopically converted image is converted into a 3D mesh model.

[0064] The 3D model is layered to form multiple desired target layers;

[0065] Arrange and layout the multiple target layers to output drawings of the multiple target layers including the optimal arrangement and layout;

[0066] The layered cutting file is generated based on the drawings. The manufacturing equipment receives the layered cutting file and prepares the layer module.

[0067] This method for preparing 3D layered jigsaw puzzles involves creating jigsaw puzzle modules for toys and other products. A 2D design image is converted into a 3D mesh model. This 3D mesh model is then layered and cut to form multiple target layers. These target layers are arranged in a material-saving manner, outputting a visual drawing containing the optimal arrangement of the target layers. This visual drawing is then used to generate a standardized layered cutting file adapted for manufacturing equipment. This standardized layered cutting file is input into the manufacturing equipment for jigsaw puzzle module preparation. This process eliminates the need for manual intervention from 2D drawing to layered jigsaw puzzle design. The output standardized layered cutting file directly interfaces with production equipment, reducing manufacturing costs, saving time, and achieving a high degree of automation.

[0068] Specifically, the two-dimensional design image mentioned above can be any two-dimensional graphic drawn by anyone, such as a two-dimensional graphic drawn by a child. Users can obtain the two-dimensional graphic through scanning or digital drawing tools to form a two-dimensional design image. The two-dimensional design image can be a hand-drawn scan, a flatbed drawing file, etc. The format of the two-dimensional design image can be PNG, JPEG, SVG, etc. There are no specific requirements for the format of the two-dimensional design image here.

[0069] After acquiring the 2D design image, it is preprocessed to improve image quality, making the image and its edges clear and standardized in format. This lays the foundation for subsequent 3D conversion, 3D model generation, and layer cutting. The preprocessing of the 2D design image includes the following steps:

[0070] Denoising the 2D design image: A Gaussian filtering algorithm is used to remove noise from the 2D design image while preserving edge contour information, improving the signal-to-noise ratio of the image to ensure the accuracy of subsequent processing. Specifically, if the 2D design image is in RGB mode, it is converted to grayscale to remove color interference. Then, the OpenCV cv2.GaussianBlur function is used to filter the converted grayscale image to remove noise. After filtering, local contrast enhancement is performed on the filtered image. The image is divided into several regions based on the approximate grayscale regions. Histogram equalization is then performed on each region to restore the clarity of the edge contour lines, making the edge contours of the denoised 2D design image clear.

[0071] After denoising the 2D design image, the edge contours of the denoised 2D design image are optimized: the edge contours of the denoised 2D design image are extracted, and breaks in the extracted edge contours are filled to make the obtained edge contours continuous and closed lines, resulting in a clear and continuous 2D design image with closed edge contours. Specifically, the edge contours of the denoised 2D design image are extracted using the Canny edge detection algorithm, and the high and low thresholds are automatically calculated using the Otsu algorithm. After the edge contours are extracted, whether the edge contours are closed is detected. If the edges are not closed, there is a break in the edge contour. The broken edges are filled by combining morphological closing operations and manual interpolation to repair the unclosed contours, making the repaired edge contours continuous and closed lines.

[0072] The 2D design image with optimized edge contours undergoes format standardization processing to convert it into a unified format. Specifically, the 2D design image with optimized edge contours is uniformly converted into a PNG format image. Then, the alpha channel is extracted from the PNG image. If the background is not transparent, the foreground and background are separated by color thresholding, so that the output image is a PNG file in RGBA mode. If the 2D design image with optimized edge contours is an SVG format image, the path data is parsed, invalid nodes are filtered out, and it is rasterized into a bitmap.

[0073] The standardized 2D design image undergoes color simplification to highlight key elements for subsequent 3D conversion. Specifically, if the standardized 2D design image contains unnecessary colors, these are binarized to reduce computational complexity. If the standardized 2D design image is a monochrome line drawing (e.g., a black and white sketch), a global threshold is directly applied. If the standardized 2D design image is a color image, an adaptive threshold is used, combined with K-means clustering to separate the subject from the background, reducing the number of colors and making the image simpler. If the standardized 2D design image (e.g., a child's drawing) contains specific color markers (e.g., red accent areas), the HSV color channel of these specific color markers is extracted and binarized separately, and the remaining areas except those containing the specific color markers are converted to black and white. After color simplification, the standardized 2D design image has simpler colors, reducing the difficulty of subsequent processing, while retaining information containing specific color markers to meet user design and usage needs.

[0074] After preprocessing the 2D design image, a stereoscopic enhancement process is applied to generate a preliminary 3D image. This involves converting the preprocessed 2D design image to a stereoscopic form, redrawing the stereoscopic effect, and generating a simulated 3D image. In this step, an AI image generation tool based on a diffusion model is used to process the preprocessed 2D design image and generate the preliminary 3D image. This diffusion-based AI image generation tool is the stable diffusion open-source tool.

[0075] Specifically, the steps of enhancing the stereoscopic effect of the preprocessed two-dimensional design image to generate a preliminary three-dimensional image include:

[0076] A pre-trained diffusion model is loaded, and the pre-processed 2D design image is input into the pre-trained diffusion model to generate a preliminary 3D image. The pre-trained diffusion model is a diffusion model based on the Stable Diffusion open-source framework and the U-Net structure. The pre-trained diffusion models include Pony Diffusion V6, Dream Shaper V8, etc. When loading the pre-trained diffusion model to generate images with a simulated 3D stereoscopic effect, if the generation effect is not ideal, a 3D stereoscopic effect LoRa model is loaded to enhance the stereoscopic effect of the generated simulated 3D stereoscopic image. The LoRa model includes Blindbox, Figma Anime Figures, Pop Up Parade, etc.

[0077] During the initial 3D image generation process using a pre-trained diffusion model, image encoding is performed: the pre-processed 2D design image is normalized, and noise conforming to a normal distribution is superimposed successively, encoded into a latent space vector so that the pre-trained diffusion model can perform 3D transformation processing on the image.

[0078] Conditional control settings: Edge contour information and prompt word information are configured to control the edge contours and style direction of the generated preliminary 3D image when the pre-trained diffusion model redraws 2D graphics to achieve a 3D effect. Specifically, edge contour information is injected through the ControlNet module. This edge contour information is the Canny edge map obtained by optimizing the edge contours of the denoised 2D design image during the 2D design image preprocessing step. Setting the edge contour information solves the geometric distortion problem caused by irregular lines in 2D design images, especially the geometric distortion problem caused by irregular lines in children's drawings. According to design requirements, prompt word information is set in the positive text prompt words in the CLIP model. For example, the positive text prompt words in the CLIP model can be set to "3D cartoon style". The specific settings of the positive text prompt words in the CLIP model can be selected according to actual needs to control the generated style.

[0079] After the conditional control settings are completed, image decoding is performed: noise is removed using inverse diffusion based on the set edge contour information and cue word information, resulting in a clear, three-dimensional simulated 3D image. Specifically, in the U-Net decoder, shallow detail features and deep semantic features are fused. Here, shallow detail features include line sharpness, while deep semantic features include volume, resulting in a clear edge contour and strong three-dimensional effect in the generated image. Based on the design requirements of the specific image, the 3D effect of the 2D design image is optimized by controlling the weight allocation of cue words and control net. The cue words control the style of the generated image, while the control net controls the edge contour. Adjusting the weight allocation of cue words and control net optimizes the 3D effect of the generated image, that is, the generated preliminary 3D image achieves the best 3D effect.

[0080] In the step of processing the preliminary 3D image to generate a 3D model, a large model based on a 3D model is used to process the preliminary 3D image, converting the stereoscopic image into a 3D model. This large model based on a 3D model is the Hunyuan3D 2.0 open-source model. That is, the preliminary 3D image is processed using the Hunyuan3D 2.0 open-source model, converting the stereoscopic image into a 3D mesh model. The format of the 3D model includes OBJ format or STL format.

[0081] The steps for processing the initial 3D image to generate a 3D model include:

[0082] Shape Generation: A geometric model is generated from a conditional image using a shape generation model. This shape generation model is the Hunyuan3D-DiT model. The Hunyuan3D-DiT shape generation model is based on a scalable diffusion transformer (DiT) architecture and can accurately generate high-precision geometric structures from conditional images. It can capture key features of the input image and supports the rapid generation of the basic shape of a 3D model from text or image input. Here, the conditional image is the preliminary 3D image generated in the above steps. The Hunyuan3D-DiT shape generation model can create the basic shape of an object. Therefore, the Hunyuan3D-DiT shape generation model uses a scalable diffusion transformer architecture and combines it with the preliminary 3D image to create a geometric shape, forming a geometric model.

[0083] Texture Composition: The texture composition model, Hunyuan3D-Paint, is used to synthesize texture maps on the geometric model through a large-scale diffusion model. For the generated geometric model, the texture composition model Hunyuan3D-Paint uses a large-scale diffusion model to synthesize high-resolution texture maps, generating a three-dimensional model and achieving a surface effect with rich details and realistic colors.

[0084] In the process of layering a 3D model to form multiple target layers, a dynamic programming algorithm is used to determine the number of layers and the cutting contours based on the geometric features of the 3D model, resulting in multiple target layers. The number and size of the target layers can be adjusted to meet user needs. Here, the geometric features of the 3D model include, but are not limited to, edge gradients and curvature.

[0085] Specifically, the process of layering the 3D model to form multiple target layers includes:

[0086] Analyzing the 3D model: Read the 3D model information and slice the 3D model into a series of parallel 2D candidate layers along the height direction. Based on the 3D mesh model file generated in the above steps, read the 3D mesh model file to obtain the 3D model information (maximum and minimum coordinates in the height direction, specific contour point coordinates, shape contour curvature, etc.). When layering the 3D model, it is uniformly layered along the height direction to form a series of parallel 2D planar layers. Set the thickness of each 2D planar layer (e.g., the thickness of each layer is 0.2mm) to obtain the number of 2D planar layers. Each 2D planar layer is a candidate layer. That is, along the height direction of the 3D model, the 3D model is layered according to a certain thickness to form a certain number of parallel candidate layers. The thickness of each 2D planar layer is the thickness of each candidate layer.

[0087] The number of candidate layers is calculated based on the total height of the 3D model and the thickness of the candidate layers. The formula for calculating the number of candidate layers is as follows:

[0088]

[0089] in, H is the thickness of the candidate layer, and H is the total height of the 3D model. This represents the number of candidate layers.

[0090] The formula for calculating the total height of the above 3D model is: ,in, and These are the maximum and minimum coordinates of the 3D model along the z-axis, respectively.

[0091] Slicing: For each candidate layer, the plane and the mesh are intersected, the set of intersection lines is extracted, and the intersection lines are converted into closed polygons to generate a contour path. Since each candidate layer is a two-dimensional planar layer and the three-dimensional model is a three-dimensional mesh model, the plane and the mesh of each candidate layer are intersected, the set of intersection lines is extracted, and then the intersection lines are converted into closed polygons to generate a contour path. This contour path is the shape contour of the candidate layer, which is also the subsequent cutting contour.

[0092] Once the contour path of each candidate layer is generated and determined, the 3D model is theoretically layered, including the thickness, contour path, and number of candidate layers. However, in practice, to create an assembled model that corresponds to the 3D model, the thickness and number of each layer need to be determined based on the height of the assembled model and the materials used.

[0093] Therefore, once the contour paths of the candidate layers are determined, the number of target layers required for the assembly model is determined: the 3D model is discretized into N candidate layer positions along the height direction, and the number of target layers (the final number of layers required) is determined based on the volume of the 3D model and the thickness of the selected materials. The height of the 3D model is adapted to the height of the assembly model, and the final number of layers required is set as the target number of layers. The formula for calculating the target number of layers is:

[0094]

[0095] Where H is the total height of the 3D model. K represents the thickness of the selected material and K represents the target number of layers.

[0096] Determine each target layer (required selection layer): Based on the number of target layers (the final number of layers required) and the total number of candidate layers, determine the final required initial selection layers. That is, divide the total number of candidate layers equally according to the final required number of layers, and determine a selection layer position every equal number of candidate layers (segmented step size). The candidate layer at the selected layer position is taken as the initial selection layer. Set: the number of initial selection layers is k. Set the search neighborhood of each initial selection layer. Perform edge recognition on each candidate layer in the search neighborhood of each initial selection layer. Calculate the significant contour feature value of each candidate layer. Obtain the candidate layer that contains or approximates the significant contour line of each initial selection layer at the selected layer position. Adjust the candidate layer that contains or approximates the significant contour line of the model to the target layer (the final required selection layer) corresponding to the initial selection layer. For example, if the total number of candidate layers is 500 and the target layer (the final number of layers required) is 20, then a selection layer position is determined every 25 layers, and the candidate layer at that selection layer position is used as an initial selection layer. That is, layers 25, 50, 75, 100, 125, etc., are used as the selection layer positions for the target layers, such as the first initial selection layer, the second initial selection layer, the third initial selection layer, the fourth initial selection layer, the fifth initial selection layer, etc. The candidate layer at the selection layer position is the initial selection layer. At the same time, edge recognition is performed on the candidate layers within a certain range (search neighborhood) above and below each selected initial selection layer. The candidate layer with the most significant features is selected as the final required selection layer corresponding to that initial selection layer, which is also the target layer. For example, for the fourth initial selection layer, the layer with the most significant features is 89. Therefore, the fifth selection layer is not selected as layer 100, but as layer 89. The final selection layer 89 is the target layer.

[0097] Specifically, firstly, for the initially determined k initial selection layers, the position of each initial selection layer is... Indexing:

[0098] =k×S (k=1,2,…,K-1,K)

[0099] Where N is the number of candidate layers, K is the number of target layers, and S is the segmentation step size, S=N / K;

[0100] For each initial selection layer I k Define the search neighborhood, with an upper limit of U. k The lower bound of the neighborhood is L k Neighborhood lower limit L k =max(0, - ), neighborhood upper limit U k =min(N-1, + For each candidate layer in the neighborhood , j is an integer, calculate its significant contour feature value :

[0101]

[0102] Where P is the total number of contour points. Let p be the edge gradient magnitude. Let be the absolute value of the curvature at point p.

[0103] Within the neighborhood, the layer with the most significant contour features is selected as the final selected layer, and this final selected layer is the target layer within that neighborhood. for:

[0104]

[0105] Taking the above process of determining each target layer as an example, if the total number of candidate layers N=500 and the number of target layers K=20, then the segmentation step size S=N / K=500 / 20=25, according to the formula... =k×S indexes the positions of the 20 initial selection layers, which are the 25th, 50th, 75th, ..., 500th layers respectively;

[0106] For each initial selection layer, a search neighborhood is defined, and the salient contour feature values ​​of each candidate layer within the neighborhood of each initial selection layer are calculated. Taking the 5th initial selection layer as an example, the position of this initial selection layer is indexed. =5×25=125, the initial selection layer is the 125th layer, which is the candidate layer of the 125th layer. Define the search neighborhood of the initial selection layer, the lower limit of the neighborhood L5=max(0, 125-12.5)=112.5, the upper limit of the neighborhood U5=min(499,125+12.5)=137.5, the candidate layers j∈[L5,U5] in the neighborhood are integers between 113 and 137. Calculate the significant contour feature value of each candidate layer in the neighborhood, and select the candidate layer corresponding to the largest significant contour feature value as the target layer corresponding to the initial selection layer. For example, if the significant contour feature value of the candidate layer of the 128th layer is the largest, then the candidate layer of the 128th layer is the target layer corresponding to the initial selection layer (the target layer in the neighborhood of the initial selection layer), that is, the 5th target layer.

[0107] Once the target layer corresponding to each initial selection layer is determined, the multiple target layers are arranged and laid out, and the output includes a drawing of multiple target layers with the optimal arrangement. The multiple target layers are placed on a single drawing, and the arrangement of the multiple target layers is optimized to make full use of the drawing and avoid waste. A genetic algorithm is applied to optimize the arrangement of the mosaic layers on the planar drawing with the goal of minimizing material waste, and a visual drawing containing layer numbers is output.

[0108] Arrange and layout multiple target layers, and output drawings of multiple target layers including the optimal arrangement and layout, including:

[0109] Preprocess the cutting contour of each target layer, record the position and rotation angle of the cutting contour of each target layer, and set each target layer as a puzzle piece;

[0110] Calculate the material utilization rate and overlap penalty, and then calculate the score based on these factors. The formula for calculating the material utilization rate is as follows:

[0111]

[0112] in, For the area of ​​the board, Let K be the cutting area of ​​the i-th selected layer, K be the number of target layers, and η be the material utilization rate. .

[0113] If two puzzle pieces overlap, an overlap penalty will be applied. For every certain area of ​​overlap, a corresponding number of points will be deducted. For example, 100 points will be deducted for every 1 cm² of overlap. Here, the overlap area and the points deducted can be selected and set according to actual needs.

[0114] The formula for calculating the total score sets the proportions of material utilization rate and overlap penalty, respectively. The proportion of material utilization rate is the first proportion, and the proportion of overlap penalty is the second proportion. The first proportion is greater than the second proportion. For example, the first proportion can be 70% and the second proportion can be 30%. The first and second proportions can be selected according to actual needs, and no specific requirements are made here.

[0115] The formula for calculating the total score is: Score = Material utilization rate × First ratio - Overlapping area × 100 × Second ratio.

[0116] When using a genetic algorithm combined with scores to calculate the optimal permutation solution, the population is initialized, and multiple different permutations are randomly generated. The types of permutations are selected according to actual needs, such as 50 types, and the following operations are performed:

[0117] Selection: Select the highest-scoring individuals from the population as "elites" and preserve them directly for the next generation;

[0118] Cross: Randomly select two arrangements and swap some puzzle pieces (target layer);

[0119] Mutation: Randomly modifies the coordinates or angle of a puzzle piece (target layer).

[0120] Repeat the selection, crossover, and mutation processes multiple times until the score no longer improves, thus obtaining the optimal permutation solution. The number of iterations can be selected according to actual needs, such as 1000 iterations.

[0121] The output visualization drawing is a DXF drawing. Based on the drawing, a layered cutting file is generated. The manufacturing equipment receives the layered cutting file and prepares the target layer module. The generated standardized layered cutting file format is DXF or SVG, which is compatible with various types of laser cutting manufacturing equipment.

[0122] The following is a detailed description using a specific embodiment.

[0123] A method for preparing a three-dimensional layered jigsaw puzzle includes the following steps:

[0124] Obtain two-dimensional design images, such as Figure 2 The two-dimensional design image shown;

[0125] Preprocessing the 2D design image removes noise while preserving edge contour details, resulting in a clear image with well-defined edges and a uniform format. Figure 3 The preprocessed two-dimensional design graphics are shown below;

[0126] The preprocessed 2D design image undergoes stereoscopic enhancement processing to generate a preliminary 3D image. This preliminary 3D image is a simulated 3D stereoscopic image; that is, the preprocessed 2D design image is redrawn to achieve a stereoscopic effect, transforming it into a simulated 3D stereoscopic image. Figure 4 The image shown is a preliminary 3D image with enhanced stereoscopic effect;

[0127] The initial 3D image is processed to generate a 3D model; that is, the stereoscopic image is converted into a 3D mesh model, such as... Figure 5 The three-dimensional model shown;

[0128] The 3D model is layered to form multiple desired target layers, such as... Figure 6 The layered result diagram shown below;

[0129] Arrange and layout multiple target layers to output drawings that include the optimal arrangement of multiple target layers, such as... Figure 7 The drawings shown represent the target layers, with a total of 25 target layers.

[0130] Based on the drawings, a layered cutting file is generated. The manufacturing equipment receives the layered cutting file and prepares the layer assembly module, such as... Figure 8 The image shown is of the assembled product.

[0131] This embodiment also provides an apparatus for preparing a three-dimensional layered jigsaw puzzle, including:

[0132] A two-dimensional design image preprocessing unit is used to acquire two-dimensional design images and preprocess them.

[0133] The preliminary 3D image generation unit is used to enhance the stereoscopic effect of the preprocessed 2D design image and generate a preliminary 3D image.

[0134] The 3D model generation unit is used to process the preliminary 3D image and generate a 3D model.

[0135] Layered units are used to process 3D models into layers, forming multiple desired target layers;

[0136] The drawing generation and output unit is used to arrange and layout multiple target layers, output drawings of multiple target layers including the optimal arrangement and layout, and generate layer cutting files based on the drawings.

[0137] This embodiment also provides an electronic device, including: a memory and a processor, wherein the processor is coupled to the memory, reads and executes instructions in the memory, so that the electronic device realizes the above-described method for preparing a three-dimensional layered mosaic.

[0138] This embodiment also provides a readable storage medium storing a computer program, which, when executed, implements the above-described method for preparing a three-dimensional layered jigsaw puzzle.

[0139] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the methods, processes, or functions described in the embodiments of the present invention are generated.

[0140] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0141] The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)). Where there is no conflict, the solutions of the above embodiments can be combined.

[0142] By employing the above technical solution, this method for preparing three-dimensional layered puzzles transforms any two-dimensional graphic into a three-dimensional model. The three-dimensional model is then layered to determine the target layer for producing the puzzle pieces. This target layer is then arranged to improve material utilization, outputting a visual drawing. This visual drawing is then used to generate a standardized layered cutting file. Cutting equipment then prepares the puzzle toy product based on this cutting file. The entire puzzle toy manufacturing process is automated, requiring no manual intervention from two-dimensional drawing to layered puzzle design. This overcomes the limitations of traditional methods that rely on designers. The output file directly connects to production equipment, making it industrially practical, reducing manufacturing costs, and widely applicable to educational toys, cultural and creative products, and other fields.

[0143] The embodiments of the present invention have been described in detail above, but the content described is only a preferred embodiment of the present invention and should not be considered as limiting the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the patent coverage of the present invention.

Claims

1. A method for preparing a three-dimensional layered jigsaw puzzle, characterized in that: Includes the following steps: Obtain a two-dimensional design image and preprocess the two-dimensional design image; The preprocessed two-dimensional design image is subjected to stereoscopic enhancement processing to generate a preliminary three-dimensional image; The preliminary 3D image is processed to generate a 3D model; The three-dimensional model is layered to form multiple desired target layers; In the step of layering the 3D model to form multiple target layers, based on the geometric features of the 3D model, a dynamic programming algorithm is used to determine the number of layers and the cutting contours to form multiple target layers, including: Analyze the 3D model: Read the 3D model information and cut the 3D model into a series of parallel 2D candidate layers along the height direction of the 3D model; Slicing: For each candidate layer, the plane and the mesh are intersected, the set of intersection lines is extracted, the intersection lines are converted into closed polygons, and the contour path is generated; Determine the target number of layers: Discretize the three-dimensional model along the height direction into N candidate layer positions, and determine the target number of layers based on the volume of the three-dimensional model and the thickness of the selected material; Determine each target layer: Based on the number of target layers and the total number of candidate layers, determine each initial selection layer required in the end. Perform edge recognition on each candidate layer in the search domain of each initial selection layer, and calculate the significant contour feature value of each candidate layer. Obtain the candidate layer that contains or approximates the significant contour line of the initial selection layer, and adjust the candidate layer that contains or approximates the significant contour line of the initial selection layer to the target layer corresponding to the initial selection layer. Arrange and layout the multiple target layers to output drawings of the multiple target layers including the optimal arrangement and layout; The layered cutting file is generated based on the drawings. The manufacturing equipment receives the layered cutting file and prepares the splicing layer module. In the step of arranging and laying out multiple target layers to output a drawing containing the optimal arrangement of multiple target layers, a genetic algorithm is applied to optimize the arrangement of multiple target layers on the planar drawing with the goal of minimizing material waste, and outputs a visual drawing containing layer numbers, including: The cutting contour of each target layer is preprocessed, and the position and rotation angle of the cutting contour of each target layer are recorded. Calculate the material utilization rate and overlap penalty, and calculate a score based on the material utilization rate and overlap penalty; The optimal solution is calculated using a genetic algorithm combined with the scores, and a visual drawing is output.

2. The method for preparing a three-dimensional layered jigsaw puzzle according to claim 1, characterized in that: Preprocessing the two-dimensional design image includes the following steps: The two-dimensional design image is denoised by using a Gaussian filtering algorithm to remove noise while preserving edge contour information. The edge contours are optimized by extracting the edge contours of the denoised 2D design image and filling in any breaks in the edge contours. The two-dimensional design image after edge contour optimization is subjected to format standardization processing to convert the two-dimensional design image into a unified format; The colors of the 2D design image after format standardization are simplified.

3. The method for preparing a three-dimensional layered jigsaw puzzle according to claim 1 or 2, characterized in that: In the step of enhancing the stereoscopic effect of the preprocessed two-dimensional design image to generate a preliminary three-dimensional image, an AI image generation tool based on a diffusion model is used to process the preprocessed two-dimensional design image to generate a preliminary three-dimensional image.

4. The method for preparing a three-dimensional layered jigsaw puzzle according to claim 3, characterized in that: The steps of performing stereoscopic enhancement processing on the preprocessed two-dimensional design image to generate a preliminary three-dimensional image include: Load the pre-trained diffusion model and input the pre-processed two-dimensional design image into the pre-trained diffusion model. The pre-trained diffusion model is a diffusion model based on the U-Net structure using the Stable Diffusion open-source framework. Image encoding: The preprocessed two-dimensional design image is normalized and then successively superimposed with noise that conforms to a normal distribution, which is encoded into a latent space vector; Set conditional controls: Configure edge contour information and prompt word information; Image decoding: Noise is removed by inverse diffusion based on the set edge contour information and prompt word information. In the U-Net decoder, shallow detail features and deep semantic features are fused, and the stereoscopic effect of the two-dimensional design image is adjusted by controlling the prompt words and control net weight allocation.

5. The method for preparing a three-dimensional layered jigsaw puzzle according to claim 1, 2, or 4, characterized in that: In the step of processing the preliminary 3D image to generate a 3D model, a large model is generated based on the 3D model, and the stereoscopic image is converted into a 3D mesh model, including: Geometric models are generated from conditional images using shape generation models; Texture maps are synthesized from geometric models using a texture synthesis model and a large-scale diffusion model.

6. The method for preparing a three-dimensional layered jigsaw puzzle according to claim 1, characterized in that: When using a genetic algorithm and combining the scores to calculate the optimal permutation solution, the population is initialized, multiple different permutations are randomly generated, and the following operations are performed: Selection: Select the highest-scoring individuals from the population and retain them directly for the next generation; Crossover: Randomly select two permutations and swap some of the target layers; Mutation: Randomly modifies the coordinates or angles of a target layer; Repeat the selection, crossover, and mutation steps multiple times until the score no longer improves, at which point the optimal permutation is obtained.

7. A device for preparing a three-dimensional layered jigsaw puzzle, characterized in that: include: A two-dimensional design image preprocessing unit is used to acquire a two-dimensional design image and preprocess the two-dimensional design image; A preliminary 3D image generation unit is used to perform stereoscopic enhancement processing on the preprocessed 2D design image to generate a preliminary 3D image. A 3D model generation unit is used to process the preliminary 3D image to generate a 3D model; A layering unit is used to perform layering processing on the 3D model to form multiple desired target layers. Based on the geometric features of the 3D model, a dynamic programming algorithm is used to determine the number of layers and the cutting contours to form multiple target layers, including: Analyze the 3D model: Read the 3D model information and cut the 3D model into a series of parallel 2D candidate layers along the height direction of the 3D model; Slicing: For each candidate layer, the plane and the mesh are intersected, the set of intersection lines is extracted, the intersection lines are converted into closed polygons, and the contour path is generated; Determine the target number of layers: Discretize the three-dimensional model along the height direction into N candidate layer positions, and determine the target number of layers based on the volume of the three-dimensional model and the thickness of the selected material; Determine each target layer: Based on the number of target layers and the total number of candidate layers, determine each initial selection layer required in the end. Perform edge recognition on each candidate layer in the search domain of each initial selection layer, and calculate the significant contour feature value of each candidate layer. Obtain the candidate layer that contains or approximates the significant contour line of the initial selection layer, and adjust the candidate layer that contains or approximates the significant contour line of the initial selection layer to the target layer corresponding to the initial selection layer. A drawing generation and output unit is used to arrange and layout multiple target layers, output a drawing including the optimal arrangement of multiple target layers, and generate a layered cutting file based on the drawing. A genetic algorithm is applied to optimize the arrangement of multiple target layers on the planar drawing with the goal of minimizing material waste, and a visual drawing containing layer numbers is output, including: The cutting contour of each target layer is preprocessed, and the position and rotation angle of the cutting contour of each target layer are recorded. Calculate the material utilization rate and overlap penalty, and calculate a score based on the material utilization rate and overlap penalty; The optimal solution is calculated using a genetic algorithm combined with the scores, and a visual drawing is output.

8. An electronic device, characterized in that: include: A memory and a processor, the processor being coupled to the memory to read and execute instructions in the memory, causing the electronic device to implement the method for preparing a three-dimensional layered puzzle according to any one of claims 1-6.

9. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed, implements the method for preparing the three-dimensional layered jigsaw puzzle according to any one of claims 1-6.

Citation Information

Patent Citations

  • Toy manufacturing method based on rapid forming technique

    CN103434137A

  • A stereoscopic jigsaw puzzle and a manufacturing method thereof

    CN109126114A

  • Slicing method, printing method, device and equipment for mapping three-dimensional model

    CN113183469A

  • Building design method based on stable diffusion model multi-modal generation technology and application

    CN120974589A