A method for automatic cavity cutting in 3D software
By using a 3D software-based automatic cavity cutting method and Boolean operations between the optimal containment block and the model containing the glue position, the problems of time-consuming manual cavity cutting and missing parts in mold design are solved, thus achieving efficient and accurate mold design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI GREE PRECISION MOLD CO LTD
- Filing Date
- 2022-04-24
- Publication Date
- 2026-06-30
AI Technical Summary
In mold design, manual cavity shearing is time-consuming and prone to missing parts, which increases mold design costs and makes it difficult to detect abnormalities.
The method of automatic cavity cutting using 3D software is adopted to obtain the optimal containment block of the target product model and perform Boolean operation to calculate the difference between it and the model containing adhesive, thereby generating the actual product model.
It reduces the time spent on manual cavity shearing, ensures model consistency, lowers mold design costs, avoids model omissions, and improves design efficiency.
Smart Images

Figure CN115270212B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mold design, and more particularly to a method for automatic cavity cutting using three-dimensional software. Background Technology
[0002] In the manufacturing industry, especially in the mold-related industry, it is necessary to use 3D design software (such as UGNX) to design 3D target product models and 3D mold models. The target product model is designed first, and the mold model is designed based on the target product model. The 3D mold model can be obtained by using the "Boolean operation difference (hereinafter referred to as shear cavity)" function built into UGNX to obtain the shear cavity product corresponding to the 3D mold model, that is, the 3D actual product model.
[0003] To meet the final assembly and surface quality requirements, the target product model must be geometrically identical to the actual product model or within the allowable error range. Therefore, it is necessary to cut the cavity to obtain the actual product model and compare it with the target product model to determine whether it meets the requirements.
[0004] However, molds typically have a large number of parts. When obtaining the actual product model, it is necessary to manually cut each part containing the glue position. When there are too many parts, manual cutting will consume a lot of time, thus increasing the mold design cost. Moreover, with too many parts, it is easy to miss the model that needs to be cut. If the actual product model cannot be obtained by cutting the cavity correctly, some abnormalities in the mold may be difficult to detect, thus also increasing the mold design cost. Summary of the Invention
[0005] This invention aims to at least partially address one of the problems in related technologies. Therefore, the objective of this invention is to provide a method for automatic cavity shearing in three-dimensional software, which avoids difficult-to-detect anomalies in molds caused by improper cavity shearing models, thereby reducing mold design costs.
[0006] To achieve the above objectives, this application adopts the following technical solution: a method for automatic cavity cutting in three-dimensional software, comprising:
[0007] In 3D software, a model containing adhesive and a target product model are obtained; the model containing adhesive consists of several parts containing adhesive, and the parts containing adhesive refer to the parts that are in contact with the molding surface in the mold used to prepare the actual product model;
[0008] Obtain the optimal containment block for the target product model; the optimal containment block comprises several combined cubes that are in contact with the actual product model;
[0009] The actual product model is obtained by performing a Boolean operation to find the difference between the optimal containment block and the model containing adhesive sites.
[0010] Furthermore, the process of obtaining the optimal encompassing block for the target product model specifically includes:
[0011] Generate a cuboid containing the target product model; the cuboid containing the target product model, and the outermost edge of the target product model is tangent to the cuboid containing ...
[0012] Further, the process of generating a cuboid containing the target product model; the cuboid containing the target product model, and the outermost edge of the target product model being tangent to the cuboid containing block; decomposing the cuboid containing block into several composite cubes; selecting the composite cubes that are in contact with the target product model and merging them into the optimal containing block, specifically includes:
[0013] C1: Execute the algorithm to generate the reference coordinates of the combined cubes and obtain the reference coordinates of m2 generated combined cubes;
[0014] C2: Check if m2 is greater than 0. If m2 = 0, the algorithm ends directly; if m2 > 0, proceed to C3.
[0015] C3: Create a 10mm×10mm×10mm composite cube based on the reference coordinates;
[0016] C4: Filter out the combined cubes that are in contact with the target product model;
[0017] C5: Combine all the selected combination cubes together to form a complete optimal containing block, and the algorithm ends.
[0018] Further, the algorithm for generating the reference coordinates of the combined cube is executed, specifically including the following steps:
[0019] D1: Obtain the cuboid containing block based on the identifier H' of the target product model;
[0020] D2: Get the coordinates of the bottom left corner A (x1, y1, z1) and the top right corner B (x2, y2, z2) of the cuboid containing block.
[0021] D3: Calculate the volume ratio r, r = volume of the target product model / volume of the cuboid containing block H'';
[0022] D4: Determine if r is greater than the preset value s1. If r > s1, store the identifier H' in the filtered combination cube container and the algorithm ends; if r ≦ s1, proceed to D5.
[0023] D5: Obtain the length L, width W, and height H of the cuboid containing block;
[0024] D6: Let L1 = L / 10 and round up, let W1 = W / 10 and round up, let H1 = H / 10 and round up;
[0025] D7: Delete the cuboid containment block;
[0026] D8: Let i1 = -1, let j1 = -1, let d1 = -1, and enter D9;
[0027] D9: Let i1 = i1 + 1, and determine whether i1 is less than L1. If i1 < L1, enter D10; if i1 ≥ L1, the algorithm ends; F2: Let i3 = i3 + 1, and determine whether i3 is greater than m3. If i3 > m3, the algorithm ends; if i3 ≦ m3, proceed to F3.
[0039] F3: Determine whether the i3rd combined cube is in contact with the target product model. If it is in contact, proceed to F4; otherwise, proceed to F5.
[0040] F4: Store the identifier of the i3rd combined cube into the container of filtered combined cube identifiers, and return to F2;
[0041] F5: Delete the identifier of the i3rd combined cube and return to F2.
[0042] Furthermore, all the selected combination cubes are combined together to form a complete optimal containing block, specifically including:
[0043] G1: Obtain the m4 identifiers from the filtered combined cube identifier container, set i4=1, and proceed to G2;
[0044] G2: Determine if m4 is greater than 1. If m4 > 1, proceed to G3; if m4 ≦ 1, the combined cube block corresponding to this identifier is the best containing block, and this algorithm ends.
[0045] G3: Let i4 = i4 + 1, and determine whether i4 is greater than m4. If i4 > m4, the algorithm ends; if i4 ≦ i4, proceed to G4.
[0046] G4: Perform a Boolean operation to sum the i4th combined cube identifier with the 1st combined cube identifier; return to G3.
[0047] Furthermore, the adhesive-containing model is stored in layers of 3D software.
[0048] Furthermore, obtaining the adhesive-containing model in 3D software specifically includes:
[0049] B1: Obtain the S1 layers of the user-provided model containing adhesive sites, set j1=0, and proceed to B2;
[0050] B2: Let j1 = j1 + 1, and determine whether j1 is greater than s1. If j1 > s1, the algorithm ends; if j1 ≦ s1, proceed to B3.
[0051] B3: Obtain the identifiers of the s2 glue-containing models in the j1-th layer, set j2=0, and proceed to B4;
[0052] B4: Let j2 = j2 + 1, and determine whether j2 is greater than s2. If j2 > s2, return to B2; if j2 ≦ s2, proceed to B5.
[0053] B5: Add the j2th individual identifier to the container containing the glue position model body, and return to B4.
[0054] This application also provides an electronic device, including:
[0055] Processor; and
[0056] A memory storing executable code, which, when executed by a processor, causes the processor to perform the method described above. This application also provides a non-transitory machine-readable storage medium storing executable code, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.
[0057] Compared with the prior art, the above-mentioned technical solution provided in this application has the following advantages: The cavity-cutting process in this application is carried out in 3D software. At the same time, programming can be performed in the 3D software to control the cavity-cutting process to proceed automatically; the optimal containment block in this application is composed of several combined cubes that are in contact with the actual product model, ensuring that the optimal containment block can fit the target product model as closely as possible, thereby ensuring that the actual product model after cavity cutting is consistent with the target product model; this application can automatically cut the cavity model and obtain the final actual product model, reducing the time spent on manual cavity cutting to improve efficiency and reduce mold design costs. Moreover, automatic cavity cutting will not miss any model parts that need cavity cutting, which can reduce certain abnormalities in the mold that are difficult to detect due to improper cavity cutting model, and reduce mold design costs. Attached Figure Description
[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] In the attached image:
[0061] Figure 1 : A schematic diagram illustrating the data storage method of this invention;
[0062] Figure 2 The overall algorithm principle of this invention;
[0063] Figure 3 The algorithm principle for obtaining the model containing the adhesive site in this invention;
[0064] Figure 4The algorithm principle for obtaining the optimal containing block in this invention;
[0065] Figure 5 The principle of the algorithm for generating the reference coordinates of combined cubes in this invention;
[0066] Figure 6 The algorithm principle for creating combined cubes in this invention;
[0067] Figure 7 The algorithm principle of the present invention for screening and combining cubes;
[0068] Figure 8 The algorithm principle of the combined cube fusion of the present invention;
[0069] Figure 9 This is a schematic diagram of the target product model in Example 1;
[0070] Figure 10 : This is a schematic diagram of the cuboid containing block in Example 1;
[0071] Figure 11 : A schematic diagram of the unscreened combination cubes in Example 1;
[0072] Figure 12 : A schematic diagram of the selected combination cubes in Example 1;
[0073] Figure 13 : This is a schematic diagram of the optimal containing block in Example 1;
[0074] Figure 14 This is a schematic diagram of the actual product model in Example 1;
[0075] The diagram is labeled as follows: 1. Target product model; 2. Cuboid containing block; 3. Optimal containing block. Detailed Implementation
[0076] Preferred embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0077] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0078] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified. Please refer to the appendix. Figure 1-1 6. This application provides a method for automatic cavity cutting in three-dimensional software, comprising:
[0079] In 3D software, obtain the glue-containing model and the target product model; the glue-containing model consists of several glue-containing parts, which refer to the parts that are in contact with the molding surface in the mold used to prepare the actual product model;
[0080] Obtain the optimal containment block for the target product model; the optimal containment block consists of several combined cubes that are in contact with the actual product model.
[0081] The actual product model is obtained by performing a Boolean operation to find the difference between the containing block and the glue-containing model.
[0082] In this application, the cavity-cutting process described above is performed in 3D software. Furthermore, programming within the 3D software allows for the automatic control of this cavity-cutting process. This application sets the optimal containment block to consist of several combined cubes that contact the actual product model, ensuring that the optimal containment block fits the target product model as closely as possible. This ensures that the actual product model matches the target product model after cavity cutting. This application can automatically cut the cavity model and obtain the final actual product model, reducing the time spent on manual cavity cutting to improve efficiency and lower mold design costs. Moreover, automatic cavity cutting ensures that no model parts requiring cavity cutting are missed, reducing the likelihood of undetectable anomalies caused by improper cavity cutting and further lowering mold design costs.
[0083] Taking the 3D software UGNX as an example, the following explanation is provided: In this application, "model shearing" refers to the process of performing Boolean difference calculation on two 3D models using UGNX's built-in commands.
[0084] Parts containing molding surfaces: Each part in the mold that directly contacts the actual product model, i.e., the part containing the molding surface.
[0085] Optimal containing block: A model body is composed of several identical combined cubes according to the specific rules of this invention. When this model body can completely contain or completely cover another model body and its volume is the smallest, this model body is called the optimal containing block of the other model body.
[0086] The method for obtaining the optimal containing block in this application includes: generating a cuboid containing block of the target product model; the cuboid containing block contains the target product model, and the outermost edge of the target product model is tangent to the cuboid containing block; decomposing the cuboid containing block into several composite cubes; selecting the composite cubes that are in contact with the target product model, and merging them into the optimal containing block.
[0087] In UGNX 3D design software, each model body, face, and edge has one and only one unique identification code, which is used to uniquely name and distinguish each model body, face, and edge.
[0088] Get all faces of a model body: A model body can contain a number of faces (such as a cube containing 6 faces). You can get all the faces in the model body by using UF_OBJ_cycle_objs_in_part(), which will give you the identifiers of the 6 faces and their number. The number of faces is 6.
[0089] The following schemes in this application are actually identifiers for obtaining edges, obtaining faces, and obtaining volumes; the two expressions are essentially the same.
[0090] Layers are a built-in feature of UGNX, allowing model bodies to be categorized for easier management. For example, if layer 11 contains 3 model bodies, layer 55 contains 1 model body, and other layers contain no model bodies, then using UF_LAYER_cycle_by_layer() will only retrieve and operate on the 3 model bodies in layer 11, without affecting the model body in layer 55. Model bodies can be moved to any layer using software commands.
[0091] The following uses UGNX secondary development as an example to explain the method of this application in detail:
[0092] A method for automatic cavity cutting in 3D software involves obtaining the optimal containment block for a real product model. Based on this target product model, the algorithm of this invention is used to create the optimal containment block. Then, a Boolean operation is performed between the created optimal containment block and each model containing adhesive areas to calculate the difference, ultimately yielding the actual product model. (See attached diagram.) Figure 1-2 As shown, the specific steps include the following:
[0093] A1: Execute the algorithm to obtain the model body containing adhesive sites. This algorithm obtains all the models containing adhesive sites in the 3D software and stores the identifiers of the models containing adhesive sites into the model body container containing adhesive sites.
[0094] A2: Obtain the layer containing the target product model provided by the user in the 3D software; this layer information is provided by the user or can be obtained directly from the product description;
[0095] A3: Obtain all identifiers of m target product models based on UF_LAYER_cycle_by_layer() and the layer where the target product model is located, set i=0, and proceed to A4; among them, some molds have multiple target product models, so each target product model must obtain the actual product model through cavity shearing; m refers to the number of identifiers of the target product models;
[0096] A4: Let i = i + 1, check if i is greater than m. If i > m, the traversal is complete, proceed to A10; if i ≦ m, the traversal of the i-th target product model is underway, proceed to A5.
[0097] A5: Execute the best containing block algorithm to obtain the identifier of the best containing block; this identifier is the first identifier in the filtered combined cube block identifier container;
[0098] A6: Obtain the s identifiers in the container containing the glue-containing model body, set j=0, and proceed to A7; s refers to the number of glue-containing models in the container containing the glue-containing model body.
[0099] A7: Let j = j + 1, and determine whether j is greater than s. If j > s, it means that the traversal of the glue-containing model has ended, that is, the automatic cavity shearing has ended, and proceed to A9; if j ≦ s, it means that the j-th glue-containing model is being traversed, and proceed to A8.
[0100] A8: Use the built-in UGNX interface to perform a Boolean operation to find the difference between the identifier of the best containment block and the identifier of the j-th model containing glue, and obtain the corresponding actual product model; return to A7. Here, the identifier of the best containment block is the target body, the j-th model containing glue is the common body, and the rule for Boolean operation in UGNX is to subtract the tool body from the target body.
[0101] A9: Clear the unfiltered combined cube identifier container, clear the filtered combined cube identifier container, and clear the combined cube reference coordinate container to prevent data from interfering with the next algorithm, and return to A4.
[0102] A10: Empty the container containing the glued model body to prevent data from interfering with the next algorithm. The program ends.
[0103] As attached Figure 1 and 3As shown, the principle of the algorithm for obtaining the model body containing the glue position in this application is as follows: Generally, mold manufacturers, for ease of management, will place parts containing the glue position on specific layers. Mold manufacturers typically have their own management standards, so this invention omits this step and directly obtains the layer where the parts containing the glue position are located (e.g., 21, 22, 41, 42, etc., the specific layer can be set by the user). Each layer will have zero or more models containing the glue position; therefore, this algorithm can obtain all models containing the glue position on the layer containing the glue position.
[0104] The principle behind the algorithm for obtaining a model containing adhesive sites in UGNX 3D software includes:
[0105] B1: Obtain the S1 layers of the user-provided model containing the adhesive position, set j1=0, and proceed to B2; S1 refers to the number of layers including the model containing the adhesive position.
[0106] B2: Let j1 = j1 + 1, and determine whether j1 is greater than s1. If j1 > s1, then all layers have been traversed and this algorithm ends; if j1 ≦ s1, then the j1th layer is being traversed and proceed to B3.
[0107] B3: Obtain the identifiers of the s2 glue-containing models in the j1st layer through UF_LAYER_cycle_by_layer(), set j2=0, and proceed to B4; S2 refers to the number of glue-containing models in the j1st layer;
[0108] B4: Let j2 = j2 + 1, and determine whether j2 is greater than s2. If j2 > s2, it means that the traversal of all model bodies in the j1th layer has ended, and return to B2; if j2 ≦ s2, it means that the traversal of the j2th model body is in progress, and proceed to B5.
[0109] B5: Add the j2th individual identifier to the container containing the glue position model body, and return to B4.
[0110] As attached Figure 1 and 4 As shown, the principle of the optimal containment block algorithm in this application is as follows: UGNX can generate a simple cuboid containment block of the target product model, such as... Figure 10 As shown, however, when the ratio of the target product model to the volume of the cuboid containing block is too large, using the cuboid containing block to calculate the cavity is prone to errors, i.e., it cannot achieve the expected results well. Therefore, it is necessary to create an optimal containing block that adapts to the shape of the target product model according to the rules of this invention, such as... Figure 13As shown, this allows for better cavity shearing operations. The optimal containing block algorithm creates containing blocks in three main steps: First, it generates a cuboid containing the target product model; the cuboid containing the target product model has its outermost edge tangent to the cuboid containing block. Second, it creates several coordinate origins and then creates combined cubes based on these origins, such as... Figure 11 As shown; Step 3: Filter out the combined cubes that are in contact with the target product model, and delete other useless combined cubes. After deletion, as shown... Figure 12 The fourth step is to combine several useful combination cubes into a whole using the NXUG built-in interface commands, that is, to form an optimal containing block, such as... Figure 13 As shown.
[0111] This application obtains the optimal containing block, specifically including:
[0112] C1: Execute the algorithm to generate the reference coordinates of the combined cubes and obtain m2 reference coordinates for generating combined cubes; this step can obtain several coordinates that can generate combined cubes; m2 refers to the number of reference coordinates for generating combined cubes.
[0113] C2: Determine if m2 is greater than 0. If m2=0, it means that no coordinates were generated in C1, and the algorithm ends directly; if m2>0, it means that coordinates were generated in C1, and proceed to C3.
[0114] C3: Execute the algorithm to create a composite cube, creating a 10mm×10mm×10mm composite cube based on the reference coordinates; see attached. Figure 11 As shown; this application uses a 10mm×10mm×10mm combined cube as an example for illustration. In practical applications, the size of the combined cube can be any limited value.
[0115] C4: Execute the algorithm to filter valid contact combination cubes, identifying combination cubes that are in contact with the target product model; as shown in the attached diagram. Figure 12 As shown;
[0116] C5: Execute the combined cube fusion algorithm to combine all the selected combined cubes together to form a complete optimal containing block. This algorithm ends.
[0117] The principle behind the algorithm for generating the reference coordinates of combined cubes in this application is as follows: For some product models, the ratio of the target product model to the cuboid containing block is too small. This can easily lead to unknown cavity-cutting errors during cavity cutting. Therefore, it is necessary to determine the ratio of the target product model to the cuboid containing block and, based on this ratio, whether the cuboid containing block needs to be converted into an optimal containing block using this algorithm. To obtain the optimal containing block, the cuboid containing block needs to be cut into identical 10mm×10mm×10mm combined cubes. Furthermore, to facilitate the generation of combined cubes, the reference coordinates of the combined cubes must first be generated; this is the purpose of this algorithm.
[0118] As attached Figure 1 and 5 As shown, the algorithm for generating the reference coordinates of the combined cube in this application includes the following steps:
[0119] D1: Obtain the cuboid containing block based on the identifier of the i-th target product model. Assuming the identifier is H, the cuboid containing block of a specific model body can be obtained using UGNX's built-in interface commands, such as... Figure 10 As shown;
[0120] D2: Obtain the coordinates of the lower left corner A (x1, y1, z1) and the upper right corner B (x2, y2, z2) of the cuboid containing block according to UF_MODL_ask_face_data().
[0121] D3: Calculate the volume ratio r, r = volume of the target product model / volume of the cuboid containing block H'';
[0122] D4: Determine if r is greater than the preset value s1. If r > s1, it means that the product model body ratio is appropriate and this algorithm is not needed. Store the identifier H' in the filtered combination cube container and this algorithm ends. If r ≦ s1, it means that the product model ratio is too small and this algorithm is needed. Proceed to D5.
[0123] D5: Obtain the length L, width W, and height H of the cuboid containing block; where the length, width, and height of the cuboid containing block can be obtained from the coordinates of the lower left corner A (x1, y1, z1) and the upper right corner B (x2, y2, z2); L, W, and H refer to the length, width, and height values of the cuboid containing block, respectively.
[0124] D6: Set L1 = L / 10 and round up, set W1 = W / 10 and round up, set H1 = H / 10 and round up; UGNX default unit is mm;
[0125] D7: Delete the cuboid containing block; since new coordinates are generated, the original cuboid containing block is no longer needed and needs to be deleted.
[0126] D8: Set i1 = -1, set j1 = -1, set d1 = -1, enter D9;
[0127] D9: Set i1 = i1 + 1, check if i1 is less than L1. If i1 < L1, enter D10; if i1 ≥ L1, end this algorithm;
[0128] D10: Set j1 = j1 + 1, check if j1 is less than W1. If j1 < W1, enter D11; if j1 ≥ W1, return to D9;
[0129] D11: Set d1 = d1 + 1, check if d1 is less than H1. If d1 < H1, enter D12; if d1 ≥ H1, return to D10;
[0130] D12: Set the transitional temporary coordinate C(x3, y3, z3) = A(x1 + i1 × 10, y1 + j1 × 10, z1 + d1 × 10), enter D13;
[0131] D13: Store the coordinate C(x3, y3, z3) into the combined cubic block reference coordinate container, return to D11.
[0132] The algorithm principle for creating combined cubic blocks in this application: Generate the combined cubic block model body according to the combined cubic block reference coordinates; as shown in the appendix Figure 1 and 6 shown, specifically including:
[0133] E1: Obtain m2 reference coordinates in the combined cubic block reference coordinate container, set i2 = 0, enter E2;
[0134] E2: Set i2 = i2 + 1, check if i2 is greater than m2. If i2 > m2, end this algorithm; if i2 ≤ m2, it means the i2th combined cubic block is being generated, enter E3;
[0135] E3: Create a 10mm × 10mm × 10mm combined cubic block according to UF_MODL_create_block1() and the i2th reference coordinate, and store the identifier of this combined cubic block into the unfiltered combined cubic block identifier container, return to E2. <F1: Obtain m3 identifiers from the unfiltered combined cube identifier container, set i3=0, and proceed to F2; m3 refers to the number of identifiers of the combined cubes stored in the unfiltered combined cube identifier container.
[0138] F2: Let i3 = i3 + 1, and determine whether i3 is greater than m3. If i3 > m3, it means that the traversal is complete and this algorithm ends; if i3 ≦ m3, it means that the i3th combined cube is being traversed and enter F3.
[0139] F3: Use UF_MODL_check_interference() to determine whether the i3rd combined cube is in contact with the target product model. If they are in contact, the i3rd combined cube is a useful cube, proceed to F4; if they are not in contact, the i3rd combined cube is a useless cube, proceed to F5. In the 3D software program, determining whether the i3rd combined cube is in contact with the target product model can specifically be done by checking whether the identifier of the i3rd combined cube model body interferes with the identifier of the ith target product model.
[0140] F4: Store the identifier of the i3rd combined cube into the container of filtered combined cube identifiers, and return to F2;
[0141] F5: Delete the identifier of the i3rd combined cube according to UF_OBJ_delete_object(), and return to F2.
[0142] The principle of the combined cube fusion algorithm in this application is that, through this algorithm, all useful combined cubes (previously filtered combined cubes) can be combined and fused into a first combined cube, such as... Figure 13 As shown, the first combined cube is the optimal containing block; therefore, the first identifier in the filtered combined cube identifier container in A5 is this first combined cube. (See attached image) Figure 1 and 8 As shown, it specifically includes:
[0143] G1: Obtain m4 identifiers from the filtered combined cube identifier container, set i4=1, and proceed to G2; m4 refers to the number of identifiers of the combined cube stored in the filtered combined cube identifier container; its number is less than m3; G2: Determine if m4 is greater than 1. Since the previous algorithm determines that the filtered combined cube identifier container contains at least one piece of data, if m4>1, it means that the combined cube fusion algorithm needs to be executed, and proceed to G3; if m4≦1, it means that there is only one combined cube, which does not need to be merged, and the combined cube corresponding to this identifier is the best containing block, and this algorithm ends;
[0144] G3: Let i4 = i4 + 1, and check if i4 is greater than m4. If i4 > m4, it means the traversal is over and this algorithm ends; if i4 ≦ i4, it means that the i4th combined cube is being merged and proceed to G4.
[0145] G4: Perform a Boolean operation to sum the i4th combined cube identifier with the 1st combined cube identifier; return to G3; where the Boolean operation summation is the fusion process, and the 1st combined cube identifier is the target, and the i4th combined cube identifier is the tool.
[0146] Example 1
[0147] Step 1: The present invention first executes the algorithm for obtaining the model body containing glue. Assuming that there are 2 and 3 models containing glue in layers 26 and 27 respectively, the algorithm first traverses layer 26, finds the identifiers (identifier 1 and identifier 2) of the 2 models containing glue in the layer and stores them in the model body container containing glue. Then it traverses layer 27, finds the identifiers (identifier 3, identifier 4 and identifier 5) of the 3 models containing glue in the layer and stores them in the model body container containing glue.
[0148] Step 2: Layer 50 contains two target product models, one of which is illustrated in the attached image. Figure 9 As shown, obtain the body identifiers (identifier A, identifier B) of the target product model in layer 50.
[0149] Step 3: For each target product model, an optimal containing block needs to be generated. Therefore, in this case, two optimal containing blocks will be generated. Let's assume that the optimal containing block for identifier A will be generated first.
[0150] Step 4: Obtain the cuboid containing block 2 of the target product model 1 with identifier A using the UGNX built-in interface, such as... Figure 10 As shown;
[0151] Step 5: Based on the algorithm for generating the reference coordinates of the combined cube and the algorithm for establishing the combined cube, obtain the unfiltered combined cube of the target product model with identifier A, such as... Figure 11 As shown; several 10mm×10mm×10mm combined cubic blocks form an unscreened combined cubic block;
[0152] Step Six: Obtain the filtered combination cubes of the target product model with identifier A based on the algorithm for filtering valid contact combination cubes, such as... Figure 12 As shown; a number of 10mm×10mm×10mm combination cubes form a screened combination cube, which is the smallest combination cube that can completely enclose the target product model;
[0153] Step 7: Obtain the optimal containing block 3 for target product model 1 with identifier A using the combined cube fusion algorithm. Assume the identifier of the optimal containing block 3 is C, such as... Figure 13 As shown;
[0154] Step 8: Perform Boolean operations on the identifier C model body and the identifiers 1, 2, 3, 4, and 5 (including the data in the glue position model body container) respectively to obtain the actual product model; assuming the actual product model is identifier D, such as... Figure 14 As shown, the actual product model may be exactly the same as the target product 3D model 1, but there may also be some differences. The shape of the actual product model is entirely determined by the mold. The target product model 1 is the first one designed and is the model that is intended to be produced, so the mold is designed based on the target product model 1. However, the mold structure is complex, and some structures need to be optimized. Therefore, the actual product model obtained from the mold cavity may not be exactly the same as the target product model.
[0155] Repeat steps 4 to 8 to generate the optimal containing block model of the product model body with identifier B (let's assume it's identifier E), and generate the actual product model (let's assume it's identifier F) using the optimal containing block.
[0156] The two actual product 3D models (identifiers D and F) represent the shear cavity results of this invention.
[0157] This application also provides an electronic device, including: a processor; and a memory storing executable code thereon, which, when executed by the processor, causes the processor to perform the method described above. This application also provides a non-transitory machine-readable storage medium storing executable code thereon, which, when executed by the processor of an electronic device, causes the processor to perform the method described above.
[0158] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0159] Memory can include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM can store static data or instructions required by the processor or other modules of the computer. Permanent storage devices can be read-write storage devices. Permanent storage devices can be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices can be removable storage devices (e.g., floppy disks, optical drives). System memory can be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory can store some or all of the instructions and data required by the processor during operation. Furthermore, memory can include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks can also be used. In some implementations, memory 1010 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital multifunction optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.
[0160] The memory stores executable code, which, when processed by the processor, can cause the processor to execute some or all of the methods described above.
[0161] The solution of this application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the descriptions of each embodiment have different emphases; for parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Those skilled in the art should also understand that the actions and modules involved in the specification are not necessarily essential to this application. Furthermore, it is understood that the steps in the method of this application's embodiments can be adjusted, combined, and deleted according to actual needs, and the modules in the device of this application's embodiments can be combined, divided, and deleted according to actual needs.
[0162] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.
[0163] Alternatively, this application may be implemented as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) storing executable code (or computer program, or computer instruction code) thereon, which, when executed by a processor of an electronic device (or electronic device, server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.
[0164] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in connection with the present application can be implemented as electronic hardware, computer software, or a combination of both.
[0165] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive 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 the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, 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.
[0166] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for automatic cavity cutting in three-dimensional software, characterized in that, Including: Obtain a model with a rubber position and a target product model in 3D software; the model with a rubber position consists of several parts with rubber positions, and the parts with rubber positions refer to the parts that contact the forming surface in the mold for preparing the actual product model and the actual product model; Obtain the best enclosing block of the target product model; the best enclosing block includes several combined cubes that contact the actual product model; specifically including: generating a cuboid enclosing block of the target product model; the cuboid enclosing block contains the target product model, and the outermost edges in the target product model are tangent to the cuboid enclosing block; decompose the cuboid enclosing block into several combined cubes; screen out the combined cubes that contact the target product model and merge them into the best enclosing block; specifically including: C1: Execute the algorithm for generating the reference coordinates of the combined cube blocks to obtain m2 reference coordinates for generating the combined cube blocks; C2: Determine whether m2 is greater than 0. If m2 = 0, the algorithm directly ends; if m2 > 0, proceed to C3; C3: Create combined cube blocks of 10mm × 10mm × 10mm according to the reference coordinates; C4: Screen out the combined cube blocks that contact the target product model; C5: Combine all the screened combined cube blocks together to form a complete best enclosing block, and this algorithm ends; Perform a Boolean subtraction operation on the best enclosing block and the model with a rubber position to obtain the actual product model; Among them, executing the algorithm for generating the reference coordinates of the combined cube blocks specifically includes the following steps: D1: Obtain the cuboid enclosing block according to the identifier H' of the target product model; D2: Obtain the lower left corner coordinates A (x1, y1, z1) and the upper right corner coordinates B (x2, y2, z2) of the cuboid enclosing block; D3: Calculate the volume ratio r, r = volume of the target product model / volume of the cuboid enclosing block H''; D4: Determine whether r is greater than the preset value s1. If r > s1, store the identifier H' in the container of the screened combined cube blocks, and this algorithm ends; if r ≤ s1, proceed to D5; D5: Obtain the length L, width W, and height H of the cuboid enclosing block; D6: Let L1 = L / 10 and round up, let W1 = W / 10 and round up, let H1 = H / 10 and round up; D7: Delete the cuboid enclosing block; D8: Let i1 = -1, let j1 = -1, let d1 = -1, and proceed to D9; D9: Let i1 = i1 + 1, determine whether i1 is less than L1. If i1 < L1, proceed to D10; if i1 ≥ L1, this algorithm ends; D10: Let j1 = j1 + 1, determine whether j1 is less than W1. If j1 < W1, proceed to D11; if j1 ≥ W1, return to D9; D11: Let d1 = d1 + 1, determine whether d1 is less than H1. If d1 < H1, proceed to D12; if d1 ≥ H1, return to D10; D12: Let the transitional temporary coordinates C (x3, y3, z3) = A (x1 + i1 × 10, y1 + j1 × 10, z1 + d1 × 10), and proceed to D13; D13: Store the coordinates C (x3, y3, z3) into the composite cube reference coordinate container and return to D11.
2. The method for automatic cavity cutting in three-dimensional software according to claim 1, characterized in that, Create a 10mm×10mm×10mm composite cube based on the reference coordinates, specifically including: E1: Obtain the m2 reference coordinates within the reference coordinate container of the combined cube, set i2=0, and enter E2; E2: Let i2 = i2 + 1, and determine whether i2 is greater than m2. If i2 > m2, the algorithm ends; if i2 ≦ m2, proceed to E3. E3: Create a 10mm×10mm×10mm composite cube based on the i2th reference coordinate, store the identifier of this composite cube in the unfiltered composite cube identifier container, and return to E2.
3. The method for automatic cavity cutting in three-dimensional software according to claim 2, characterized in that, Select the combined cubes that are in contact with the target product model, specifically including: F1: Obtain the m3 identifiers of the unfiltered combined cube identifier container, set i3=0, and proceed to F2; F2: Let i3 = i3 + 1, and determine whether i3 is greater than m3. If i3 > m3, the algorithm ends; if i3 ≦ m3, proceed to F3. F3: Determine whether the i3rd combined cube is in contact with the target product model. If it is in contact, proceed to F4; otherwise, proceed to F5. F4: Store the identifier of the i3rd combined cube into the container of filtered combined cube identifiers, and return to F2; F5: Delete the identifier of the i3rd combined cube and return to F2.
4. The method for automatic cavity cutting in three-dimensional software according to claim 3, characterized in that, All the selected combination cubes are combined together to form a complete optimal containing block, specifically including: G1: Obtain the m4 identifiers from the filtered combined cube identifier container, set i4=1, and proceed to G2; G2: Determine if m4 is greater than 1. If m4 > 1, proceed to G3; if m4 ≦ 1, the combined cube block corresponding to this identifier is the best containing block, and this algorithm ends. G3: Let i4 = i4 + 1, and determine whether i4 is greater than m4. If i4 > m4, the algorithm ends; if i4 ≦ i4, proceed to G4. G4: Perform a Boolean operation to sum the i4th combined cube identifier with the 1st combined cube identifier; return to G3.
5. The method for automatic cavity cutting in three-dimensional software according to claim 1, characterized in that, The model containing the adhesive site is stored in layers in the 3D software.
6. The method for automatic cavity cutting in three-dimensional software according to claim 5, characterized in that, Obtaining a model containing adhesive sites in 3D software specifically includes: B1: Obtain the S1 layers of the user-provided model containing adhesive sites, set j1=0, and proceed to B2; B2: Let j1 = j1 + 1, and determine whether j1 is greater than s1. If j1 > s1, the algorithm ends; if j1 ≦ s1, proceed to B3. B3: Obtain the identifiers of the s2 glue-containing models in the j1-th layer, set j2=0, and proceed to B4; B4: Let j2 = j2 + 1, and determine whether j2 is greater than s2. If j2 > s2, return to B2; if j2 ≦ s2, proceed to B5. B5: Add the j2th individual identifier to the container containing the glue position model body, and return to B4.
7. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-6.