Preview image generation method, device and system for processing, medium and product
By segmenting and merging the processing image based on the size information of the processing model in laser engraving technology, a preview image for rotation processing is generated, which solves the problem of low efficiency and accuracy in generating preview images in existing technologies and improves the efficiency and accuracy of laser engraving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MAKER WORKS TECH CO LTD
- Filing Date
- 2024-11-15
- Publication Date
- 2026-05-22
AI Technical Summary
Existing laser engraving technology is inefficient and inaccurate in generating preview images for rotational processing, requiring users to perform additional segmentation and stitching, which affects processing efficiency and accuracy.
The processing image is segmented and merged based on the processing surface size information used for rotation processing in the processing model to generate a merged processing image. This image is then rendered to obtain a preview image, which shows the material effect after the processing pattern is filled into the processing model.
It improves the efficiency and accuracy of generating preview images for rotary processing, enhances the intuitive display of processing results, and improves the processing efficiency and accuracy of laser engraving.
Smart Images

Figure CN122072979A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and specifically to a method, apparatus, system, medium, and product for generating preview images for processing. Background Technology
[0002] With the increasing popularity of laser engraving technology, it has been widely applied in various fields due to its high efficiency, high precision, and strong flexibility. Laser engraving technology refers to using a high-power-density focused laser beam to cause physical changes on the surface or inside of the material being processed, leaving the desired pattern or texture on the surface of the material, thus endowing various materials with unique artistic value and practicality.
[0003] Currently, before laser engraving materials, users can design the laser engraving pattern using modeling or editing software. This software allows users to import or draw patterns and generate preview images based on them, greatly facilitating the process. However, preview images generated for specific processing methods require additional segmentation and stitching by the user, resulting in lower efficiency and accuracy, wasting materials and time, and potentially reducing processing efficiency and accuracy. Summary of the Invention
[0004] This application provides a method, device, system, medium, and product for generating preview images for processing, which helps to improve the efficiency and accuracy of generating preview images for rotational processing, and to a certain extent improves the processing efficiency and accuracy of laser engraving.
[0005] In a first aspect, embodiments of this application provide a method for generating a preview image for processing, the method comprising:
[0006] In response to a request to generate a preview image for rotary machining, obtain a machining image including the machining pattern, machining dimension information, and model information of the machining model;
[0007] Based on the machining dimension information, determine the machining surface dimension information in the machining model used for the rotary machining;
[0008] The processing image is segmented based on the processing surface size information, and the segmented processing sub-images are then fused to obtain a fused processing image.
[0009] The model information is rendered based on the fused processing image to obtain a preview image of the processing pattern being processed onto the processing model through the rotation processing. The preview image is used to present the material effect after the processing pattern is filled into the processing model.
[0010] Secondly, embodiments of this application provide a preview image generation apparatus for processing, the apparatus comprising:
[0011] The acquisition unit is used to acquire, in response to a request to generate a preview image for rotary machining, a machining image including a machining pattern, machining dimension information, and model information of the machining model.
[0012] The determining unit is used to determine the machining surface size information in the machining model for the rotary machining based on the machining size information;
[0013] The processing unit is used to segment the processing image based on the processing surface size information, and to fuse the segmented processing sub-images to obtain a fused processing image;
[0014] The processing unit is further configured to perform rendering processing on the model information based on the fused processing image to obtain a preview image of the processing pattern being processed onto the processing model through the rotation processing, wherein the preview image is used to present the material effect after the processing pattern is filled into the processing model.
[0015] Thirdly, embodiments of this application provide a processing device, including: a slide rail; a processing head slidably disposed on the slide rail; a communication component for receiving a processing pattern obtained according to the steps of the preview image generation method for processing as described above; and a controller for controlling the processing head to move on the slide rail to perform processing based on the obtained processing pattern.
[0016] Fourthly, embodiments of this application provide a system comprising: a processing device, the processing device including a processing device base plate and a processing head, the processing device base plate including a processing area for placing materials, the processing head for moving on the processing area; and a terminal device communicating with the processing device, the terminal device being used to execute the preview image generation method for processing as described above.
[0017] Fifthly, embodiments of this application provide an electronic device, including: one or more processors; and a memory for storing one or more computer programs, which, when executed by the one or more processors, cause the electronic device to implement the preview image generation method for processing as described above.
[0018] Sixthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the preview image generation method for processing as described above.
[0019] In a seventh aspect, embodiments of this application provide a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the preview image generation method for processing as described above.
[0020] In some embodiments of this application, in response to a request to generate a preview image for rotational machining, a machining image including a machining pattern, machining dimension information, and model information of the machining model are obtained. Then, based on the machining dimension information, the dimension information of the machining surfaces used for rotational machining in the machining model is determined. Next, the machining image is segmented based on the machining surface dimension information, and the segmented machining sub-images are fused to obtain a fused machining image. Finally, the model information is rendered based on the fused machining image to obtain a preview image showing the material effect after the machining pattern is filled into the machining model through rotational machining. This preview image is used to present the material effect after the machining pattern is filled into the machining model. Therefore, on the one hand, by segmenting and merging the processing image based on the processing surface size information used for rotation processing in the processing model to render a preview image, compared to the need for manual segmentation and splicing of the processing pattern after the user draws the processing pattern, it is beneficial to improve the efficiency and accuracy of generating a preview image containing multi-ring patterns suitable for rotation processing, making the generation of high-quality preview images simpler and more convenient. On the other hand, it can generate preview images with material effects, which is beneficial to more intuitively display the processing effect and can improve the processing efficiency and accuracy of laser engraving to a certain extent. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 It is a user interface diagram of a user-designed and processed pattern;
[0023] Figure 2 This is another user interface diagram of a user-designed and processed pattern;
[0024] Figure 3 This is a schematic diagram of a machining process for rotating multiple revolutions, provided in an embodiment of this application.
[0025] Figure 4 This is a schematic diagram illustrating the principle of mesh parameterization.
[0026] Figure 5This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0027] Figure 6 This application provides a flowchart illustrating a method for generating preview images for processing.
[0028] Figure 7 This is a schematic diagram of a pattern drawing interface provided in an embodiment of this application;
[0029] Figure 8 This is a schematic diagram illustrating the principle of a segmentation and fusion process provided in an embodiment of this application;
[0030] Figure 9 This is a schematic diagram of a preview image provided in an embodiment of this application;
[0031] Figure 10 This is a schematic diagram of a processing view provided in an embodiment of this application;
[0032] Figure 11 This is a schematic diagram of another preview image provided in an embodiment of this application;
[0033] Figure 12 This is a schematic diagram of yet another preview image provided in an embodiment of this application;
[0034] Figure 13 This is a schematic diagram of another preview image provided in an embodiment of this application;
[0035] Figure 14 This is a schematic diagram of the structure of a preview image generation device for processing provided in an embodiment of this application;
[0036] Figure 15 This is a schematic diagram of the structure of a computer system for an electronic device provided in an embodiment of this application. Detailed Implementation
[0037] It should be noted in advance that, in order to enable those skilled in the art to better understand the technical solutions proposed in the embodiments of this application, the embodiments of this application will be described clearly and completely in conjunction with one or more accompanying drawings. Furthermore, the various drawings shown in the embodiments of this application are merely illustrative examples; for example, the execution order of each step in the drawings can be adaptively adjusted according to the actual application scenario. In addition, in the embodiments of this application, the block diagrams shown in the various drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0038] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0039] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0040] With the increasing popularity of laser engraving technology, also known as laser printing, laser engraving refers to using a high-energy laser beam to cause physical changes on the surface or inside of a material, leaving delicate and precise patterns on the surface. This can endow various materials with unique artistic value and practicality. Currently, before laser engraving a material, users can design the engraving pattern using editing or modeling software. These software programs allow users to import or draw patterns and generate preview images based on the patterns, greatly facilitating users.
[0041] Please see Figure 1 and Figure 2 , Figure 1 and Figure 2 These are all user interface diagrams of user-designed and processed patterns, such as... Figure 1 As shown, this user interface is the operation interface of the editing software. This software provides drawing controls for creating machining patterns and import controls for importing machining patterns. Users can create a canvas (e.g., "Canvas 1") within the software. This canvas can include an area for drawing machining patterns (also called the "surface machining design area"). Users can draw machining patterns on this canvas, such as... Figure 1 The gray trapezoid shown is a preview image drawn by the user on the canvas. This editing software can also establish a communication connection with laser engraving equipment, transmitting user-drawn patterns to the equipment for processing.
[0042] like Figure 2 As shown, this user interface is the operating interface of the modeling software, which can be used to build or import machining models, such as... Figure 2The machining model shown on the right side of the image can also be provided by the modeling software, which offers an unfolded surface ("texture design area") for the machining model. Figure 2 As shown on the left, users can draw or import processing patterns into the unfolded surface. The modeling software can then fill the processing pattern drawn or imported into the processing model on the right. In other words, the carving content is filled into the model through a limited area, so that users can preview the effect of the processing equipment.
[0043] In the first method, the editing software can only display the processing pattern drawn or imported by the user, which is a two-dimensional (2D) image. For scenarios requiring the processing equipment to rotate multiple times over the material, the software lacks preview capabilities for this rotational processing method. This means it cannot automatically handle texture creation for multiple rotations, resulting in a preview image that only shows the user-drawn pattern. Furthermore, the user cannot perceive the material effects or understand the texture and material properties applied to the processing material. This approach negatively impacts the user's processing experience and, to some extent, the final engraving effect, leading to wasted materials and time, and reduced processing efficiency and accuracy.
[0044] Please refer to the following: Figure 3 , Figure 3 This is a schematic diagram of a machining process for rotating multiple revolutions, provided in an embodiment of this application. Figure 3 As shown, the texture of each ring in the processing model can be obtained by a rotational processing method. Each ring of texture can be a part of the processing pattern, or it can be obtained by the processing equipment continuously rotating the processing material multiple times based on the processing pattern.
[0045] For the second method, although the modeling software can demonstrate the effect of machining materials filled with machining patterns for rotary machining, this method requires the user to draw the machining patterns on the unfolded surface. For example... Figure 3 In the scenario depicting multi-turn rotation processing, the user needs to further segment the processing pattern and design the end-to-end connection. For example, the processing pattern needs to be segmented according to the sub-patterns of each turn of the processing material, and then stitched together in the unfolded surface according to the processing positions of each turn processed by the processing equipment, thus generating a preview image. This method of generating preview images has a high barrier to entry and limited applicability. If high accuracy and detail are required, a significant amount of time is needed for segmentation and stitching. Furthermore, if the generated preview image is to have material effects, an additional material texture image needs to be imported, resulting in lower accuracy and efficiency in preview image generation, which may affect processing efficiency and accuracy to some extent.
[0046] Based on this, embodiments of this application provide a preview image generation scheme for processing. By segmenting and fusing a processing image including a processing pattern based on the processing surface size information used for rotational processing in the processing model, a fused processing image is obtained. Furthermore, by rendering the model information based on the fused processing image, a preview image can be obtained showing the processing pattern being processed onto the processing model using a rotational processing method. This preview image can also display the material effect after the processing pattern is filled into the processing model. Therefore, this method can automatically generate preview images for rotational processing, especially for processing equipment that requires continuous rotation multiple times. This improves the accuracy and generation efficiency of the preview image, enhances its applicability, and to some extent improves the engraving effect after processing.
[0047] The following is an explanation of some terms and concepts that may be involved in the embodiments of this application.
[0048] 1) Material: This refers to the visual or tactile characteristics of an object, such as its texture and grain. These characteristics are usually determined by the object's physical and chemical properties and can be perceived through human senses (such as sight and touch). In the real world, because each object has a different material, each object will react differently to light. For example, a steel object will usually appear more shiny than a terracotta vase, and a wooden box will not reflect the same amount of light as a steel box. During computer rendering, material information is combined with the object's interaction with light (the different reactions of different materials to light) to jointly determine the object's display effect in the final image (preview image). The rendering engine (renderer) can read datasets describing the object's surface properties, such as color, metallicity, and roughness in texture maps, and then generate the final preview image based on lighting algorithms.
[0049] 2) Texture: This refers to data used to describe the visual characteristics of an object's surface, such as color, gloss, and roughness. In computer graphics, textures are typically implemented using bitmaps stored in memory. A bitmap is an image format where the color information of each pixel is directly stored in a two-dimensional array. Each pixel typically contains information from three color channels: red (R), green (G), and blue (B), as well as information from an alpha (A) channel. A bitmap can contain detailed patterns and color information of an object's surface; this type of bitmap can be called a texture map, texture base map, etc.
[0050] In computer graphics, texture effects are achieved by mapping bitmaps (texture maps) stored in memory onto the surface of three-dimensional (3D) objects. During this mapping process, UV coordinates are typically used to define the mapping relationship between points on the 2D texture map and points on the 3D model (such as a fabricated model). These UV coordinates can also be called parametric domain plane coordinates. U and V correspond to the horizontal and vertical axes in 2D texture space, similar to the X and Y axes but specifically referring to texture coordinates. U and V range from 0 to 1, representing floating-point numbers. The UV coordinates determine which specific point in the texture map a point in the fabricated model should obtain its color value from during rendering. UV coordinate mapping ensures that the texture image is correctly filled onto the model's surface and deforms as the model deforms.
[0051] 3) Mesh Parameterization: This refers to the process of flattening the surface of a 3D model (such as a machining model) into a 2D plane. It is typically achieved by mapping discrete meshes (such as polygonal meshes) in the 3D model to a 2D planar mesh. The ultimate goal of mesh parameterization is to find the mapping between 3D coordinates on the mesh and UV coordinates in the parameter domain plane, i.e., g:(x,y,z)→(u,v). (x,y,z) are the coordinates of points on the 3D model, and (u,v) are the mapped UV coordinates. This mapping process needs to satisfy certain constraints, such as rigid transformation. In practical applications, mesh parameterization is often used for texture mapping, unfolding the curved surfaces of the original 3D model onto a plane. That is, through a function, the 3D surface is mapped to the 2D domain in a one-to-one correspondence, facilitating the addition of textures to the 3D model.
[0052] Please refer to the following: Figure 4 , Figure 4 This is a schematic diagram illustrating the principle of mesh parameterization, such as... Figure 4 As shown, the top left corner displays a 3D model including a human face, such as a male head. The top right corner shows an example of a texture map, a black and white checkered pattern, used to demonstrate the effect of texture mapping. Figure 4 The bottom left corner shows a diagram of unfolding the 3D model shown in the top left corner into a 2D plane. This illustrates the mesh parameterization process and can be used to map coordinates in the 3D model to UV coordinates in the texture map. From this, we can obtain... Figure 4 The preview image shown in the lower right corner is an example of applying the black and white checkered texture map shown in the upper right corner to the 3D model that includes the human face.
[0053] Based on the above description, please refer to Figure 5 , Figure 5 This is a schematic diagram of an implementation environment provided in an embodiment of this application. The implementation environment includes...
[0054] The system includes a preview image generating device 501, a pattern input device 502, and a processing device 503. The pattern input device 502 can be directly or indirectly connected to both the preview image generating device 501 and the processing device 103 via wired or wireless means. The pattern input device 502 can be equipped with the host computer software for the processing device 103. This host computer software provides a device control interface, allowing users to perform relevant trigger operations on the device control interface to use the processing device to process materials. It should be noted that... Figure 1 The number and configuration of devices shown are for illustrative purposes only and do not constitute a limitation on the embodiments of this application. In some embodiments, there may be multiple preview image generation devices 501, pattern input devices 502, and processing devices 503. In some embodiments, the preview image generation device 501 and the pattern input device 502 may be the same device.
[0055] The preview image generation device 501 and the pattern input device 502 can be terminal devices, which may include, but are not limited to, smartphones (such as Android phones, iOS phones, etc.), tablet computers, portable personal computers, mobile internet devices (MIDs), smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable devices, etc. This application embodiment does not limit this; the preview image generation device 501 may also be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence (AI) platforms. This application embodiment does not limit this.
[0056] It should be noted that the processing equipment 503 can be an electronic device for laser engraving based on a processing pattern, especially an electronic device for rotary processing. For example, the processing equipment 503 may include a base to fix the processing material in the processing equipment 503 and rotate it. Laser engraving is then performed on the processing material during the rotation process. Exemplarily, the processing equipment 503 can be a laser processing device, which is a device that uses a laser beam for processing and can engrave various processing materials such as metal, plastic, wood, glass, textiles, leather, stickers, etc., including but not limited to laser engraving machines, laser cutting machines, laser printers, etc.
[0057] In some embodiments, the preview image generating device 501 and the pattern input device 502 may be equipped with a display screen, which can be used to output a user interface, such as the user interface of editor software. Users can input processing patterns, processing size information, and model information of the processing model based on the user interface, and trigger a request to generate a preview image for rotational processing. Furthermore, the display screen can be used to display a rendered preview image of the processing pattern processed onto the processing model using a rotational processing method.
[0058] The general flow of the preview image generation method for processing provided in this application is as follows: Preview image generation device 501 can respond to a request to generate a preview image for rotational processing, acquire a processing image including the processing pattern, processing dimension information, and model information of the processing model. Then, based on the processing dimension information, it determines the dimension information of the processing surface in the processing model used for rotational processing. Next, based on the processing surface dimension information, it performs segmentation processing on the processing image and merges the segmented processing sub-images to obtain a merged processing image. Finally, based on the merged processing image, it renders the model information to obtain a preview image showing the processing pattern being processed onto the processing model through rotational processing. This preview image can be used to present the material effect of the processing pattern being filled into the processing model. The generation request can be generated by pattern input device 502, and the processing image can be transmitted to processing device 503 to perform rotational processing on the processing material to obtain the same engraving effect as the preview image.
[0059] It is understood that in the specific implementation of this application, user-related data is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0060] It is understood that the implementation environment described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0061] Based on the above implementation environment, please refer to Figure 6 , Figure 6 This application provides a flowchart illustrating a method for generating preview images for processing, which can be implemented by an electronic device. The electronic device can be... Figure 5 The preview image generation device 501 shown may include the following steps S601-S604:
[0062] S601, in response to a request to generate a preview image for rotary machining, obtain a machining image including a machining pattern, machining dimension information, and model information of the machining model.
[0063] In this embodiment, rotary processing refers to a processing method in which a processing device laser-engraves (engraving at varying depths using a laser beam) the material while it is rotating. A preview image is an image used to preview the processing effect after the material has been processed by the rotary processing device. A generation request can be a request to instruct the generation of the preview image; this request can be information in a specific format that can be parsed by an electronic device, thereby enabling the execution of a corresponding response, i.e., generating the preview image. A processing pattern refers to a pattern that the processing device applies to the material through rotary processing. A processing image including the processing pattern refers to an image carrying the processing pattern; this processing image can be a bitmap, where each pixel contains information from the R, G, B, and A channels.
[0064] The processing dimension information can refer to the dimensions of the cross-sections (bottom surfaces) included in the 3D model. For example, if the 3D model is a cylinder, the processing dimension information can refer to the radius, diameter, and circumference of the cylinder's bottom surface. If the 3D model is a model of a specific shape type, including multiple cross-sections of different shapes, the processing dimension information can refer to the radius, diameter, and circumference of a specified cross-section in the 3D model. The specified cross-section can be, for example, the cross-section with the largest area (diameter / radius / circumference), or a cross-section specified in other ways; this application does not limit this. The model information of the processing model is used to indicate the shape type of the processing model, which refers to a model that simulates the shape of the processed material. For example, the processing model can be a cylinder, or other shape types, such as a water cup; this application does not limit this.
[0065] In some embodiments, the processing image, processing dimension information, and model information, including the processing pattern, may be included in the generation request. This generation request may be generated by an electronic device, such as... Figure 5 The preview image generation device or pattern input device shown.
[0066] For example, the generation request can be generated by an image input device. The pattern input device can acquire a processing image including the processing pattern, processing size information and model information, and generate the generation request based on the acquired information. Then, the generation request can be sent to a preview image generation device so that the preview image generation device can parse the generation request and execute the response processing corresponding to the generation request, that is, generate a preview image.
[0067] In another example, the generation request is generated by a preview image generation device. The preview image generation device can acquire a processing image including the processing pattern, processing size information, and model information, and generate the generation request based on the acquired information. Then, the preview image generation device can parse the generation request and execute the response processing corresponding to the generation request.
[0068] In one possible implementation, before responding to a request to generate a preview image for rotary machining, the electronic device may display a pattern drawing interface including at least one input control and a preview image generation control. Then, in response to receiving an input operation to at least one input control in the image drawing interface, the electronic device determines, based on the input information carried by the input operation, a machining image including the machining pattern, machining dimension information, and model information of the machining model. Subsequently, in response to receiving a selection operation on the preview image generation control, the electronic device generates the generation request based on the machining image, machining dimension information, and model information.
[0069] The electronic device may be equipped with software for inputting processing patterns. This software can be editing software or laser processing software. Running this software, the electronic device can display a pattern drawing interface. This image drawing interface includes at least one input control, each of which can be used to input different information. Each input control has a different form in the pattern drawing interface; this embodiment does not limit this. The input information is information entered by the user through input operations on different input controls, such as the processing image of the processing pattern, processing dimension information, and model information. Different input information can be entered for different input controls. Optionally, the input information can also be multiple pieces of information entered by the user through input operations on the same input control; this application does not limit this either.
[0070] The preview image generation control is used to trigger the generation of a preview image, that is, to trigger the generation request. This control can be understood as confirming the information entered in response to an input operation on at least one input control. In response to the selection of the preview image generation control, the electronic device can generate information in a specific format, i.e., a generation request. This generation request may include the information entered by the user for subsequent parsing and response processing.
[0071] In one possible implementation, this application embodiment uses at least one input control that may include a pattern input control, a size input control, and a model selection control as an example for explanation. In response to receiving an input operation for the at least one input control, the electronic device determines, based on the input information carried by the input operation, processing image, processing size information, and model information. Specifically, in response to receiving an input operation for the pattern input control, a processing image is determined based on the processing pattern carried by the input operation; in response to receiving a size input operation for the size input control, processing size information is determined based on the size information carried by the size input operation; and in response to receiving a selection operation for the model selection control, model information is determined based on the shape type carried by the selection operation.
[0072] Please refer to the following: Figure 7 , Figure 7 This is a schematic diagram of a pattern drawing interface provided in an embodiment of this application, such as... Figure 7 As shown, the pattern drawing interface may include at least one input control. For example, the at least one input control may include a pattern input control, a size input control, and a model selection control. The pattern input control may be presented in the form of a canvas. The electronic device responds to receiving an input operation on the pattern input control, which may be in response to receiving an operation from the user that allows them to draw (or import) a processing pattern on the canvas. The processing pattern carried by this input operation is the processing pattern drawn by the user, for example... Figure 7 As shown by the diagonal line from the top left to the bottom right, electronic devices can determine the processing image based on the bitmap carrying the processing pattern.
[0073] This dimension input control can be a text input box, used to input machining dimension information. For example, it can input dimensions indicating the cross-section (base) included in the 3D model, such as the base radius, diameter, and circumference of a cylinder model. It can also specify the radius, diameter, and circumference of a cross-section in a model of a specific shape. The specified cross-section can be, for example, the maximum / minimum area (diameter / radius / circumference) or a specific cross-section. The unit of this machining dimension information is millimeters (mm).
[0074] The model selection control can be a selection button used to select the shape type of a 3D model, such as a cylinder model or a model of a specific shape. The software can provide multiple preset shape types, allowing users to choose from among them. In some embodiments, if the user does not input any selection action for the model selection control, the electronic device can default to a cylinder model.
[0075] Therefore, after determining the processing image, processing dimension information, and model information, the electronic device can generate a request to create a preview image for rotary processing. Furthermore, in response to this request, the electronic device can acquire the processing image, processing dimension information, and model information from the request, and based on the processing dimension information, determine the dimension information of the processing surface in the processing model used for rotary processing.
[0076] S602. Based on the above machining dimension information, determine the machining surface dimension information of the machining model used for the above rotary machining.
[0077] In this embodiment, the machining dimension information can be user-inputted dimensions of the cross-section (bottom surface) in the machining model, such as the diameter, radius, and circumference of the cross-section (bottom surface). The machining surface used for rotational machining in the machining model can be understood as the unfolded surface of the machining model. For example, if the machining model is a cylinder, the machining surface used for rotational machining is the rectangular unfolded surface of the cylinder, where the width of the rectangular unfolded surface is the circumference of the bottom surface of the cylinder, and the height is the height of the cylinder. The machining surface dimension information can refer to the dimensions of the machining surface; for example, if the machining model is a cylinder, the machining surface dimension information can refer to the width and height of the rectangular unfolded surface.
[0078] Understandably, since the machining dimension information is the dimension information of the cross-section (bottom surface) in the machining model specified by the user, the user also inputs a machining image including a machining pattern, which also contains dimension information, such as... Figure 7 The processing image shown includes the width dimension in the horizontal direction (x-axis direction) and the height dimension in the vertical direction (y-axis direction). The processing dimension information input by the user, such as the circumference of the cross-section of a cylindrical model, can be understood as the dimension by which the processing equipment wants to rotate one revolution. If the processing dimension information input by the user is smaller than the width (horizontal direction) of the processing image, the electronic device can determine that the user wants to process the pattern onto the material by continuously rotating it multiple times. Therefore, it can generate a preview image including the multi-revolution pattern, i.e., a preview image for rotational processing.
[0079] To generate a preview image for continuously rotating a pattern into the material, the electronic device can first determine the size information of the processing surface used for rotational processing. Then, based on the size of the unfolded surface, it can further segment and merge the processing image, allowing the user to manually segment and stitch the image on the unfolded surface. This avoids additional processing operations by the user and improves the efficiency and accuracy of preview image generation.
[0080] It should be noted that the shape type of the processing model indicated by the model information obtained by the electronic device can be divided into two cases: one is to indicate only the shape type of the model, such as only indicating a cylindrical model, without including any preset size information; the other is to indicate a specific shape type, which can be one of the preset shape types provided by the software, and carries preset model size information inside.
[0081] Below, we will provide a detailed introduction to each of these two scenarios:
[0082] In the first scenario, the model information only indicates the shape type of the processing model and does not include any preset dimensions. The electronic device can then create a processing model of that shape type to generate a preview image. Specifically, the electronic device can create a processing model of that shape type using the dimensions indicated by the processing dimension information as the base dimension and the dimensions of a specified side in the processing image as the height dimension. The dimensions indicated by the processing dimension information can be the radius, diameter, perimeter, etc., of the base, and the dimensions of the specified side in the processing image can be the vertical height dimension of the processing image. This is because dimensions based on the specified side of the processing image can better demonstrate the effect of the processing pattern being filled into the processing model. Optionally, the height of the created processing model can also be other dimensions; this application does not limit this.
[0083] For example, in this embodiment of the application, the shape type of the processing model is a cylindrical model. The size of the bottom surface of the cylindrical model created by the electronic device can be determined based on the bottom circumference size indicated by the processing size information, and the height of the cylindrical model can be determined based on the vertical height size of the processing image. Thus, the electronic device creates a cylindrical model, which is a model used to simulate the processing material.
[0084] Furthermore, the electronic device can determine the dimensions of the unfolded surface of the processing model based on the dimensions indicated by the processing dimension information and the dimensions of a specified side in the processing image, thus obtaining the processing surface dimension information. For example, taking a cylindrical model as an example, the processing surface dimension information can include the width and height dimensions of the unfolded rectangular surface of the cylindrical model. That is, the width of the unfolded rectangular surface is the dimension indicated by the processing dimension information, such as the perimeter of the base, and the height of the unfolded rectangular surface is the dimension of the specified side in the processing image, i.e., the vertical height dimension in the processing image.
[0085] In the second scenario, the model information indicates not only the shape type of the machining model but also its preset dimensions. For example, a user selects a preset shape type from the pattern drawing interface; the model information includes indications that the machining model is of the preset shape type, as well as the preset dimensions corresponding to that preset shape type. This preset shape type machining model can refer to a machining model already created by the software, allowing the electronic device to directly perform subsequent processing based on the data from that machining model.
[0086] The preset dimension information can include the dimensions of each side of the machining model, as well as the fixed proportional relationships between these dimensions. For example, taking a water cup shape as the preset shape type, this water cup shape can be composed of two irregular cylinders, with the cross-sectional area of the cylinder near the rim being larger than that of the cylinder near the bottom. Then the preset dimension information can include the dimensions of each cross-section of the machining model, the height of the machining model, and the proportional relationships between these dimensions.
[0087] Therefore, the electronic device can scale the processing model of the preset shape type based on the processing dimension information. Specifically, the electronic device can scale the preset dimension information based on the proportional relationship between the specified cross-sectional dimension in the preset dimension information and the dimension indicated by the processing dimension information, to obtain a processing model with the specified cross-sectional dimension as indicated by the processing dimension information and the shape type as the preset shape type. In the embodiments of this application, the specified cross-section can be, for example, the cross-section with the largest area, the cross-section with the smallest area, or a specific cross-section, and this application does not limit this. The specified cross-sectional dimension in the preset dimension information can be the radius, diameter, perimeter, or other dimensions of the specified cross-section.
[0088] It should be noted that when performing scaling, if the dimension indicated by the processing dimension information is, for example, the perimeter of a cross-section, then the proportional relationship must be determined with the perimeter of the specified cross-section. If the dimension indicated by the processing dimension information is the radius of a cross-section, but the specified cross-section dimension is the diameter, then both dimensions must be converted to the same type of dimension, such as all being converted to diameter dimensions, before the proportional relationship can be determined.
[0089] In other words, the specified cross-sectional dimension is scaled to the dimension indicated by the processing dimension information, and other dimensions in the preset dimension information are scaled proportionally, such as enlarged proportionally, to obtain a processing model with the specified cross-sectional dimension as indicated by the processing dimension information and the shape type as the preset shape type.
[0090] Furthermore, the electronic device can determine the dimensions of the unfolded surface of the processing model based on the preset dimension information and the dimensions indicated by the processing dimension information, thereby obtaining the processing surface dimension information. It is understood that the preset dimension information also includes the dimensions of the unfolded surface. Based on the determined proportional relationship (based on the proportional relationship determined by the cross-sectional dimensions specified in the preset dimension information and the dimensions indicated by the processing dimension information), the dimensions of the unfolded surface can be scaled to determine the dimensions of the unfolded surface of the processing model, such as the dimensions of each side, thus obtaining the processing surface dimension information.
[0091] Furthermore, the processing image can be segmented based on the processing surface size information, and the segmented sub-images can be fused to generate a preview image based on the fused image.
[0092] S603. Based on the above processing surface size information, the above processing image is segmented, and the segmented processing sub-images are fused to obtain a fused processing image.
[0093] In this embodiment, segmentation refers to splitting the processed image. Since the electronic device can determine that the user wants to obtain a preview image of the processed pattern being continuously rotated and processed into the processed material, it can split the processed image according to the processing pattern corresponding to each rotation based on the processing surface size information. The image obtained after segmentation can be called a processed sub-image. Fusion processing can refer to image superposition processing of multiple processed sub-images, or it can refer to fusion calculation processing based on the pixel values of each processed sub-image to generate a new image that combines the features of multiple processed sub-images, i.e., a fused processed image.
[0094] Specifically, the process by which the electronic device segments the processing image based on the processing surface size information can be as follows: the electronic device first scales the processing image based on the proportional relationship between the set size and the size of the processing image to obtain a scaled processing image, and then segments the image along a specified edge based on the size associated with the cross-section of the processing model in the processing surface to obtain multiple processing sub-images.
[0095] The set size is the resolution-related size used when generating the preview image. For example, if the preview image can be used for display on a 2K resolution screen, then the set size can be 2048 pixels (px). The proportional relationship between the set size and the size of the processed image can be the ratio between the set size and the width in the horizontal direction of the processed image, or the ratio between the set size and the height in the vertical direction of the processed image. Based on this proportional relationship, the processed image can be scaled proportionally to obtain a resized processed image, i.e., a scaled processed image.
[0096] In this context, the dimension associated with the cross-section of the machining model within the machining surface can refer to the dimension around the machining model. For example, if the machining model is a cylinder, the dimension associated with the cross-section of the machining model within the machining surface can refer to the width of the machining surface, i.e., the circumference of the cross-section (bottom surface) of the cylinder model. The specified edge in the scaled machining image can refer to the edge containing the width in the horizontal direction. This is because the machining pattern is processed onto the material by continuous multi-turn rotation in the horizontal direction. For example, taking a cylinder model as an example, the scaled machining image can be segmented along the horizontal edge (width) based on the bottom circumference to obtain a sub-image with a width equal to the bottom circumference.
[0097] It should be noted that since the width of the processed image is not necessarily an integer multiple of the dimension associated with the cross-section of the processed model in the processed surface, the image whose width is insufficient to be associated with the cross-section of the processed model in the processed surface can be used as the last processed sub-image for subsequent fusion processing.
[0098] In some embodiments, during the process of segmenting a scaled processing image, the electronic device may also crop the scaled processing image based on the dimensions of the processing surface that are highly correlated with the processing model, thereby obtaining multiple processing sub-images.
[0099] In one possible implementation, the electronic device scales the processed image based on the proportional relationship between a set size and the size of the processed image to obtain a scaled processed image. Specifically, the electronic device first determines a first ratio based on the proportional relationship between reference size information used to display the processed image and the resolution information of the processed image. Then, it determines a second ratio based on the minimum ratio between the set size and the dimensions of each side in the processed image. Finally, based on the first and second ratios, the processed image is scaled to obtain the scaled processed image.
[0100] The reference size information displayed for the processed image refers to the scale size of the processed image in the editor, for example... Figure 7 The scale shown can be in millimeters (mm), and the resolution information of the processed image can refer to pixel (px) dimensions. The ratio between the reference size information and the resolution information can refer to the scale (mm) size corresponding to each pixel (px) size, or the pixel size corresponding to each scale (mm) size. For example, 10mm corresponds to 100px, or 10px per millimeter. Therefore, the determined first ratio can be used to convert the size of the processed image from pixel dimensions to millimeter dimensions.
[0101] The set size can be a resolution-related size used when generating the preview image. For example, if the resolution is 2K, the set size can be 2048 pixels. The dimensions of each side in the processed image can include the width and height of the processed image. In other words, the ratio between the set size and the width of the processed image, and the ratio between the set size and the height of the processed image can be calculated separately. The minimum ratio determined is then used as the second ratio. This is because, in order for the generated preview image to adapt to 2K resolution, the maximum factor by which the processed image is scaled to 2048 pixels can be determined, and this maximum factor is the second ratio.
[0102] Furthermore, scaling the processed image based on the first and second ratios can refer to multiplying the product of the first and second ratios by the width and height dimensions of the processed image, respectively, to obtain the scaled processed image size. The processed image is then scaled based on its size, for example, by enlarging it to obtain the scaled processed image. Enlargement can be achieved through interpolation or other methods, which are not limited in this application.
[0103] It's important to note that while current editing and modeling software can generate preview images of the pattern filling the model after drawing the processing pattern, these rendered previews typically lack material information. This may not accurately represent the visual effect of the area containing the processing pattern after processing the material. Because the processing content (the processing pattern is generated later) is limited, current software cannot simulate material changes in localized areas of the model's surface. Therefore, users may be unable to decide whether to process the pattern based solely on their imagination. Thus, after scaling the processing image, color transformation can be applied to this scaled image to generate a corresponding processing material image. This allows the visual effect of the material corresponding to the processing pattern to be simulated in the generated preview image.
[0104] In one possible implementation, the electronic device can perform color transformation processing on the scaled processing image based on the display attributes of each pixel in the processed image to obtain a processed material image corresponding to the scaled processing image. Here, the display attributes of each pixel can be understood as the color value and transparency value of each pixel. Color transformation processing refers to the calculation and transformation of color and transparency values to simulate the visual effect of a specific material, thereby obtaining the processed material image.
[0105] It is understandable that after obtaining the processing material image, the image that undergoes segmentation and fusion processing is the processing material image, not the original processing image. If the processing material image consists of multiple images of different materials, then the images that undergo segmentation and fusion processing are the individual material images. That is, based on the dimensions associated with the cross-section of the processing surface and the processing model, segmentation processing is performed along specified edges in one or more processing material images to obtain multiple processing sub-images.
[0106] Specifically, the color values in the display attributes of each pixel can be understood as the R-channel, G-channel, and B-channel values of each pixel, and the transparency values in the display attributes of each pixel can be understood as the A-channel values. The process by which an electronic device performs color transformation processing on a scaled processing image based on the display attributes of each pixel in the processed image to obtain the corresponding processed material image can be described as follows: First, the electronic device determines the brightness value of each pixel based on the correspondence between color values and brightness values, and the color value of each pixel. Then, the electronic device can weight the transparency values of each pixel using the brightness value as a weight, obtaining a weighted transparency value for each pixel. Next, the color values of each pixel are replaced with the color values of a first specified color to obtain an illuminated material image. The transparency value of each pixel in the illuminated material image is the weighted transparency value for each pixel. Finally, the processed material image is determined based on the illuminated material image.
[0107] In this context, color values refer to the R, G, and B channel values of a pixel, with each channel value ranging from 0 to 255 and being an integer. Brightness values measure the brightness of a pixel, ranging from 0 to 1 and being a floating-point number. The correspondence between color and brightness values can mean that different color values correspond to different brightness values. Electronic devices can obtain pre-defined correspondences, such as a table of brightness values corresponding to each color value, and then determine the brightness value of each pixel based on this correspondence and the color value of each pixel. After determining the brightness value, it can be multiplied by the transparency value of each pixel (i.e., the A channel value, an integer ranging from 0 to 255), i.e., a weighted process, to obtain the weighted transparency value of each pixel. This weighted transparency value can be understood as the highlight weight of the lighting texture.
[0108] Furthermore, the R, G, and B channel values of each pixel are replaced with the color values of a specified color, i.e., replaced with the R, G, and B channel values of a specified color, to obtain the lighting material image. It can be understood that the A channel value of each pixel in the lighting material image is a calculated weighted transparency value. Therefore, electronic devices can determine the processing material image based on the lighting material image, either using the lighting material image as the processing material image or using the lighting material image as one of the processing material images.
[0109] Furthermore, in addition to determining material images associated with lighting attributes, the electronic device can also determine material images associated with other attributes, such as material images associated with physical attributes. Specifically, the electronic device can identify pixels in the processing image whose color values fall within a first set range, or whose transparency values fall within a second set range, as first-category pixels. Then, it identifies pixels in the processing image other than those in the first-category pixels as second-category pixels. Based on the color and transparency values of the first-category pixels and the second-category pixels, the physical material image is determined. After determining the physical material image, the electronic device can determine the processing material image based on the physical material image and the lighting material image.
[0110] Since pixels in the processed image whose color value or transparency value is close to a specific color value will not produce any processing effect when the material is processed based on the processing pattern, pixels in the processed image can be classified. The specific color value can be the color value corresponding to white, and the transparency value can be the transparency value corresponding to complete transparency. Therefore, the first set interval can be a range of color values close to white, and the second set interval can be a range of transparency values close to transparency.
[0111] Since the R, G, and B channel values for white are all 255, a color value close to white can be defined as one where all three channel values fall within a first set range, such as 200-255. Similarly, since complete transparency corresponds to an A channel value of 0, a transparency value close to transparency can be defined as one where the A channel value falls within a second set range, such as 0-50. Therefore, the electronic device can classify pixels in the processed image based on the first and second set ranges to obtain a first category of pixels that are close to white or close to transparent. Furthermore, the electronic device can classify pixels other than those in the first category as second category pixels. Thus, the physical material image can be determined based on the R, G, B, and A channel values of the two categories of pixels, and both the physical material image and the lighting material image can be used as the processed material image.
[0112] Specifically, in the process of determining a physical material image based on the color and transparency values of a first category of pixels and a second category of pixels, the electronic device may first remove the first category of pixels from the processed image, then replace the color values of the second category of pixels with the color values of a second specified color, and replace the transparency values of the second category of pixels with a specified transparency value to obtain the physical material image. Since the first category of pixels does not produce any processing effect, they can be removed from the processed image. Then, based on the R, G, B, and A channel values of the second category of pixels, the physical material image is determined.
[0113] Specifically, the R, G, B, and A channel values of the second category of pixels can be replaced with the R, G, and B channel values corresponding to the second specified color, and the A channel value of the second category of pixels can be replaced with the A channel value corresponding to the specified transparency. The image composed of the color and transparency values of each pixel after the replacement is determined as the physical material image.
[0114] It should be noted that the physical material image may include at least one image, such as a metallic material image and a roughness material image. The metallic material image is used to simulate the visual effect of the metallicity of the processed material, and the roughness material image is used to simulate the visual effect of the roughness of the processed material. The second specified color it replaces can be different, and the specified transparency value can also be different. The specific value can be determined based on the application scenario and experiments, and this application does not limit it in this regard.
[0115] Therefore, the electronic device can identify at least one physical material image and one lighting material image as the processing material image, which can be the rendering data required for the material being processed. Subsequent segmentation and fusion processing by the electronic device can be performed on the physical material image and the lighting material image respectively, resulting in a processing sub-image that can include both a lighting material sub-image and a physical material sub-image.
[0116] It should be noted that while current modeling software can provide a preview of the fabricated model, this model is without materials. For example... Figure 2 As shown on the right, it cannot represent the effect of the material surface before processing. Therefore, electronic devices can generate a model material image to represent the effect of the material surface before processing. This model material image can also be called a texture base map.
[0117] In one possible implementation, the electronic device can acquire the material information of the processing model, and then generate a model material image based on the material information. The size of the model material image is the size indicated by the processing surface size information. The electronic device then performs a fusion process on the segmented processing sub-images to obtain a fused processing image. This could involve overlaying the model material image and the processing sub-images at specified locations to obtain the fused processing image.
[0118] The specified image position can refer to the vertex position of the processed sub-image. For example, if the segmentation process is performed from left to right, the vertex position of the top left corner of each processed sub-image can be determined as the specified image position. The overlay process can refer to the process of fusing the pixel values of the processed sub-image with the pixel values of the corresponding positions of other processed sub-images based on their transparency (alpha channel value), thereby generating a new image that combines the features of multiple processed sub-images, resulting in a fused processed image.
[0119] The material information can be visual information used to indicate the visual effect of the unprocessed surface of the material being processed, such as display attributes and physical attributes. Display attributes can include color values, such as R-channel values, G-channel values, and B-channel values, and transparency values, such as A-channel values. Physical attributes can include metallicity values and roughness values, both of which can be floating-point numbers between 0 and 1. The material information can be obtained through relevant parameters passed from upstream, user input, or data packets from other channels. If the user selects a model of a preset shape type, the information can also be recorded in the preset model file, or obtained through other methods; this application does not limit this.
[0120] Furthermore, the electronic device can determine the model material image based on the R-channel, G-channel, B-channel, and A-channel values, as well as the metallicity and roughness values indicated in the material information. Specifically, the electronic device can generate a lit model material image of the processed model based on the mapping relationship between display attributes and model lighting materials. Based on the mapping relationship between physical attributes and model physical materials, a physical model material image of the processed model is generated. Furthermore, the electronic device can determine the model material image based on the lit model material image and the physical model material image.
[0121] The mapping relationship between display attributes and model lighting materials can be a function or library associated with lighting materials. Based on this mapping relationship, a lighting model material image is generated. The electronic device can generate this image by calling specific functions or libraries based on the input R-channel, G-channel, and B-channel values. Similarly, the mapping relationship between physical attributes and model physical materials can also be a function or library associated with physical materials. If the physical material includes more than one type, such as metallicity and roughness, it can include functions or libraries associated with metallicity and functions or libraries associated with roughness, respectively. The electronic device can call the function or library associated with metallicity, input a metallicity value (e.g., 0.5), and obtain a metallicity model material image. Similarly, the electronic device can call the function or library associated with roughness, input a roughness value (e.g., 0.7), and obtain a roughness model material image.
[0122] It is understandable that the size of each model material image is the size indicated by the processing surface size information. For example, taking the processing model as a cylindrical model, the size indicated by the processing surface size information can be the size of the unfolded rectangle.
[0123] Therefore, electronic devices can determine the lighting model material image and the physical model material image (such as the metallicity material image and the roughness material image) as the model material image. In this case, when electronic devices overlay multiple processing sub-images based on specified image positions, they can overlay multiple processing sub-images with the model material image based on specified image positions, that is, overlay the texture base map before processing with the material image of the material pattern after processing, so as to simulate a processing model with material.
[0124] Specifically, the processing sub-image can include multiple lighting material sub-images and multiple physical material sub-images. Taking physical materials including metallicity and roughness as an example, the physical material sub-image can include a metallicity material sub-image and a roughness material sub-image. The model material image includes a lighting model material image and a physical model material image (a metallicity model material image and a roughness model material image). During the fusion processing, the electronic device can overlay the lighting model material image with multiple lighting material sub-images based on specified image positions, and also overlay the physical model material image with multiple physical material sub-images based on specified image positions to obtain a fused processing image.
[0125] In other words, the electronic device can overlay a lighting model material image with multiple lighting material sub-images based on the top-left vertex position, overlay a metallicity model material image with multiple metallicity material sub-images based on the top-left vertex position, and overlay a roughness model material image with multiple roughness material sub-images based on the top-left vertex position. It should be noted that the overlay process can be calculated based on the A-channel value of each pixel and the R-channel, G-channel, and B-channel values of each pixel. For example, specifically, the A-channel value of each pixel can be used as a weight to weight the R-channel, G-channel, and B-channel values of each pixel, obtaining the color value of each pixel in the fused image. Other calculation methods are also possible, and this application does not limit them.
[0126] Please refer to the following: Figure 8 , Figure 8 This is a schematic diagram illustrating the principle of segmentation and fusion processing provided in an embodiment of this application, such as... Figure 8 As shown, taking a cylindrical model as an example, the unfolded surface of this model is the processing surface. The dimension associated with the cross-section of the processing model in the processing surface can be the width of the unfolded rectangle, i.e., the perimeter of the base. Taking a scaling processing image containing a processing pattern with a diagonal line from the upper left to the lower right as an example, the electronic device performs color transformation processing on the scaling processing image based on the display attributes of each pixel in the processing image to obtain a processing material image corresponding to the scaling processing image. This processing material image can, for example, include a lighting material image and a physical material image. The electronic device can perform segmentation processing along a specified edge (horizontal direction) of the processing material image according to the dimension associated with the cross-section of the processing model in the processing surface, and perform cropping processing on the processing material image based on the dimension associated with the height of the processing model in the processing surface to obtain a processing sub-image.
[0127] Furthermore, since this segmentation process is performed from left to right, that is, the image obtained from the segmentation process is not wide enough to correspond to the dimensions of the cross-section of the machining model in the machining surface, on the far right of this machining image, such as Figure 8 The rightmost processed sub-image. Therefore, the electronic device can use the top-left vertex position of each processed sub-image as the specified image position, and perform superposition processing on each processed sub-image based on the specified image position to obtain a fused processed image.
[0128] During the overlay process, the processed sub-image and the model material image obtained based on the material information of the processed model can be overlaid at a specified image position (such as the top left vertex position) to obtain the fused processed image. The processed sub-image can include a lighting material sub-image and a physical material sub-image, which are obtained by segmenting the lighting material image and the physical material image respectively. The model material image can include a lighting model material image and a physical model material image. During the overlay process, the lighting model material image and the lighting material sub-image can be overlaid at a specified image position, and the physical model material image and the physical material sub-image can be overlaid at a specified image position. The overlaid images are then fused to obtain the fused processed image.
[0129] As can be seen, the fused processing image includes the pattern (a diagonal line from the upper left to the lower right) after being segmented, which can be used to preview the effect of the processing equipment performing continuous multi-turn rotation processing. Furthermore, the fused processing image also includes the material information of the processing model, as well as the material information after the processing pattern is filled into the processing model. After subsequent rendering processing, the material effects can be displayed in the preview image.
[0130] It is understood that in this fused processing image, the processing pattern is automatically split and merged to generate a preview image. This can be understood as a process of segmentation and recombination, eliminating the need for additional splitting and stitching by the user, thus improving the efficiency and accuracy of preview image generation. Furthermore, because the processing pattern is segmented and merged, in this embodiment, users can input (import or draw) processing images with dimensions several times larger than the surface area of the processing model, obtaining a realistic effect of multiple rotations within the processing material (processing model).
[0131] Thus, the electronic device completes the splitting (segmentation), recombination, and overlay of the image. After obtaining the fused image, the electronic device can render the model information based on the fused image to generate a preview image.
[0132] S604. Based on the above-mentioned fused processing image, the above-mentioned model information is rendered to obtain a preview image of the above-mentioned processing pattern being processed onto the above-mentioned processing model through the above-mentioned rotation processing.
[0133] In this embodiment, rendering processing can refer to the process of converting the data of the 3D model (processing model) indicated by the model information into a two-dimensional image. This two-dimensional image is a preview image of the processing pattern processed onto the processing model through rotation processing.
[0134] In one possible implementation, during the rendering process, the electronic device can first acquire the mapping coordinate information that maps the processing model to the processing image. Then, based on this mapping coordinate information and the fused processing image, it can perform rendering processing on the model information to obtain a preview image. The mapping coordinate information can be understood as the UV coordinate information of points in the processing model mapped to a 2D texture map after mesh parameterization. The UV coordinate information can include U and V coordinates, which can be used to indicate the range of the processing image from 0-100%. Furthermore, the electronic device can invoke a rendering engine to perform rendering processing based on this UV coordinate information and the fused processing image. This rendering processing includes local material change rendering processing and multi-loop continuous processing rendering processing, thereby obtaining texture format data supported by the 3D domain, i.e., the preview image.
[0135] It should be noted that if the model information is only used to indicate the shape type of the machining model, and the electronic device creates a default machining model of that type, the UV coordinate information corresponding to each point in the model can be determined based on the mapping relationship between the mesh information in the created machining model and the mesh information in the editing software editor. If the model information not only indicates the shape type of the machining model but also indicates the preset size information of the machining model, that is, the model information indicates the preset shape type, the preset model file can include the UV coordinate information. The process of the electronic device obtaining the mapped coordinate information can be referred to as writing customized UV information into the machining model.
[0136] Please refer to the following: Figure 9 , Figure 9 This is a schematic diagram of a preview image provided in an embodiment of this application, such as... Figure 9 As shown, the preview image includes a front view of a cylindrical model, which could be a fabricated model created by an electronic device. The fabrication pattern is used by the user in a way that... Figure 7 Taking the diagonal line pattern from top left to bottom right entered in the user interface as an example, this preview image can represent the visual effect of processing the pattern onto the processing model through rotation processing. Figure 9 As shown, this preview image not only demonstrates the relationship between the processing pattern and the actual processing material, allowing users to easily understand the relationship between the processing pattern designed in the editing software and the actual processed object, but also visually shows the orientation of the processing pattern within the actual processed object, as well as the size of the processing area occupying the surface area of the actual processed object. Furthermore, the cylindrical model also features a 3D rendering effect with material information. And, from... Figure 9 The cylindrical model shown and the filled processing pattern in the texture can be seen to show the material effect after the processing pattern (diagonal pattern) is filled into the cylindrical model.
[0137] In some embodiments, the preview image can be displayed in the image output interface of editing software, such as in the image output interface of laser processing software. This image output interface may also include a view switching control, such as... Figure 9 The button in the lower right corner is a view switching control used to switch the user's observation mode to the processing view. After the user inputs a trigger action on this view switching control, such as clicking, the electronic device can respond to the trigger action by displaying, for example,... Figure 10 The machining view shown. (As shown) Figure 10 As shown, the image output interface displays a machining preview image (i.e., a machining view). This machining preview image can be used to present the machining preview effect of mounting the machining model in the preview image onto the clamping device. The machining preview image may include the clamping device in the machining equipment for fixing the machining material, and the machining model converted to the machining direction. This machining model is the machining model in the preview image, that is, the machining model filled with the machining pattern.
[0138] To better demonstrate the 3D rendering effects of material information, please refer to the following: Figure 11-13 , Figure 11-13 This is a schematic diagram of a preview image provided in an embodiment of this application. Figure 11-13 Taking the machining view as an example, such as Figure 11 As shown, the machining model is a cylindrical model. Figure 11 This includes a base for supporting the processed material. The lighting effects, metallic texture, and roughness of the cylindrical model, as well as the lighting effects, metallic texture, and roughness of the area where the processed pattern is located, can all be obtained based on the fusion processing image rendering process. For example... Figure 12-13 As shown, Figure 12 and Figure 13 Taking a pre-defined shape model (such as a water cup) as an example, it can include a clamping device for mounting the model. Because... Figure 12 and Figure 13 The visual effect presented in the preview image varies depending on the material of the processing, and the visual effect of the filled processing pattern also varies accordingly. In other words, the preview image can show the deformation effect of different positions on the surface of an irregular object on the processing effect.
[0139] In some embodiments of this application, in response to a request to generate a preview image for rotational machining, a machining image including a machining pattern, machining dimension information, and model information of the machining model are obtained. Then, based on the machining dimension information, the dimension information of the machining surfaces used for rotational machining in the machining model is determined. Next, the machining image is segmented based on the machining surface dimension information, and the segmented machining sub-images are fused to obtain a fused machining image. Finally, the model information is rendered based on the fused machining image to obtain a preview image showing the material effect after the machining pattern is filled into the machining model through rotational machining. This preview image is used to present the material effect after the machining pattern is filled into the machining model. Therefore, on the one hand, by segmenting and merging the processing image based on the processing surface size information used for rotation processing in the processing model to render a preview image, compared to the need for manual segmentation and splicing of the processing pattern after the user draws the processing pattern, it is beneficial to improve the efficiency and accuracy of generating a preview image containing multi-ring patterns suitable for rotation processing, making the generation of high-quality preview images simpler and more convenient. On the other hand, it can generate preview images with material effects, which is beneficial to more intuitively display the processing effect and can improve the processing efficiency and accuracy of laser engraving to a certain extent.
[0140] Combination Figure 14 As shown, an exemplary embodiment of this application also provides a preview image generation apparatus for processing, the apparatus 140 comprising:
[0141] The acquisition unit 1401 is configured to acquire, in response to a request to generate a preview image for rotary machining, a machining image including a machining pattern, machining dimension information, and model information of the machining model.
[0142] The determining unit 1402 is used to determine the machining surface size information in the machining model for the rotary machining based on the machining size information;
[0143] Processing unit 1403 is used to segment the processing image based on the processing surface size information, and to fuse the segmented processing sub-images to obtain a fused processing image;
[0144] The processing unit 1403 is further configured to perform rendering processing on the model information based on the fused processing image to obtain a preview image of the processing pattern being processed onto the processing model through the rotation processing, wherein the preview image is used to present the material effect after the processing pattern is filled into the processing model.
[0145] In one possible implementation, the acquisition unit 1401 is further configured to acquire the material information of the processing model;
[0146] A model material image of the machining model is generated based on the material information, and the size of the model material image is the size indicated by the machining surface size information;
[0147] The processing unit 1403 is used to perform fusion processing on the segmented processed sub-images to obtain a fused processed image, specifically for:
[0148] The model material image and the processing sub-image are superimposed based on a specified image position to obtain the fused processing image.
[0149] In one possible implementation, the material information includes display attributes and physical attributes; the processing unit 1403 is configured to generate a model material image of the processing model based on the material information, specifically for:
[0150] Based on the mapping relationship between the display attributes and the model lighting material, a lighting model material image of the processed model is generated;
[0151] Based on the mapping relationship between the physical properties and the physical material of the model, a physical model material image of the processing model is generated;
[0152] The model material image is determined based on the lighting model material image and the physical model material image.
[0153] In one possible implementation, the plurality of processing sub-images includes a plurality of lighting material sub-images and a plurality of physical material sub-images; the processing unit 1403 is configured to overlay the model material image and the processing sub-images based on a specified image position to obtain the fused processing image, specifically for:
[0154] The lighting model material image and the plurality of lighting material sub-images are superimposed based on the specified image position, and the physical model material image and the plurality of physical material sub-images are superimposed based on the specified image position to obtain the fused image.
[0155] In one possible implementation, the device 140 further includes:
[0156] Display unit 1404 is used to display a pattern drawing interface, the pattern drawing interface including at least one input control and a preview image generation control;
[0157] The determining unit 1402 is further configured to, in response to receiving an input operation for the at least one input control, determine, based on the input information carried by the input operation, a processing image including a processing pattern, processing size information, and model information of a processing model;
[0158] The generation unit 1405 is configured to, in response to receiving a selection operation for the preview image generation control, generate the generation request based on the processed image, the processed size information, and the model information.
[0159] In one possible implementation, the at least one input control includes a pattern input control, a size input control, and a model selection control; the determining unit 1402 is configured to, in response to receiving an input operation for the at least one input control, determine, based on the input information carried by the input operation, a processing image including the processing pattern, processing size information, and model information of the processing model, specifically for:
[0160] In response to receiving an input operation for the pattern input control, the processing image is determined based on the processing pattern carried by the input operation;
[0161] In response to receiving a dimension input operation for the dimension input control, the processing dimension information is determined based on the dimension information carried by the dimension input operation;
[0162] In response to receiving a selection operation for the model selection control, the model information is determined based on the shape type carried by the selection operation.
[0163] In one possible implementation, the model information is used to indicate the shape type of the machining model; the determining unit 1402 is used to determine the machining surface size information of the machining model for the rotary machining based on the machining size information, specifically for:
[0164] A machining model of the shape type is constructed using the dimension indicated by the machining dimension information as the bottom dimension and the dimension of the specified side in the machining image as the height dimension.
[0165] Based on the dimensions indicated by the processing dimension information and the dimensions of the specified edges in the processing image, the dimension information of the unfolded surface of the processing model is determined, and the processing surface dimension information is obtained.
[0166] In one possible implementation, the model information includes indication information indicating that the machining model is a preset shape type, and preset size information of the machining model; the determining unit 1402 is used to determine the machining surface size information of the machining model for the rotary machining based on the machining size information, specifically for:
[0167] Based on the proportional relationship between the specified cross-sectional dimension in the preset dimension information and the dimension indicated by the processing dimension information, the preset dimension information is scaled to obtain a processing model in which the specified cross-sectional dimension is the dimension indicated by the processing dimension information and the shape type is the preset shape type;
[0168] Based on the preset size information and the size indicated by the processing size information, the size information of the unfolded surface of the processing model is determined, and the size information of the processing surface is obtained.
[0169] In one possible implementation, the processing unit 1403 is used to perform segmentation processing on the processing image based on the processing surface size information, specifically for:
[0170] Based on the proportional relationship between the set size and the size of the processed image, the processed image is scaled to obtain a scaled processed image;
[0171] Based on the dimensions associated with the cross-section of the machining model in the machining surface, the image is segmented along a specified edge in the scaled machining image to obtain multiple machining sub-images.
[0172] In one possible implementation, the processing unit 1403 is configured to scale the processed image based on a proportional relationship between a set size and the size of the processed image to obtain a scaled processed image, specifically for:
[0173] A first ratio is determined based on the proportional relationship between the reference size information used to display the processed image and the resolution information of the processed image;
[0174] A second ratio is determined based on the minimum ratio between the set size and the dimensions of each side in the processed image;
[0175] Based on the first ratio and the second ratio, the processed image is scaled to obtain the scaled processed image.
[0176] In one possible implementation, the processing unit 1403 is further configured to perform color transformation processing on the scaled processing image based on the display attributes of each pixel in the processing image to obtain a processing material image corresponding to the scaled processing image;
[0177] The processing unit 1403 is configured to perform segmentation processing along a specified edge in the scaled processing image based on the dimensions associated with the cross-section of the processing surface and the processing model, to obtain multiple processing sub-images, specifically for:
[0178] Based on the dimensions associated with the cross-section of the processing model in the processing surface, the image is segmented along a specified edge in the processing material image to obtain the plurality of processing sub-images.
[0179] In one possible implementation, the display attributes of each pixel include color values and transparency values; the processing unit 1403 is configured to perform color transformation processing on the scaled processing image based on the display attributes of each pixel in the processed image to obtain a processing material image corresponding to the scaled processing image, specifically for:
[0180] Based on the correspondence between color values and brightness values, and the color values of each pixel, the brightness value of each pixel is determined.
[0181] The transparency values of each pixel are weighted by the brightness value of each pixel to obtain the weighted transparency value of each pixel.
[0182] The color value of each pixel is replaced with the color value of a first specified color to obtain a lighting material image. The transparency value of each pixel in the lighting material image is the weighted transparency value of each pixel.
[0183] The processing material image is determined based on the illumination material image.
[0184] In one possible implementation, the processing unit 1403 is configured to determine the processing material image based on the illumination material image, specifically for:
[0185] Pixels in the processed image whose color values are within a first set range or whose transparency values are within a second set range are identified as first category pixels.
[0186] Pixels in the processed image other than those in the first category are identified as pixels in the second category.
[0187] Based on the color and transparency values of the first category of pixels and the second category of pixels, a physical material image is determined, and based on the physical material image and the lighting material image, a processing material image is determined.
[0188] In one possible implementation, the processing unit 1403 is configured to determine a physical material image based on the color and transparency values of the first category of pixels and the color and transparency values of the second category of pixels, specifically for:
[0189] Remove the first category of pixels from the processed image;
[0190] The color values of the second category of pixels are replaced with the color values of the second specified color, and the transparency values of the second category of pixels are replaced with the specified transparency values to obtain the physical material image.
[0191] In one possible implementation, the processing unit 1403 is configured to perform rendering processing on the model information based on the fused processing image to obtain a preview image of the processing pattern applied to the processing model through the rotation processing, specifically for:
[0192] Obtain the mapping coordinate information that maps the processing model to the processing image;
[0193] Based on the mapped coordinate information and the fused image, the model information is rendered to obtain the preview image.
[0194] In one possible implementation, the display unit 1404 is further configured to display the preview image in an image output interface, the image output interface further including a view switching control;
[0195] The display unit 1404 is also configured to display a machining preview image in the image output interface in response to a trigger operation of the switching view control. The machining preview image is used to present the machining preview effect of installing the machining model in the preview image onto the clamping device.
[0196] It should be noted that the preview image generation device 140 for processing provided in the above embodiments and the preview image generation method for processing provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs operations have been described in detail in the method embodiments, and will not be repeated here. In practical applications, the preview image generation device 140 for processing provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.
[0197] Embodiments of this application also provide an electronic device, including: one or more processors; and a memory for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the preview image generation method for processing provided in the above embodiments.
[0198] Figure 15 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 15The computer system 1500 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0199] like Figure 15 As shown, the computer system 1500 includes a Central Processing Unit (CPU) 1501, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1502 or programs loaded from storage portion 1508 into Random Access Memory (RAM) 1503, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1503. The CPU 1501, ROM 1502, and RAM 1503 are interconnected via bus 1504. An Input / Output (I / O) interface 1505 is also connected to bus 1504.
[0200] The following components are connected to I / O interface 1505: an input section 1506 including a keyboard, mouse, etc.; an output section 1507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to I / O interface 1505 as needed. Removable media 1511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1510 as needed so that computer programs read from them can be installed into storage section 1508 as needed.
[0201] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1509, and / or installed from removable medium 1511. When the computer program is executed by central processing unit (CPU) 1501, it performs various functions defined in the system of this application.
[0202] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0203] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0204] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0205] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the preview image generation method for processing as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.
[0206] The above description is merely a preferred exemplary embodiment of this application and is not intended to limit the implementation of this application. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of this application. Therefore, the scope of protection of this application should be determined by the scope of protection claimed in the claims.
Claims
1. A method for generating preview images for processing, characterized in that, include: In response to a request to generate a preview image for rotary machining, obtain a machining image including the machining pattern, machining dimension information, and model information of the machining model; Based on the machining dimension information, determine the machining surface dimension information in the machining model used for the rotary machining; The processing image is segmented based on the processing surface size information, and the segmented processing sub-images are then fused to obtain a fused processing image. The model information is rendered based on the fused processing image to obtain a preview image of the processing pattern being processed onto the processing model through the rotation processing. The preview image is used to present the material effect after the processing pattern is filled into the processing model.
2. The method according to claim 1, characterized in that, Before fusing the segmented processed sub-images to obtain the fused processed image, the method further includes: Obtain the material information of the processing model; A model material image of the machining model is generated based on the material information, and the size of the model material image is the size indicated by the machining surface size information; The process of fusing the segmented sub-images to obtain a fused processed image includes: The model material image and the processing sub-image are superimposed based on a specified image position to obtain the fused processing image.
3. The method according to claim 2, characterized in that, The material information includes display attributes and physical attributes; generating the model material image of the processing model based on the material information includes: Based on the mapping relationship between the display attributes and the model lighting material, a lighting model material image of the processed model is generated; Based on the mapping relationship between the physical properties and the physical material of the model, a physical model material image of the processing model is generated; The model material image is determined based on the lighting model material image and the physical model material image.
4. The method according to claim 3, characterized in that, The processing sub-image includes a lighting material sub-image and a physical material sub-image; the process of overlaying the model material image and the processing sub-image based on a specified image position to obtain the fused processing image includes: The lighting model material image and the lighting material sub-image are superimposed based on the specified image position, and the physical model material image and the physical material sub-image are superimposed based on the specified image position to obtain the fused image.
5. The method according to claim 1, characterized in that, Before obtaining the machining image including the machining pattern, machining dimension information, and model information of the machining model in response to the request to generate a preview image for rotary machining, the method further includes: The pattern drawing interface includes at least one input control and a preview image generation control. In response to receiving an input operation for the at least one input control, based on the input information carried by the input operation, determine the processing image including the processing pattern, processing size information, and model information of the processing model; In response to receiving a selection operation for the preview image generation control, the generation request is generated based on the processed image, the processed size information, and the model information.
6. The method according to claim 5, characterized in that, The at least one input control includes a pattern input control, a size input control, and a model selection control; the step of responding to receiving an input operation for the at least one input control, and determining, based on the input information carried by the input operation, processing image, processing size information, and model information of the processing model, including: In response to receiving an input operation for the pattern input control, the processing image is determined based on the processing pattern carried by the input operation; In response to receiving a dimension input operation for the dimension input control, the processing dimension information is determined based on the dimension information carried by the dimension input operation; In response to receiving a selection operation for the model selection control, the model information is determined based on the shape type carried by the selection operation.
7. The method according to claim 1, characterized in that, The model information is used to indicate the shape type of the machining model; determining the machining surface size information in the machining model for the rotary machining based on the machining size information includes: A machining model of the shape type is constructed using the dimension indicated by the machining dimension information as the bottom dimension and the dimension of the specified side in the machining image as the height dimension. Based on the dimensions indicated by the processing dimension information and the dimensions of the specified edges in the processing image, the dimension information of the unfolded surface of the processing model is determined, and the processing surface dimension information is obtained.
8. The method according to claim 1, characterized in that, The model information includes indication information for indicating that the processing model is a preset shape type, and preset size information of the processing model; The step of determining the machining surface dimension information for the rotary machining in the machining model based on the machining dimension information includes: Based on the proportional relationship between the specified cross-sectional dimension in the preset dimension information and the dimension indicated by the processing dimension information, the preset dimension information is scaled to obtain a processing model in which the specified cross-sectional dimension is the dimension indicated by the processing dimension information and the shape type is the preset shape type; Based on the preset size information and the size indicated by the processing size information, the size information of the unfolded surface of the processing model is determined, and the size information of the processing surface is obtained.
9. The method according to claim 1, characterized in that, The segmentation process of the processed image based on the processed surface size information includes: Based on the proportional relationship between the set size and the size of the processed image, the processed image is scaled to obtain a scaled processed image; Based on the dimensions associated with the cross-section of the machining model in the machining surface, the image is segmented along a specified edge in the scaled machining image to obtain multiple machining sub-images.
10. The method according to claim 9, characterized in that, The scaling process of the processed image based on the proportional relationship between the set size and the size of the processed image to obtain a scaled processed image includes: A first ratio is determined based on the proportional relationship between the reference size information used to display the processed image and the resolution information of the processed image; A second ratio is determined based on the minimum ratio between the set size and the dimensions of each side in the processed image; Based on the first ratio and the second ratio, the processed image is scaled to obtain the scaled processed image.
11. The method according to claim 9, characterized in that, The method further includes scaling the processed image based on the proportional relationship between the set size and the size of the processed image to obtain a scaled processed image. Based on the display attributes of each pixel in the processed image, the scaled processed image is subjected to color transformation processing to obtain the processed material image corresponding to the scaled processed image; The process involves segmenting the scaled processing image along a specified edge based on the dimensions associated with the cross-section of the processing model within the processing surface, resulting in multiple processing sub-images, including: Based on the dimensions associated with the cross-section of the processing model in the processing surface, the image is segmented along a specified edge in the processing material image to obtain the plurality of processing sub-images.
12. The method according to claim 11, characterized in that, The display attributes of each pixel include color values and transparency values; the step of performing color transformation processing on the scaled processing image based on the display attributes of each pixel in the processed image to obtain the processing material image corresponding to the scaled processing image includes: Based on the correspondence between color values and brightness values, and the color values of each pixel, the brightness value of each pixel is determined. The transparency values of each pixel are weighted by the brightness value of each pixel to obtain the weighted transparency value of each pixel. The color value of each pixel is replaced with the color value of a first specified color to obtain a lighting material image. The transparency value of each pixel in the lighting material image is the weighted transparency value of each pixel. The processing material image is determined based on the illumination material image.
13. The method according to claim 12, characterized in that, Determining the processing material image based on the illumination material image includes: Pixels in the processed image whose color values are within a first set range or whose transparency values are within a second set range are identified as first category pixels. Pixels in the processed image other than those in the first category are identified as pixels in the second category. Based on the color and transparency values of the first category of pixels and the second category of pixels, a physical material image is determined, and based on the physical material image and the lighting material image, a processing material image is determined.
14. The method according to claim 13, characterized in that, Determining the physical material image based on the color and transparency values of the first category of pixels and the color and transparency values of the second category of pixels includes: Remove the first category of pixels from the processed image; The color values of the second category of pixels are replaced with the color values of the second specified color, and the transparency values of the second category of pixels are replaced with the specified transparency values to obtain the physical material image.
15. The method according to claim 1, characterized in that, The step of rendering the model information based on the fused processed image to obtain a preview image of the processed pattern applied to the processed model through the rotational processing includes: Obtain the mapping coordinate information that maps the processing model to the processing image; Based on the mapped coordinate information and the fused image, the model information is rendered to obtain the preview image.
16. The method according to any one of claims 1-15, characterized in that, After rendering the model information based on the fused processed image to obtain a preview image of the processed pattern applied to the processed model through the rotation processing, the method further includes: The preview image is displayed in the image output interface, which also includes a view switching control. In response to a trigger operation on the switching view control, a machining preview image is displayed in the image output interface. The machining preview image is used to present the machining preview effect of mounting the machining model in the preview image onto the clamping device.
17. A processing equipment, characterized in that, include: slide rail; A processing head, which is slidably mounted on the slide rail; A communication component, the communication component being configured to receive a processing pattern obtained by the steps of the method according to any one of claims 1 to 16; A controller, based on the acquired processing pattern, controls the processing head to move on the slide rail for processing.
18. A system, characterized in that, include: Processing equipment, the processing equipment comprising a base plate and a processing head, the base plate including a processing area for placing materials, the processing head for moving within the processing area; and A terminal device that communicates with the processing equipment, the terminal device being used to execute the preview image generation method for processing according to any one of claims 1 to 16.
19. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the preview image generation method for processing as described in any one of claims 1-16.
20. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, and the processor of the electronic device reads from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the preview image generation method for processing according to any one of claims 1-16.