Method for processing an operation instruction oriented to a three-dimensional model and related device

CN118288544BActive Publication Date: 2026-09-29SHENZHEN ANYCUBIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410397652.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-02
Publication Date
2026-09-29
Estimated Expiration
2044-04-02

AI Technical Summary

Benefits of technology

[0057]从以上技术方案可以看出,本申请实施例具有以下优点:在多边形网格的面片中三角形面片是被分割的最小单位,且表示比较简单、灵活。并且,若需要执行任一操作指令的相关操作,则在相应的新增队列中新增待处理记录,待处理记录中存储有执行相关操作前的当前三维模型中会受到相关操作影响的关联面片,以及前述操作指令。这样在需要撤销该相关操作时,仅需要从前述新增队列中查找包括相应操作指令的待处理记录,便可获取到撤销该相关操作所需的关联面片,以将处理后三维模型恢复至执行相关操作前的当前三维模型。本申请实施例,无需保存整个三维模型,便可以实现操作指令的撤销,相较于现有技术方案很大程度上释放了内存空间以及减少为了保证撤销而进行存储所需的时间,提升了用户体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118288544B_ABST
    Figure CN118288544B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a method for processing operation instructions for a three-dimensional model and related equipment, which are used for releasing memory space and reducing time required for storage to ensure undo, and improve user experience. The method comprises: performing a corresponding operation on a current three-dimensional model according to an operation instruction to obtain a processed three-dimensional model, the current three-dimensional model being composed of triangular facets; determining each triangular facet affected by the operation instruction in the current three-dimensional model as an associated facet; and adding a to-be-processed record in a new queue associated with the corresponding operation, the to-be-processed record containing the associated facet and the operation instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of 3D printing, and more particularly to a method and related equipment for drilling operations on three-dimensional models. Background Technology

[0002] In the 3D printing industry, during the design of a 3D model, it is usually necessary to drill holes in the 3D digital model. If the drilling position is not appropriate, the drilling operation needs to be undone to restore the model before drilling.

[0003] The traditional undo method involves saving a copy of the model before drilling, and then replacing it with the saved model when undo is needed. This approach, when dealing with large 3D models, consumes a significant amount of memory and requires considerable time to store the model before drilling. Summary of the Invention

[0004] This application provides a method and related equipment for processing operation instructions for 3D models, which can free up memory space and reduce the time required for storage to ensure undoing, thereby improving the user experience.

[0005] The first aspect of this application provides a method for processing operation instructions for a three-dimensional model, including:

[0006] The current 3D model is processed by performing corresponding operations on the current 3D model according to the operation instructions. The current 3D model is composed of triangular facets.

[0007] Each triangular facet in the current 3D model affected by the operation command is identified as an associated facet.

[0008] A new record to be processed is added to the new queue associated with the corresponding operation. The record to be processed includes the associated patch and the operation instruction.

[0009] In one specific implementation, the corresponding operation includes a punching operation, the operation instruction includes a punching instruction, the new queue includes a cancellation queue, and the pending record includes a record to be cancelled.

[0010] The step of determining each triangular facet in the current 3D model affected by the operation command as an associated facet includes:

[0011] Calculate the minimum bounding box of the punching tool body indicated by the punching command;

[0012] Each triangular facet in the current 3D model that intersects with the minimum bounding box is identified as an associated facet.

[0013] One specific implementation also includes:

[0014] Using the circumscribed cube of the current 3D model as the root node, an octree is constructed according to a preset recursion depth. Each node in the octree corresponds to a cube, and the cube includes the circumscribed cube.

[0015] For each node in the octree, each triangular facet located in the cube corresponding to the node is determined as the triangular facet associated with the node;

[0016] The step of determining each triangular facet in the current 3D model that intersects with the minimum bounding box as an associated facet includes:

[0017] Determine the target node in the octree where the corresponding cube intersects with the minimum bounding box;

[0018] Based on the triangular facets associated with each node, the triangular facets associated with the target node are determined as the associated facets.

[0019] In one specific implementation, determining the target node where the cube in the octree intersects with the minimum bounding box includes:

[0020] The root node is determined as the parent node;

[0021] In response to the operation of determining the parent node, determine whether the cube corresponding to the parent node intersects with the minimum bounding box;

[0022] If the cube corresponding to the parent node intersects with the minimum bounding box, then determine whether each of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box.

[0023] If any of the child nodes below the parent node intersects with the minimum bounding box, then any of the child nodes below the parent node is determined as the new parent node, until the parent node has no corresponding child nodes.

[0024] Each parent node that does not have a corresponding child node is identified as the target node.

[0025] In one specific implementation, the corresponding operation includes an undo operation, the operation instruction includes an undo instruction, the new queue includes a redo queue, the pending record includes a pending redo record, and the step of performing the corresponding operation on the current 3D model according to the operation instruction to obtain the processed 3D model includes:

[0026] Search the cancellation queue for a target record to be cancelled that includes a target punching instruction, wherein the cancellation instruction indicates the target punching instruction as the object to be cancelled;

[0027] The current 3D model is adjusted based on the target patch contained in the target record to be revoked to obtain the processed 3D model;

[0028] Delete the target record to be revoked from the revocation queue.

[0029] In one specific implementation, adjusting the current 3D model based on the target facets contained in the target record to be revoked to obtain the processed 3D model includes:

[0030] Obtain the facet identifier of each target facet contained in the target record to be revoked;

[0031] For each target facet contained in the target to be revoked record, find the facet to be replaced in the current 3D model, and replace the facet to be replaced in the current 3D model with the target facet to obtain the processed 3D model. The facet identifier corresponding to the facet to be replaced is consistent with the facet identifier of the target facet.

[0032] In one specific implementation, the corresponding operation includes a redo operation, the operation instruction includes a redo instruction, the new queue includes an undo queue, the pending record includes a pending undo record, and the step of performing the corresponding operation on the current 3D model according to the operation instruction to obtain the processed 3D model includes:

[0033] Search the redo queue for a target record to be redone that includes a target undo instruction, wherein the redo instruction indicates the target undo instruction as the redo object;

[0034] The current 3D model is adjusted based on the target patches contained in the target record to be redone to obtain the processed 3D model;

[0035] Delete the target record to be redone from the redo queue.

[0036] A second aspect of this application provides a computer device, including:

[0037] An execution unit is used to perform corresponding operations on the current three-dimensional model according to the operation instructions to obtain a processed three-dimensional model, wherein the current three-dimensional model is composed of triangular facets;

[0038] A determining unit is used to determine each triangular facet in the current 3D model affected by the operation command as an associated facet;

[0039] A new unit is used to add a record to be processed in the new queue associated with the corresponding operation. The record to be processed includes the associated patch and the operation instruction.

[0040] In one specific implementation, the corresponding operation includes a punching operation, the operation instruction includes a punching instruction, the new queue includes a cancellation queue, and the pending record includes a record to be cancelled.

[0041] The determining unit is specifically used to calculate the minimum bounding box of the punching tool body indicated by the punching command; and to determine each triangular facet in the current three-dimensional model that intersects with the minimum bounding box as an associated facet.

[0042] In one specific implementation, the computer device also includes: building blocks;

[0043] The construction unit is used to construct an octree with the outer cube of the current 3D model as the root node and according to a preset recursion depth. Each node in the octree corresponds to a cube, and the cube includes the outer cube.

[0044] The determining unit is further configured to, for each node in the octree, determine each triangular facet located in the cube corresponding to the node as the triangular facet associated with the node;

[0045] The determining unit is specifically used to determine the target node in the octree where the corresponding cube intersects with the minimum bounding box; and to determine the triangular facet associated with the target node as the associated facet based on the triangular facets associated with each node.

[0046] In one specific implementation, the determining unit is specifically used to determine the root node as a parent node; in response to the operation of determining the parent node, it determines whether the cube corresponding to the parent node intersects with the minimum bounding box; if the cube corresponding to the parent node intersects with the minimum bounding box, it determines whether each of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box; if any of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box, it determines any of the next-level child nodes corresponding to the parent node as a new parent node, until the parent node has no corresponding child nodes; and determines each parent node that has no corresponding child node as the target node.

[0047] In one specific implementation, the corresponding operation includes an undo operation, the operation instruction includes an undo instruction, the new queue includes a redo queue, the record to be processed includes a record to be redone, and the execution unit is specifically used to search for a target record to be undoed that includes a target punching instruction in the undo queue, wherein the undo instruction indicates the target punching instruction as the object to be undoed; adjust the current 3D model based on the target facet contained in the target record to be undoed to obtain the processed 3D model; and delete the target record to be undoed from the undo queue.

[0048] In one specific implementation, the execution unit is specifically used to obtain the face identifier of each target facet contained in the target record to be revoked;

[0049] For each target facet contained in the target to be revoked record, find the facet to be replaced in the current 3D model, and replace the facet to be replaced in the current 3D model with the target facet to obtain the processed 3D model. The facet identifier corresponding to the facet to be replaced is consistent with the facet identifier of the target facet.

[0050] In one specific implementation, the corresponding operation includes a redo operation, the operation instruction includes a redo instruction, the new queue includes an undo queue, the record to be processed includes a record to be undone, and the execution unit is specifically used to: search for a target record to be redoed that includes a target undo instruction in the redo queue, wherein the redo instruction indicates the target undo instruction as the redo object; adjust the current 3D model based on the target facets contained in the target record to be redoed to obtain the processed 3D model; and delete the target record to be redoed from the redo queue.

[0051] A third aspect of this application provides a computer device, including:

[0052] Central processing unit, memory, and input / output interfaces;

[0053] The memory is either a short-term storage memory or a persistent storage memory;

[0054] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method described in the first aspect.

[0055] A fourth aspect of this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect.

[0056] A fifth aspect of this application provides a computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect.

[0057] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: In the polygonal mesh, the triangular facet is the smallest unit of division, and its representation is relatively simple and flexible. Furthermore, if any operation related to an operation instruction needs to be executed, a new record to be processed is added to the corresponding new queue. This record stores the associated faces in the current 3D model that will be affected by the operation before execution, as well as the aforementioned operation instruction. Thus, when it is necessary to undo the operation, it is only necessary to search for the record to be processed containing the corresponding operation instruction in the aforementioned new queue to obtain the associated faces required to undo the operation, thereby restoring the processed 3D model to the current 3D model before the operation. The embodiments of this application can achieve the undoing of operation instructions without saving the entire 3D model, which significantly frees up memory space and reduces the time required for storage to ensure undoing compared to existing technical solutions, thus improving the user experience. Attached Figure Description

[0058] Figure 1 This is a flowchart illustrating a method for processing operation instructions for a 3D model as disclosed in an embodiment of this application.

[0059] Figure 2 This is a schematic diagram of the octree structure disclosed in an embodiment of this application;

[0060] Figure 3 This is a schematic diagram of the structure of a computer device disclosed in an embodiment of this application;

[0061] Figure 4 This is another schematic diagram of the computer device disclosed in the embodiments of this application. Detailed Implementation

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

[0063] This application provides a method and related equipment for processing operation instructions for 3D models, which can free up memory space and reduce the time required for storage to ensure undoing, thereby improving the user experience.

[0064] Please see Figure 1 This application provides a method for processing operation instructions for 3D models, which can be deployed in 3D software or computer devices, and specifically includes the following steps:

[0065] 101. Perform the corresponding operations on the current 3D model according to the operation instructions to obtain the processed 3D model. The current 3D model is composed of triangular facets.

[0066] Considering the problem of excessive data volume of the overall 3D model, this application uses triangular patches, which are relatively simple and flexible, to describe all 3D models (such as the current 3D model and the processed 3D model) in the foregoing and following embodiments of this application. Furthermore, triangular patches can more accurately describe the different parts that make up the 3D model.

[0067] Generally, after receiving an operation command for the current 3D model, the corresponding operation can be performed on the current 3D model according to the preset processing logic of the 3D software to obtain the processed 3D model.

[0068] 102. Identify each triangular facet in the current 3D model that is affected by the operation command as an associated facet.

[0069] To undo the operation command, that is, to restore the processed 3D model to the current 3D model, steps 102 and 103 of this application need to be executed simultaneously if it is necessary to perform the corresponding operation on the current 3D model.

[0070] Specifically, since this application uses triangular facets to describe the current 3D model, this application embodiment conceives of only saving the parts of the current 3D model that will change when the corresponding operation is performed, i.e., the associated facets. In this way, when it is necessary to undo the corresponding operation, the processed 3D model can be restored to the current 3D model before processing by using the saved associated triangular facets.

[0071] 103. Add a new record to be processed in the new queue associated with the corresponding operation. The record to be processed contains the associated facet and the operation instruction.

[0072] In practical applications, 3D software typically includes undo controls for reversing and redo controls for redoing. Both undo and redo controls exist in corresponding queues. The undo queue stores multiple undone operation commands, while the redo queue stores multiple redoable operation commands. Furthermore, different operation commands in 3D software can lead to different subsequent operations. For example, after executing a drilling command, an undo command can be executed. However, once an undo command is executed, the undone operation cannot be undone again; only a redo command can be executed to re-execute the undone operation. Therefore, to accurately handle undone and redoable operations in 3D software, this application configures different new queues for different operations. The face associated with the operation command is stored in the operation queue of the subsequent operations corresponding to that operation command, so that subsequent operations can continue to be executed after the aforementioned operation. The operation queue for subsequent operations is the new queue.

[0073] In addition, to accurately distinguish the operation instructions belonging to different associated patches, it is also necessary to record the operation instructions in the pending record. Specifically, the pending record can record the associated patch itself and the operation instruction itself, or record the patch identifier of the associated patch and the instruction identifier of the operation instruction; no specific limitation is made here.

[0074] In this embodiment, if any operation command needs to be executed, a new record to be processed is added to the corresponding new queue. This record stores the associated faces in the current 3D model that will be affected by the operation before execution, as well as the aforementioned operation command. Thus, when the operation needs to be undone, only the record containing the corresponding operation command needs to be retrieved from the new queue to obtain the associated faces required to undone the operation, restoring the processed 3D model to its state before the operation. This embodiment eliminates the need to save the entire 3D model to undone the operation command, significantly reducing memory space and the time required for storage to ensure undone operation compared to existing solutions, thus improving the user experience.

[0075] Understandably, after a punching operation is performed, typically only a reversal operation for that punching operation can be performed. Therefore, in some specific implementations, if the aforementioned corresponding operation is a punching operation, the operation instruction should be a punching instruction, the new queue should be a reversal queue, and the pending record should be a record to be reversed. Specifically, the aforementioned step 102 can be implemented in the following way: calculate the minimum bounding box of the punching tool body indicated by the punching instruction; determine each triangular facet in the current 3D model that intersects with the minimum bounding box as an associated facet.

[0076] In general, the method for 3D software to perform a hole-punching operation on the current 3D model involves the user setting a hole-punching tool of a specific size at a certain position on the current 3D model displayed by the 3D software. Subsequently, the 3D software will simulate the effect of the hole-punching tool on the current 3D model and obtain the corresponding processed 3D model.

[0077] In other words, the triangular facets in the current 3D model that are affected by the operation command should be the facets that intersect with the punching tool body set by the user or software. That is, the facets in the current 3D model that intersect with the punching tool body are the facets associated with the aforementioned punching operation.

[0078] Understandably, after a cancellation operation for the punching operation, typically only a redo operation for that punching operation can be performed (or a cancellation operation for the aforementioned cancellation operation). Therefore, further, if the aforementioned corresponding operation is a cancellation operation, the operation instruction includes a cancellation instruction, the new queue includes a redo queue, and the pending records include records to be redone. Specifically, the aforementioned step 101 can be implemented as follows: Search the cancellation queue for a target record to be cancelled that includes the target punching instruction, where the cancellation instruction indicates the target punching instruction as the object to be cancelled; adjust the current 3D model based on the target facet contained in the target record to be cancelled to obtain the processed 3D model; delete the target record to be cancelled from the cancellation queue.

[0079] Specifically, other operations must have been performed before the undo operation is executed, thus creating an object to be undone. The operations preceding the undo operation might be a punching operation or a redo operation for a specific punching operation. Therefore, the object to be undone is typically a punching instruction, such as a target punching instruction. In other words, in this application embodiment, the aforementioned punching operation-related embodiments can be executed before the redo operation. As can be seen from the foregoing, the target punching instruction to be undone in this application embodiment can be a punching instruction executed in the aforementioned embodiments, a punching instruction redoed in subsequent steps, or a historical punching instruction executed by the 3D software; no limitation is made here.

[0080] Since each record to be undone in the undo queue contains an operation instruction and the associated facets that changed in the 3D model after the operation instruction was executed, the current 3D model is adjusted based on the target facets contained in the target record to be undone to obtain the processed 3D model. In this embodiment, the processed 3D model is the 3D model before the target drilling instruction was executed. Furthermore, once any record to be undone is invoked to execute the corresponding undo operation, the operation instruction contained in that record cannot be undone again. Therefore, it is necessary to delete the corresponding target record to be undone from the undo queue.

[0081] Understandably, after canceling a punching operation and continuing with a redo operation for that punching operation, typically only a canceling operation for that punching operation can continue to be executed (or a redo operation for the canceling operation that canceled the aforementioned punching operation). Therefore, further, if the aforementioned corresponding operation is a redo operation, then the operation instruction is a redo instruction, the new queue is a canceling queue, and the record to be processed is a record to be canceled. Specifically, the aforementioned step 101 can be implemented in the following way: search for a target record to be redoed that includes a target canceling instruction in the redo queue, where the redo object indicated by the redo instruction is the target canceling instruction; adjust the current 3D model based on the target facet contained in the target record to be redoed to obtain the processed 3D model; delete the target record to be redoed from the redo queue.

[0082] Similar to the aforementioned embodiments, an undo operation must have been performed before the redo operation, thus creating an undo object. Therefore, the redo object is typically an undo instruction, such as a target undo instruction. In other words, before performing the redo operation, the embodiments of this application can also execute the aforementioned undo operation-related embodiments and the aforementioned punching operation-related embodiments. As can be seen from the foregoing, the target undo instruction to be redone in the embodiments of this application can be an undo instruction executed in the aforementioned embodiments or a historical undo instruction executed by the 3D software; this is not limited here.

[0083] Since each record to be redone in the redo queue contains an operation instruction and the associated facets that changed in the 3D model after the operation instruction was executed, the current 3D model is adjusted based on the target facets contained in the target record to be redone to obtain the processed 3D model. In this embodiment, the processed 3D model is the 3D model after the punching operation was undone by the target undo instruction. Furthermore, once any record to be redone is invoked to execute the corresponding redo operation, the operation instructions contained in that record cannot be redone again. Therefore, it is necessary to delete the corresponding target record to be redone from the redo queue.

[0084] As can be seen from the foregoing embodiments, if the relevant operation is a redo operation or an undo operation, then the step of "performing the corresponding operation on the current 3D model to obtain the processed 3D model" can be achieved by restoring the 3D model to its state before the previous operation was performed by using the triangular facets of the 3D model that changed before and after the previous operation was performed.

[0085] In this context, the preceding operation refers to the operation that typically occurs in the business logic or process of the 3D software before the execution of the aforementioned related operation. In other words, the preceding operation is the operation corresponding to the object indicated by the operation instruction corresponding to the aforementioned related operation. Taking the undo operation as an example, a punching operation is generally performed before the undo operation; therefore, the preceding operation for this related operation is the punching operation. In other words, if the undo operation indicates that the undo object is a punching instruction, then the preceding operation for this related operation is the punching operation corresponding to that punching instruction. It is important to note that...

[0086] In some specific implementations, if the relevant operation is an undo operation, the steps of "performing the corresponding operation on the current 3D model to obtain the processed 3D model" can be implemented as follows: obtain the facet identifier of each target facet contained in the target record to be undone; for each target facet contained in the target record to be undone, find the facet to be replaced in the current 3D model, and replace the facet to be replaced in the current 3D model with the target facet to obtain the processed 3D model, where the facet identifier of the facet to be replaced is consistent with the facet identifier of the target facet.

[0087] It should be noted that the 3D models in this application embodiment are all composed of at least one triangular facet. Different triangular facets have the same size, differing mainly in their placement position (including but not limited to placement angle and coordinates) in the 3D model coordinate system. To more easily distinguish different triangular facets, each triangular facet in the 3D model of this application embodiment can be configured with a unique facet identifier. Generally, the facet identifier can be a hash value of the angle and position of the triangular facet in the 3D model coordinate system, or a randomly assigned unique identifier; no limitation is made here.

[0088] In practice, users constantly modify and / or adjust 3D models when using 3D software. To reduce resource consumption and improve query efficiency, this embodiment of the application will not reassign new facet identifiers to triangles that remain unchanged before and after modification and / or adjustment. Taking the transformation of the current 3D model into the processed 3D model as an example, if the current 3D model consists of three triangles, and the processed 3D model also consists of three triangles, and only one triangle in the processed 3D model is in the same position as a triangle in the current 3D model, then only the two triangles in the processed 3D model other than this triangle need to be assigned new facet identifiers.

[0089] Specifically, in the process of obtaining the processed model through target facets, the facet to be replaced in the current 3D model whose facet identifier matches the facet identifier of the target facet can be directly identified. The target facet is then used to replace the facet to be replaced in the current 3D model. If each target facet in the target undoing record replaces the corresponding facet to be replaced in the current 3D model in the aforementioned manner, the resulting 3D model is the processed 3D model. It can be understood that the method of replacing the facet to be replaced with a target facet can be to delete the corresponding facet to be replaced in the current 3D model and place the target facet in its corresponding position in the current 3D model, thus completing the replacement of the target facet.

[0090] Based on the foregoing embodiments, in some specific implementations, the embodiments of this application further include the following steps: taking the circumscribed cube of the current 3D model as the root node, constructing an octree according to a preset recursion depth, where each node in the octree corresponds to a cube, and the cube includes the circumscribed cube; for each node in the octree, determining each triangular facet located in the cube corresponding to the node as the triangular facet associated with the node; subsequently, the aforementioned step of "determining each triangular facet intersecting with the minimum bounding box in the current 3D model as an associated facet" may include: determining the target node in the octree where the corresponding cube intersects with the minimum bounding box; and determining the triangular facet associated with the target node as an associated facet based on the triangular facets associated with each node.

[0091] By constructing an octree, each triangular facet in the 3D model can be associated with a corresponding node, enabling faster lookup of associated facets. Specifically, the octree consists of multiple nodes from top to bottom. Each node has a corresponding cube in the coordinate system of the 3D model. This cube may contain at least one triangular facet of the 3D model or any triangular facet not contained in the 3D model. The cube corresponding to the root node is the circumscribed cube of the 3D model. The eight cubes obtained by partitioning the circumscribed cube correspond one-to-one with the eight next-level nodes of the root node. The recursion ends when the number of node levels equals the preset recursion depth, resulting in the final octree. The preset recursion depth can be configured as needed and is not limited here. The octree construction is shown below. Figure 2 The diagram shows the structure.

[0092] It should be noted that if a cube contains a triangular facet, it means that at least a portion of the triangular facet is located within the cube in the coordinate system of the 3D model.

[0093] Furthermore, the aforementioned step of "determining the target node where the corresponding cube in the octree intersects with the minimum bounding box" includes: determining the root node as the parent node; in response to the operation of determining the parent node, determining whether the cube corresponding to the parent node intersects with the minimum bounding box; if the cube corresponding to the parent node intersects with the minimum bounding box, then determining whether each of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box; if any of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box, then determining any of the next-level child nodes corresponding to the parent node as the new parent node, until the parent node has no corresponding child nodes; and determining each parent node that has no corresponding child node as the target node.

[0094] Specifically, starting from the root node, the search proceeds from top to bottom, examining the cubes corresponding to each node at each level of the octree to find every cube that intersects with the minimum bounding box. This continues until the cubes corresponding to each node at the next level no longer intersect with the minimum bounding box. The search ends there, and the node whose cube at the current level intersects with the minimum bounding box is identified as the target node. In essence, the cube corresponding to the target node is the smallest cube at each level of the octree that contains the associated triangular facets.

[0095] A second aspect of this application provides a computer device, including:

[0096] The execution unit 301 is used to perform corresponding operations on the current three-dimensional model according to the operation instructions to obtain the processed three-dimensional model. The current three-dimensional model is composed of triangular facets.

[0097] The determining unit 302 is used to determine each triangular facet in the current 3D model that is affected by the operation command as an associated facet.

[0098] The newly added unit 302 is used to add a record to be processed in the new queue associated with the corresponding operation. The record to be processed includes the associated facet and the operation instruction.

[0099] In one specific implementation, the corresponding operations include a punching operation, the operation instructions include a punching instruction, the new queue includes a cancel queue, and the records to be processed include records to be canceled.

[0100] Unit 302 is specifically used to calculate the minimum bounding box of the punching tool body indicated by the punching command; and to determine each triangular facet in the current 3D model that intersects with the minimum bounding box as an associated facet.

[0101] In one specific implementation, the computer device also includes: building blocks;

[0102] The building unit is used to construct an octree with the outer cube of the current 3D model as the root node and according to a preset recursion depth. Each node in the octree corresponds to a cube, and the cube includes the outer cube.

[0103] The determining unit 302 is also used to determine each triangular facet located in the cube corresponding to the node as the triangular facet associated with the node for each node in the octree;

[0104] The determination unit 302 is specifically used to determine the target node in the octree where the corresponding cube intersects with the minimum bounding box; based on the triangular facets associated with each node, the triangular facets associated with the target node are determined as associated facets.

[0105] In one specific implementation, the determining unit 302 is specifically used to determine the root node as the parent node; in response to the operation of determining the parent node, it determines whether the cube corresponding to the parent node intersects with the minimum bounding box; if the cube corresponding to the parent node intersects with the minimum bounding box, it determines whether each of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box; if any of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box, it determines any of the next-level child nodes corresponding to the parent node as the new parent node, until the parent node has no corresponding child nodes; each parent node that has no corresponding child node is determined as the target node.

[0106] In one specific implementation, the corresponding operation includes an undo operation, the operation instruction includes an undo instruction, the new queue includes a redo queue, the pending record includes a pending redo record, and the execution unit 301 is specifically used to search for a target pending undo record that includes a target punching instruction in the undo queue, wherein the undo instruction indicates the undo object of the target punching instruction; adjust the current 3D model based on the target facet contained in the target pending undo record to obtain the processed 3D model; and delete the target pending undo record in the undo queue.

[0107] In one specific implementation, the execution unit is specifically used to obtain the face identifier of each target face contained in the target record to be revoked;

[0108] For each target facet contained in the target record to be revoked, find the facet to be replaced in the current 3D model, and replace the facet to be replaced in the current 3D model with the target facet to obtain the processed 3D model. The facet identifier corresponding to the facet to be replaced is consistent with the facet identifier of the target facet.

[0109] In one specific implementation, the corresponding operation includes a redo operation, the operation instruction includes a redo instruction, the new queue includes an undo queue, the pending record includes a pending undo record, and the execution unit 301 is specifically used to search for a target pending redo record that includes a target undo instruction in the redo queue, wherein the redo object indicated by the redo instruction is the target undo instruction; adjust the current 3D model based on the target facet contained in the target pending redo record to obtain the processed 3D model; and delete the target pending redo record in the redo queue.

[0110] Figure 4 This is a schematic diagram of a computer device structure provided in an embodiment of this application. The computer device 400 may include one or more central processing units (CPUs) 401 and a memory 405, in which one or more application programs or data are stored.

[0111] The memory 405 can be volatile or persistent storage. The program stored in the memory 405 can include one or more modules, each module including a series of instruction operations on the computer device. Furthermore, the central processing unit 401 can be configured to communicate with the memory 405 and execute the series of instruction operations stored in the memory 405 on the computer device 400.

[0112] Computer device 400 may also include one or more power supplies 402, one or more wired or wireless network interfaces 403, one or more input / output interfaces 404, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0113] The central processing unit 401 can perform the aforementioned... Figures 1 to 3 The specific operations performed by the computer device in the illustrated embodiment will not be described in detail here.

[0114] It should be noted that although the steps in the flowcharts of the various embodiments are drawn sequentially according to the arrows, unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the various embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0115] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0116] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0117] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0118] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0119] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0120] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the above-described method for processing operation instructions for a three-dimensional model.

Claims

1. A method for processing operation instructions for three-dimensional models, characterized in that, include: The current 3D model is processed by performing corresponding operations on the current 3D model according to the operation instructions. The current 3D model is composed of triangular facets. Each triangular facet in the current 3D model affected by the operation command is identified as an associated facet. A new record to be processed is added to the new queue associated with the corresponding operation. The record to be processed includes the associated patch and the operation instruction.

2. The method for processing operation instructions for three-dimensional models according to claim 1, characterized in that, The corresponding operations include a punching operation, the operation instructions include a punching instruction, the new queue includes a cancellation queue, and the records to be processed include records to be cancelled. The step of determining each triangular facet in the current 3D model affected by the operation command as an associated facet includes: Calculate the minimum bounding box of the punching tool body indicated by the punching command; Each triangular facet in the current 3D model that intersects with the minimum bounding box is identified as an associated facet.

3. The method for processing operation instructions for three-dimensional models according to claim 2, characterized in that, Also includes: Using the circumscribed cube of the current 3D model as the root node, an octree is constructed according to a preset recursion depth. Each node in the octree corresponds to a cube, and the cube includes the circumscribed cube. For each node in the octree, each triangular facet located in the cube corresponding to the node is determined as the triangular facet associated with the node; The step of determining each triangular facet in the current 3D model that intersects with the minimum bounding box as an associated facet includes: Determine the target node in the octree where the corresponding cube intersects with the minimum bounding box; Based on the triangular facets associated with each node, the triangular facets associated with the target node are determined as the associated facets.

4. The method for processing operation instructions for three-dimensional models according to claim 3, characterized in that, Determining the target node where the corresponding cube in the octree intersects with the minimum bounding box includes: The root node is determined as the parent node; In response to the operation of determining the parent node, determine whether the cube corresponding to the parent node intersects with the minimum bounding box; If the cube corresponding to the parent node intersects with the minimum bounding box, then determine whether each of the next-level child nodes corresponding to the parent node intersects with the minimum bounding box. If any of the child nodes below the parent node intersects with the minimum bounding box, then any of the child nodes below the parent node is determined as the new parent node, until the parent node has no corresponding child nodes. Each parent node that does not have a corresponding child node is identified as the target node.

5. The method for processing operation instructions for three-dimensional models according to claim 1, characterized in that, The corresponding operation includes an undo operation, the operation instruction includes an undo instruction, the new queue includes a redo queue, the pending record includes a record to be redone, and the step of performing the corresponding operation on the current 3D model according to the operation instruction to obtain the processed 3D model includes: Search the cancellation queue for a target record to be cancelled that includes a target punching instruction, wherein the cancellation instruction indicates the target punching instruction as the object to be cancelled; The current 3D model is adjusted based on the target patch contained in the target record to be revoked to obtain the processed 3D model; Delete the target record to be revoked from the revocation queue.

6. The method for processing operation instructions for three-dimensional models according to claim 5, characterized in that, The step of adjusting the current 3D model based on the target patches contained in the target record to be revoked to obtain the processed 3D model includes: Obtain the facet identifier of each target facet contained in the target record to be revoked; For each target facet contained in the target to be revoked record, find the facet to be replaced in the current 3D model, and replace the facet to be replaced in the current 3D model with the target facet to obtain the processed 3D model. The facet identifier corresponding to the facet to be replaced is consistent with the facet identifier of the target facet.

7. The method for processing operation instructions for three-dimensional models according to claim 1, characterized in that, The corresponding operation includes a redo operation, the operation instruction includes a redo instruction, the new queue includes an undo queue, the pending record includes a pending undo record, and the step of performing the corresponding operation on the current 3D model according to the operation instruction to obtain the processed 3D model includes: Search the redo queue for a target record to be redone that includes a target undo instruction, wherein the redo instruction indicates the target undo instruction as the redo object; The current 3D model is adjusted based on the target patches contained in the target record to be redone to obtain the processed 3D model; Delete the target record to be redone from the redo queue.

8. A computer device, characterized in that, include: An execution unit is used to perform corresponding operations on the current three-dimensional model according to the operation instructions to obtain a processed three-dimensional model, wherein the current three-dimensional model is composed of triangular facets; A determining unit is used to determine each triangular facet in the current 3D model affected by the operation command as an associated facet; A new unit is used to add a record to be processed in the new queue associated with the corresponding operation. The record to be processed includes the associated patch and the operation instruction.

9. A computer device, characterized in that, include: Central processing unit, memory, and input / output interfaces; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method of any one of claims 1 to 7.

10. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed on the computer, cause the computer to perform the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Three dimensional model and scene creating method and apparatus based on mobile intelligent terminal

    CN105513137A

  • Revocation and / or redo implementation method and device suitable for three-dimensional detection software

    CN112000321A