A model deconstruction method, device and storage medium
By using the model tree and AABB bounding box in the model deconstruction method, the problem of high computational complexity based on the OBB bounding box algorithm in the prior art is solved, and efficient model deconstruction is achieved, reducing the calculation cost.
Patent Information
- Application Number
- CN202411060325.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-08-05
AI Technical Summary
In the existing model deconstruction method, the algorithm based on the OBB bounding box has high computational complexity, and it is difficult to provide an algorithm close to the effect of the OBB bounding box to reduce the calculation cost and complexity.
The model deconstruction method based on the model tree and AABB bounding box is adopted. By determining the user-specified deconstruction level, the deconstruction distance and movement distance of each level are calculated, and the deconstruction diagram is generated, which simplifies the calculation process.
Without reducing the explosion effect, the calculation amount is reduced, the calculation efficiency is improved, and the effect is close to that of the OBB bounding box algorithm.
Smart Images

Figure CN118657912B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computing technology, and in particular to a model deconstruction method, device and storage medium. Background Art
[0002] Among the existing model deconstruction methods, there are automatic generation of hierarchical deconstruction algorithms (deconstruction algorithms are also called explosion algorithms), automatic generation algorithms of layered deconstruction graphs based on assembly constraints and collision detection, and deconstruction graph generation algorithms based on ant colony algorithms. However, for some users, the implementation of these algorithms is relatively special and is based on the OBB bounding box. Because the OBB bounding box is a relatively precise type, the more precise algorithms on the market are actually implemented based on the OBB bounding box.
[0003] The publication number is CN109376383A, and the invention name is a method for generating an exploded view based on collision detection, which belongs to the technical field of generating exploded views. The disclosed method includes: obtaining a three-dimensional CAD model; obtaining the area of the OBB bounding box of each part; performing rough separation using the relative position relationship in space; and re-separating some parts using collision detection.
[0004] The publication number is CN104598683A, and the invention name is a method for automatically generating hierarchical exploded views, which belongs to the technical field of explosion view generation. The disclosed method includes: obtaining a three-dimensional CAD assembly drawing; extracting the constraint relationship between the assembly parts in the three-dimensional CAD assembly drawing to obtain a contact-connection matrix and an extended interference matrix; hierarchical assembly sequence planning; and automatically generating a hierarchical exploded view.
[0005] However, the calculation of the OBB bounding box is relatively complicated. Therefore, how to provide an algorithm that is close to the effect of the OBB bounding box but has lower calculation cost and complexity is a technical problem that needs to be solved urgently. Summary of the invention
[0006] In view of the above problems existing in the prior art, the embodiments of the present disclosure provide a model deconstruction method, device and storage medium to reduce the complexity of calculation and improve the efficiency of calculation.
[0007] According to one aspect of an embodiment of the present disclosure, a model deconstruction method is provided, comprising:
[0008] Determine the user-specified deconstruction level;
[0009] Starting from the first level to the deconstruction level specified by the user, performing a deconstruction operation on each level, and determining the deconstruction distance of all leaf nodes in each level;
[0010] For each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain the distance to be moved;
[0011] For each leaf node, the position of the leaf node and the distance to be moved are added to obtain a deconstructed graph;
[0012] Wherein, the deconstruction ratio is preset.
[0013] Furthermore, the deconstruction operation performed on each level includes:
[0014] If this level is a deconstruction level specified by the user, all nodes in this level are determined to be leaf nodes. If this level is not a deconstruction level specified by the user, all nodes in this level are divided into leaf node groups and non-leaf node groups, and the parent-child relationship between all nodes in this level and their parent nodes is recorded.
[0015] Perform the first type of operation on all leaf nodes in the leaf node group of this level to determine the deconstruction distance;
[0016] Perform the second type of operation on all non-leaf nodes in the non-leaf node group of this level to determine the expansion distance;
[0017] The first type of operation and the second type of operation are not completely the same.
[0018] Further, the first type of operation is performed on all leaf nodes in the leaf node group of this level to determine the deconstruction distance, including:
[0019] Determine the deconstruction direction of all leaf nodes;
[0020] Calculate the deconstruction distance of the leaf nodes at this level;
[0021] After calculating the deconstruction distances of all leaf nodes in this level, record the maximum deconstruction distance in this level.
[0022] Furthermore, the deconstruction direction of all leaf nodes is determined as follows:
[0023] If the parent node of this leaf node has a deconstruction direction, its deconstruction direction is the same as that of its parent node;
[0024] If the parent node of this leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis, or along the negative semi-axis, or along both the positive and negative semi-axis.
[0025] Furthermore, the calculation of the deconstruction distance of the leaf node at this level includes:
[0026] The leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups;
[0027] The components of the distances from the leaf nodes in the positive deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order, and the components of the distances from the leaf nodes in the negative deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order;
[0028] Calculate the distance component of the leaf node moving out of the AABB bounding box of the entire assembly before deconstruction in the deconstruction direction, and record the distance component as the first moving distance;
[0029] In a positive deconstruction group or a negative deconstruction group, all leaf nodes are traversed in ascending order to determine whether the first moving distances of all leaf nodes overlap with the first moving distance of the current leaf node. If overlap occurs, the current leaf node is moved to the leaf node that overlaps with the current leaf node, and the distance that the current leaf node needs to move after the leaf node that overlaps with the current leaf node is recorded as the overlap-free moving distance; the maximum value of all overlap-free moving distances is recorded as the second moving distance;
[0030] Detect whether all leaf nodes at this level have a parent node. If so, record the extension distance of the parent node as the fourth moving distance.
[0031] The deconstruction distance of a leaf node is determined as follows:
[0032] The deconstruction distance of a leaf node = first moving distance + second moving distance + fourth moving distance.
[0033] Furthermore, the maximum deconstruction distance at this level is determined as follows:
[0034] If there is only a forward deconstruction group, the maximum deconstruction distance of the forward deconstruction group is determined as the maximum deconstruction distance in the current level;
[0035] If there is only a negative deconstruction group, the maximum deconstruction distance of the negative deconstruction group is determined as the maximum deconstruction distance in the current level;
[0036] If there are both positive deconstruction groups and negative deconstruction groups, the maximum deconstruction distance of the positive deconstruction group and the maximum deconstruction distance of the negative deconstruction group are respectively determined as the maximum positive deconstruction distance and negative deconstruction distance in this level.
[0037] Further, the second type of operation is performed on all non-leaf nodes in the non-leaf node group of the current level to determine the expansion distance, including:
[0038] Determine the deconstruction direction of all non-leaf nodes;
[0039] The maximum deconstruction distance of the leaf node of the current level in the deconstruction direction is used as the expansion distance of the non-leaf node of the current level.
[0040] According to another aspect of an embodiment of the present disclosure, a storage medium is further provided, the storage medium including a stored program, wherein when the program is running, a processor executes any one of the methods described above.
[0041] According to another aspect of the embodiment of the present disclosure, a model deconstruction device is also provided, including:
[0042] A level determination module, configured to determine a deconstruction level specified by a user;
[0043] A deconstruction distance calculation module is configured to perform a deconstruction operation on each level from the first level to the deconstruction level specified by the user, and determine the deconstruction distance of all leaf nodes in each level;
[0044] The moving distance calculation module is configured to, for each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain a distance to be moved;
[0045] A deconstruction graph determination module is configured to add the position of each leaf node to the distance to be moved to obtain a deconstruction graph;
[0046] Wherein, the deconstruction ratio is preset.
[0047] According to another aspect of the embodiment of the present disclosure, a model deconstruction device is also provided, including:
[0048] Processor; and
[0049] A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps:
[0050] Determine the user-specified deconstruction level;
[0051] Starting from the first level to the deconstruction level specified by the user, performing a deconstruction operation on each level, and determining the deconstruction distance of all leaf nodes in each level;
[0052] For each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain the distance to be moved;
[0053] For each leaf node, add the position of the leaf node and the distance to be moved to obtain a deconstructed graph;
[0054] Wherein, the deconstruction ratio is preset.
[0055] In the disclosed embodiment, starting from the first level to the deconstruction level specified by the user, the deconstruction operation is performed on each level, and the model tree and AABB bounding box are used for calculation, which has a small amount of calculation and high efficiency, and saves the large performance consumption used when calculating the OBB bounding box. In terms of effect, it is equivalent to the explosion effect presented by the OBB bounding box algorithm, thereby achieving the reduction of calculation amount and improvement of calculation efficiency without reducing the effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0057] Figure 1 is a schematic diagram of a model deconstruction method flow provided by an embodiment of the present invention;
[0058] Figure 2 is a schematic diagram of a model tree structure provided by an embodiment of the present invention;
[0059] Figure 3 It is a schematic diagram of a process for determining the deconstruction distances of all nodes in each level provided by an embodiment of the present invention;
[0060] Figure 4 This is a schematic diagram of the first type of operation flow provided by an embodiment of the present invention;
[0061] Figure 5 This is a schematic diagram of the second type of operation flow provided by an embodiment of the present invention;
[0062] Figure 6 is a schematic diagram of a model deconstruction device provided by an embodiment of the present invention;
[0063] Figure 7 It is a schematic diagram of another model deconstruction device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only embodiments of a part of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure.
[0065] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0066] In the present invention, the model deconstruction algorithm is also called the model explosion algorithm, and the generated deconstruction diagram is also called the explosion diagram. In this application, explosion and deconstruction have the same meaning. The algorithms used in the prior art include an automatic generation of hierarchical explosion algorithms, an automatic generation algorithm of hierarchical explosion diagrams based on assembly constraints and collision detection, an explosion diagram generation algorithm based on an ant colony algorithm, etc., which are relatively efficient. However, for some users, these algorithms are relatively special in implementation and are based on OBB bounding boxes, and the calculation of OBB bounding boxes is relatively complicated. Compared with the complicated calculation process of OBB bounding boxes, the calculation of the AABB bounding box of the present invention simplifies the calculation process and can be close to the effect of the OBB bounding box, reducing the calculation cost and complexity, and achieving an overall improvement.
[0067] The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0068] Example 1
[0069] According to this embodiment, a model deconstruction method embodiment is provided for deconstruction in a single axis direction, such as Figure 1 As shown, including:
[0070] S101, determining a deconstruction level specified by a user;
[0071] In this step, after the user determines the deconstruction level, it serves as input information. The user can specify a specific level of the model tree for deconstruction. Figure 2 The model tree including five levels is shown, and the user can designate the third level to be deconstructed, or designate the second level to be deconstructed, or designate the fifth level to be deconstructed.
[0072] It should be noted that the deconstruction level specified by the user shall not exceed the number of levels of the model tree.
[0073] S102, starting from the first level to the deconstruction level specified by the user, performing a deconstruction operation on each level, and determining the deconstruction distance of all leaf nodes in each level;
[0074] As a preferred example, if the current level is not the level specified by the user, all nodes in this level need to be divided into leaf node groups and non-leaf node groups, and the parent-child relationship between all nodes in this level and their parent level nodes needs to be recorded. Figure 3 As shown, including S301 to S306:
[0075] S301, determine whether the current level is a deconstruction level specified by the user. If yes, execute S302, otherwise execute S304.
[0076] S302: Determine that all nodes at this level are leaf nodes.
[0077] If this level is a user-specified level, leaf nodes and non-leaf nodes are no longer distinguished and are all processed as leaf nodes. Figure 2 As shown, if the user specifies the 4th level, all nodes J, K, L, and M of the 4th level are determined as leaf nodes.
[0078] S303: Perform the first type of operation on all leaf nodes to determine the deconstruction distance.
[0079] S304: Divide all nodes of this level into leaf node groups and non-leaf node groups, and record the parent-child relationship between all nodes of this level and their parent nodes.
[0080] In this step, if the current level is not the level specified by the user, all nodes in this level are divided into leaf node groups and non-leaf node groups, and the parent-child relationship between each node and its parent node is recorded. Figure 2 As shown in the figure, if the user specifies the level as level 4, the 4 nodes B, C, D, and E at level 2 are divided into leaf node groups (C and E) and non-leaf node groups (B and D). Similarly, the 4 nodes F, G, H, and I at level 3 are divided into leaf node groups (F and H) and non-leaf nodes (G and I).
[0081] S305: Perform the first type of operation on all leaf nodes in the leaf node group of the current level to determine the deconstruction distance.
[0082] S306: Perform the second type of operation on all non-leaf nodes in the non-leaf node group at this level to determine the expansion distance.
[0083] Among them, the first type of operations and the second type of operations are not exactly the same.
[0084] As a preferred example, in S305, performing the first type of operation on all leaf nodes in the leaf node group of the current level to determine the deconstruction distance includes:
[0085] Determine the deconstruction direction of all leaf nodes;
[0086] Calculate the deconstruction distance of the leaf nodes at this level;
[0087] After calculating the deconstruction distances of all leaf nodes in this level, record the maximum deconstruction distance in this level.
[0088] As a preferred example, determining the deconstruction direction of all leaf nodes includes:
[0089] If the parent node of this leaf node has a deconstruction direction, its deconstruction direction is the same as that of its parent node;
[0090] If the parent node of this leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis, or along the negative semi-axis, or along both the positive and negative semi-axis.
[0091] As a preferred example, calculating the deconstruction distance of the leaf node at this level includes:
[0092] The leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups;
[0093] The components of the distances from the leaf nodes in the positive deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order, and the components of the distances from the leaf nodes in the negative deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order;
[0094] Calculate the distance component of the leaf node moving out of the AABB bounding box of the entire assembly before deconstruction in the deconstruction direction, and record the distance component as the first moving distance;
[0095] In a positive deconstruction group or a negative deconstruction group, all leaf nodes are traversed in ascending order to determine whether the first moving distances of all leaf nodes overlap with the first moving distance of the current leaf node. If overlap occurs, the current leaf node is moved to the leaf node that overlaps with the current leaf node, and the distance that the current leaf node needs to move after the leaf node that overlaps with the current leaf node is recorded as the overlap-free moving distance; the maximum value of all overlap-free moving distances is recorded as the second moving distance;
[0096] Detect whether all leaf nodes at this level have a parent node. If so, record the extension distance of the parent node as the fourth moving distance.
[0097] The deconstruction distance of a leaf node is determined as follows:
[0098] The deconstruction distance of a leaf node = first moving distance + second moving distance + fourth moving distance.
[0099] Combine the following Figure 4 , further describe the first type of operation, such as Figure 4 As shown, including S401 to S407:
[0100] S401, determine the deconstruction direction of all leaf nodes. That is, if the parent node of this leaf node has a deconstruction direction, then its deconstruction direction is the same as the deconstruction direction of its parent node; if the parent node of this leaf node does not have a deconstruction direction, then the user determines whether to deconstruct along the positive semi-axis, or deconstruct along the negative semi-axis, or deconstruct along both the positive and negative semi-axis.
[0101] S402: Leaf nodes with positive deconstruction directions are grouped into a positive deconstruction group, and leaf nodes with negative deconstruction directions are grouped into a negative deconstruction group.
[0102] S403, sort the components of the leaf nodes in the positive deconstruction group from the deconstruction center on the deconstruction axis in ascending order, and sort the components of the leaf nodes in the negative deconstruction group from the deconstruction center on the deconstruction axis in ascending order. In this step, all leaf nodes in the same deconstruction direction (a positive group and a negative group) in this level with respect to the components of the deconstruction center on the deconstruction axis (which may be negative values) are sorted in ascending order, and the sorted order is also the calculation order when calculating this leaf node array.
[0103] S404, calculate the distance component of the leaf node moving out of the AABB bounding box of the entire assembly before deconstruction in the deconstruction direction, and record the distance component as the first moving distance. In this step, the distance of the node moving out of the AABB bounding box of the entire assembly before explosion is calculated (calculated according to the explosion direction), and record the distance as removeDistance, i.e., the first moving distance.
[0104] S405. In a positive deconstruction group or a negative deconstruction group, traverse all leaf nodes in ascending order, and determine whether the first moving distances of all leaf nodes overlap with the first moving distance of the current leaf node. If overlap occurs, move the current leaf node to the leaf node that overlaps with the current leaf node, and record the distance that the current leaf node needs to move after the leaf node that overlaps with the current leaf node as the moving distance to resolve the overlap.
[0105] That is to say, in this step, all leaf nodes that have been previously calculated and whose explosion distances have been calculated are traversed to detect whether there may be a "collision" with this node in the explosion axis direction (whether there will be overlap according to the AABB bounding box calculation, and if there is an overlap, it is a "collision"). If it is found that there will be a "collision" with a certain node, the node being calculated needs to be "moved" to the back of the node where the "collision" occurs, and the distance that needs to be moved after the current node is moved to the back of the "collision" node is recorded as the release movement distance, and the release movement distance is recorded as extraDistance. During the entire traversal process, a maximum extraDistance, that is, the second movement distance, needs to be recorded.
[0106] It should be noted that when only one node collides with this node (i.e., the current leaf node), the distance that needs to be moved to move this node behind the node that collides is the second moving distance. When multiple nodes collide with this node, the maximum overlapping removal moving distance of all leaf nodes that overlap with the current leaf node is the second moving distance. For example, if the current leaf node is node F, and there is only one leaf node that overlaps with node F (such as node B), the second moving distance refers to the width of node B in the deconstruction direction. By adding this additional distance, it is used to ensure that node F moves behind node B. Similarly, if there are multiple leaf nodes that overlap with node F (such as nodes B, C, D, and E), it is necessary to ensure that node F moves to the back of the farthest node among these four nodes (nodes B, C, D, and E). Therefore, the maximum width of these four nodes in the deconstruction direction is the second moving distance.
[0107] S406, check whether all leaf nodes in this level have a parent node, if there is a parent node, record the extension distance of the parent node as the fourth moving distance. In this step, it is necessary to check whether this node has a parent node, if there is a parent node, then it is necessary to add a distance that its parent node moves out of the leaf node array in the parent layer in the parent layer, that is, the extension distance, and record it as distance, that is, the fourth moving distance.
[0108] S407. Determine the deconstruction distance of the leaf node in the following manner: the deconstruction distance of the leaf node=the first moving distance+the second moving distance+the fourth moving distance.
[0109] Taking the above example of S401 to S406 as an example, the deconstruction distance of the leaf node is calculated as: removeDistance+extraDistance+distance, that is, the first moving distance+the second moving distance+the fourth moving distance.
[0110] As an optional example, after calculating the deconstruction distances of all leaf nodes in the current level, determining the maximum deconstruction distance in the current level includes:
[0111] If there is only a forward deconstruction group, the maximum deconstruction distance of the forward deconstruction group is determined as the maximum deconstruction distance in the current level;
[0112] If there is only a negative deconstruction group, the maximum deconstruction distance of the negative deconstruction group is determined as the maximum deconstruction distance in the current level;
[0113] If there are both positive deconstruction groups and negative deconstruction groups, the maximum deconstruction distance of the positive deconstruction group and the maximum deconstruction distance of the negative deconstruction group are respectively determined as the maximum positive deconstruction distance and negative deconstruction distance in this level.
[0114] That is to say, after calculating the deconstruction distances of all leaf nodes in this layer, it is necessary to record the maximum deconstruction distance in this layer, and record it according to the deconstruction direction. If it is along one axis, there is a maximum deconstruction distance. If there are both positive and negative semi-axis, then the maximum deconstruction distances of the positive and negative semi-axis are recorded respectively, recorded as maxDistance.
[0115] As an optional example, in S306, the second type of operation is performed on all non-leaf nodes in the non-leaf node group of the current level to determine the extension distance, including:
[0116] Determine the deconstruction direction of all non-leaf nodes;
[0117] The maximum deconstruction distance of the leaf node of the current level in the deconstruction direction is used as the expansion distance of the non-leaf node of the current level.
[0118] It should be noted that in the present invention, non-leaf nodes do not move, and determining the expansion distance of the non-leaf nodes serves the leaf nodes under the non-leaf nodes, that is, the expansion distance of the non-leaf nodes is used as the fourth moving distance of all the leaf nodes under it, and as one of the inputs for calculating the deconstruction distance of all the leaf nodes under it.
[0119] As an optional example, determining the deconstruction direction of all non-leaf nodes includes:
[0120] If the parent node of this non-leaf node has a deconstruction direction, its deconstruction direction is the same as that of its parent node;
[0121] If the parent node of this non-leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis or along the negative semi-axis, or along both the positive and negative semi-axis.
[0122] As an optional example, calculating the expansion distance of all non-leaf nodes at this level includes:
[0123] The non-leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the non-leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups;
[0124] The components of the distances of the non-leaf nodes in the positive deconstruction group from the explosion center on the explosion axis are sorted in ascending order, and the components of the distances of the non-leaf nodes in the negative deconstruction group from the explosion center on the explosion axis are sorted in ascending order;
[0125] The maximum deconstruction distance of the leaf node of the current level in the deconstruction direction is used as the expansion distance of the non-leaf node of the current level.
[0126] Combine the following Figure 5 , the step of performing the second type of operation on all non-leaf nodes in the non-leaf node group of the current level to determine the extension distance in S306 is further described as follows: Figure 5 As shown, including S501 to S503:
[0127] S501. Determine the deconstruction direction of all non-leaf nodes, that is, if the parent node of this non-leaf node has a deconstruction direction, then its deconstruction direction is the same as the deconstruction direction of its parent node; if the parent node of this non-leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis or along the negative semi-axis, or along both the positive and negative semi-axis.
[0128] S502: non-leaf nodes with positive deconstruction directions are grouped into a positive deconstruction group, and non-leaf nodes with negative deconstruction directions are grouped into a negative deconstruction group.
[0129] The components of the distances from the non-leaf nodes in the positive deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order, and the components of the distances from the non-leaf nodes in the negative deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order. In other words, the components (which may be negative values) of the distances from the non-leaf nodes in the same deconstruction direction (a positive group and a negative group) on the deconstruction axis of this level are sorted in ascending order, and the order after ascending sorting is also the calculation order when calculating this non-leaf node array.
[0130] S503, taking the maximum deconstruction distance of the leaf node of the current level in the deconstruction direction as the extended distance of the non-leaf nodes of the current level. That is to say, when calculating the leaf nodes in the current layer in S305, the maximum deconstruction distance in the current level has been recorded and recorded as maxDistance, and this value is recorded for each non-leaf node as the extended distance of each non-leaf node. It should be noted that the values should be assigned according to the explosion direction. The maximum deconstruction distance of the leaf nodes in the positive deconstruction group is assigned to the extended distance of the non-leaf nodes in the positive deconstruction group, and the maximum deconstruction distance of the leaf nodes in the negative deconstruction group is assigned to the extended distance of the non-leaf nodes in the negative deconstruction group.
[0131] S103: For each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain a distance to be moved.
[0132] That is to say, after all levels are traversed and the loop is exited, the leaf nodes in the model tree have their own deconstruction distance. The deconstruction ratio (also called explosion degree, range is non-negative) of this deconstruction is subtracted from the previous deconstruction ratio, recorded as sub, and sub multiplied by the explosion distance of the node is recorded as the distance to be moved. The deconstruction ratio is pre-set, and the user can set the deconstruction ratio as needed.
[0133] For example, if a leaf node needs to move 100 after complete deconstruction, then during deconstruction, the ratio value starts from 0. For example, if the ratio value is 0.1 at the first moment and 0.2 at the second moment, then the distance moved by the leaf node at the second moment should be (0.2-0.1)×100 from the first moment, and so on. When the moving ratio value reaches 1, the distance moved by the node compared to the initial position (that is, when the moment is 0) is 100.
[0134] S104: For each leaf node, add the position of the leaf node and the distance to be moved to obtain a deconstruction graph.
[0135] In this step, the position of the leaf node is added with the distance to be moved to complete the deconstruction operation and form a corresponding deconstruction diagram (also called an exploded diagram).
[0136] In the present invention, it should be noted that when the distance to be moved is 1, all the partial assemblies just do not "collide" in the axial direction.
[0137] Compared with the existing technology, the model deconstruction method of the present invention first performs calculations based on the model tree and the AABB bounding box, with small amount of calculation and high efficiency, eliminating the large performance consumption that may be used when calculating the OBB bounding box, but the effect is equivalent to the explosion effect presented by the OBB bounding box algorithm, thereby improving the calculation efficiency.
[0138] Example 2
[0139] Based on the same inventive concept, according to the second aspect of this embodiment, this embodiment provides a model deconstruction diagram in a multi-axis scenario. For each axis, solving the deconstruction distance on the axis is the same as in embodiment 1, and will not be repeated here.
[0140] Taking the x-axis and y-axis as an example, the deconstruction process on multiple axes is as follows:
[0141] 1. According to the deconstruction distance calculation process on a single axis in Example 1, determine the deconstruction distance of the x-axis, denoted as a;
[0142] 2. According to the deconstruction distance calculation process on a single axis in Example 1, determine the deconstruction distance of the y-axis, denoted as b;
[0143] 3. Based on a and b, determine the deconstruction distance of the assembly in the xy coordinate system;
[0144] 4. Make a difference between the current deconstruction ratio (in the range of non-negative numbers) and the previous deconstruction ratio, recorded as sub, and multiply sub by the deconstruction distance of the node as the distance to be moved. Add the position of this node to the distance to be moved to complete the deconstruction operation and form the corresponding deconstruction graph.
[0145] Example 3
[0146] Based on the same inventive concept, according to the third aspect of this embodiment, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is run, the processor executes the model deconstruction method of the above embodiment 1 or embodiment 2.
[0147] Example 4
[0148] Based on the same inventive concept, according to the fourth aspect of this embodiment, Figure 6 The model deconstruction device 600 according to the fourth aspect of this embodiment is shown, and the device 600 corresponds to the model deconstruction method according to the first aspect of embodiment 1. Figure 6 As shown, the device 600 includes:
[0149] A level determination module 601 is configured to determine a deconstruction level specified by a user;
[0150] A deconstruction distance calculation module 602 is configured to perform a deconstruction operation on each level from the first level to the deconstruction level specified by the user, and determine the deconstruction distance of all leaf nodes in each level;
[0151] The moving distance calculation module 603 is configured to, for each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain a distance to be moved;
[0152] The deconstruction graph determination module 604 is configured to add the position of each leaf node and the distance to be moved to obtain a deconstruction graph.
[0153] Wherein, the deconstruction ratio is preset.
[0154] As an optional example, the deconstruction distance calculation module 602 is further configured to perform a deconstruction operation on each level, including:
[0155] If this level is a deconstruction level specified by the user, all nodes in this level are determined to be leaf nodes. If this level is not a deconstruction level specified by the user, all nodes in this level are divided into leaf node groups and non-leaf node groups, and the parent-child relationship between all nodes in this level and their parent nodes is recorded.
[0156] Perform the first type of operation on all leaf nodes in the leaf node group of this level to determine the deconstruction distance;
[0157] Perform the second type of operation on all non-leaf nodes in the non-leaf node group of this level to determine the expansion distance;
[0158] The first type of operation and the second type of operation are not completely the same.
[0159] As an optional example, the deconstruction distance calculation module 602 is further configured to perform the first type of operation on all leaf nodes in the leaf node group of the current level to determine the deconstruction distance, including:
[0160] Determine the deconstruction direction of all leaf nodes;
[0161] Calculate the deconstruction distance of the leaf nodes at this level;
[0162] After calculating the deconstruction distances of all leaf nodes in this level, record the maximum deconstruction distance in this level.
[0163] As an optional example, the deconstruction distance calculation module 602 is further configured to determine the deconstruction directions of all leaf nodes, including:
[0164] If the parent node of this leaf node has a deconstruction direction, its deconstruction direction is the same as that of its parent node;
[0165] If the parent node of this leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis, or along the negative semi-axis, or along both the positive and negative semi-axis.
[0166] As an optional example, the deconstruction distance calculation module 602 is further configured to calculate the deconstruction distance of the leaf node at this level, including:
[0167] The leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups;
[0168] The components of the distances from the leaf nodes in the positive deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order, and the components of the distances from the leaf nodes in the negative deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order;
[0169] Calculate the distance component of the leaf node moving out of the AABB bounding box of the entire assembly before deconstruction in the deconstruction direction, and record the distance component as the first moving distance;
[0170] In a positive deconstruction group or a negative deconstruction group, all leaf nodes are traversed in ascending order to determine whether the first moving distances of all leaf nodes overlap with the first moving distance of the current leaf node. If overlap occurs, the current leaf node is moved to the leaf node that overlaps with the current leaf node, and the distance that the current leaf node needs to move to the leaf node that overlaps with the current leaf node is recorded as the overlap-free moving distance; the maximum value of all overlap-free moving distances is recorded as the second moving distance;
[0171] Detect whether all leaf nodes at this level have a parent node. If so, record the extension distance of the parent node as the fourth moving distance.
[0172] The deconstruction distance of a leaf node is determined as follows:
[0173] The deconstruction distance of a leaf node = first moving distance + second moving distance + fourth moving distance.
[0174] As an optional example, the deconstruction distance calculation module 602 is further configured to record the maximum deconstruction distance in the current level after calculating the deconstruction distances of all leaf nodes in the current level, including:
[0175] If there is only a forward deconstruction group, the maximum deconstruction distance of the forward deconstruction group is determined as the maximum deconstruction distance in the current level;
[0176] If there is only a negative deconstruction group, the maximum deconstruction distance of the negative deconstruction group is determined as the maximum deconstruction distance in the current level;
[0177] If there are both positive deconstruction groups and negative deconstruction groups, the maximum deconstruction distance of the positive deconstruction group and the maximum deconstruction distance of the negative deconstruction group are respectively determined as the maximum positive deconstruction distance and negative deconstruction distance in this level.
[0178] As an optional example, the deconstruction distance calculation module 602 is further configured to perform a second type of operation on all non-leaf nodes in the non-leaf node group of the current level to determine the extended distance, including:
[0179] Determine the deconstruction direction of all non-leaf nodes;
[0180] The maximum deconstruction distance of the leaf node of the current level in the deconstruction direction is used as the expansion distance of the non-leaf node of the current level.
[0181] As an optional example, the deconstruction distance calculation module 602 is further configured to determine the deconstruction directions of all non-leaf nodes, including:
[0182] If the parent node of this non-leaf node has a deconstruction direction, its deconstruction direction is the same as that of its parent node;
[0183] If the parent node of this non-leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis or along the negative semi-axis, or along both the positive and negative semi-axis.
[0184] As an optional example, the deconstruction distance calculation module 602 is further configured to calculate the extended distances of all non-leaf nodes at the current level, including:
[0185] The non-leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the non-leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups;
[0186] The components of the distances from the non-leaf nodes in the positive deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order, and the components of the distances from the non-leaf nodes in the negative deconstruction group to the deconstruction center on the explosion axis are sorted in ascending order;
[0187] The maximum deconstruction distance of the leaf nodes in this level in the deconstruction direction is used as the expansion distance of the non-leaf nodes.
[0188] It should be noted that the level determination module 601 provided in this embodiment can implement all the method steps of S101 in Example 1, solve the same technical problems, and achieve the same technical effects, and will not be repeated here.
[0189] It should be noted that the deconstructed distance calculation module 602 provided in this embodiment can implement all the method steps of S102 in Example 1, solve the same technical problems, and achieve the same technical effects, which will not be described in detail here.
[0190] It should be noted that the moving distance calculation module 603 provided in this embodiment can implement all the method steps of S103 in Example 1, solve the same technical problems, and achieve the same technical effects, which will not be described in detail here.
[0191] It should be noted that the deconstruction graph determination module 604 provided in this embodiment can implement all the method steps of S104 in Example 1, solve the same technical problems, and achieve the same technical effects, and will not be repeated here.
[0192] Compared with the existing technology, the model deconstruction device of the present invention first performs calculations based on the model tree and the AABB bounding box, with small calculation amount and high efficiency, eliminating the large performance consumption that may be used when calculating the OBB bounding box, but the effect is equivalent to the explosion effect presented by the OBB bounding box algorithm, thereby improving the calculation efficiency.
[0193] Example 5
[0194] Based on the same inventive concept, according to the fifth aspect of this embodiment, Figure 7 The model deconstruction device 700 according to the fifth aspect of this embodiment is shown, and the device 700 corresponds to the model deconstruction method according to the first aspect of embodiment 1. Figure 7 As shown, the device 700 includes:
[0195] Processor 710; and
[0196] The memory 720 is connected to the processor 710 and is used to provide the processor 710 with instructions for processing the following processing steps:
[0197] Determine the user-specified deconstruction level;
[0198] Starting from the first level to the deconstruction level specified by the user, performing a deconstruction operation on each level, and determining the deconstruction distance of all leaf nodes in each level;
[0199] For each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain the distance to be moved;
[0200] For each leaf node, the position of the leaf node and the distance to be moved are added to obtain a deconstructed graph;
[0201] Wherein, the deconstruction ratio is preset.
[0202] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0203] Perform deconstruction operations on each level, including:
[0204] If this level is a deconstruction level specified by the user, all nodes in this level are determined to be leaf nodes. If this level is not a deconstruction level specified by the user, all nodes in this level are divided into leaf node groups and non-leaf node groups, and the parent-child relationship between all nodes in this level and their parent nodes is recorded.
[0205] Perform the first type of operation on all leaf nodes in the leaf node group of this level to determine the deconstruction distance;
[0206] Perform the second type of operation on all non-leaf nodes in the non-leaf node group of this level to determine the expansion distance;
[0207] The first type of operation and the second type of operation are not completely the same.
[0208] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0209] Perform the first type of operation on all leaf nodes in the leaf node group of this level to determine the maximum deconstruction distance, including:
[0210] Determine the deconstruction direction of all leaf nodes;
[0211] Calculate the deconstruction distance of the leaf nodes at this level;
[0212] After calculating the deconstruction distances of all leaf nodes in this level, record the maximum deconstruction distance in this level.
[0213] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0214] Determine the deconstruction direction of all leaf nodes, including:
[0215] If the parent node of this leaf node has a deconstruction direction, its deconstruction direction is the same as the deconstruction distance of its parent node;
[0216] If the parent node of this leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis, or along the negative semi-axis, or along both the positive and negative semi-axis.
[0217] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0218] Calculate the deconstruction distance of the leaf nodes at this level, including:
[0219] The leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups;
[0220] The components of the distances from the leaf nodes in the positive deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order, and the components of the distances from the leaf nodes in the negative deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order;
[0221] Calculate the distance component of the leaf node moving out of the AABB bounding box of the entire assembly before deconstruction in the deconstruction direction, and record the distance component as the first moving distance;
[0222] In a positive deconstruction group or a negative deconstruction group, all leaf nodes are traversed in ascending order to determine whether the first moving distances of all leaf nodes overlap with the first moving distance of the current leaf node. If overlap occurs, the current leaf node is moved to the leaf node that overlaps with the current leaf node, and the distance that the current leaf node needs to move after the leaf node that overlaps with the current leaf node is recorded as the overlap-free moving distance; the maximum value of all overlap-free moving distances is recorded as the second moving distance;
[0223] Detect whether all leaf nodes at this level have a parent node. If so, record the extension distance of the parent node as the fourth moving distance.
[0224] The deconstruction distance of a leaf node is determined as follows:
[0225] The deconstruction distance of a leaf node = first moving distance + second moving distance + fourth moving distance.
[0226] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0227] After calculating the deconstruction distances of all leaf nodes in this level, determine the maximum deconstruction distance in this level, including:
[0228] If there is only a forward deconstruction group, the maximum deconstruction distance of the forward deconstruction group is determined as the maximum deconstruction distance in the current level;
[0229] If there is only a negative deconstruction group, the maximum deconstruction distance of the negative deconstruction group is determined as the maximum deconstruction distance in the current level;
[0230] If there are both positive deconstruction groups and negative deconstruction groups, the maximum deconstruction distance of the positive deconstruction group and the maximum deconstruction distance of the negative deconstruction group are respectively determined as the maximum positive deconstruction distance and negative deconstruction distance in this level.
[0231] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0232] The second type of operation is performed on all non-leaf nodes in the non-leaf node group of this level to determine the expansion distance, including:
[0233] Determine the deconstruction direction of all non-leaf nodes;
[0234] The maximum deconstruction distance of the leaf node of the current level in the deconstruction direction is used as the expansion distance of the non-leaf node of the current level.
[0235] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0236] Determine the deconstruction direction of all non-leaf nodes, including:
[0237] If the parent node of this non-leaf node has a deconstruction direction, its deconstruction direction is the same as that of its parent node;
[0238] If the parent node of this non-leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis or along the negative semi-axis, or along both the positive and negative semi-axis.
[0239] As an optional example, the memory 720 is further configured to provide the processor 710 with instructions for processing the following processing steps:
[0240] Calculate the expansion distance of all non-leaf nodes at this level, including:
[0241] The non-leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the non-leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups;
[0242] The components of the distances of the non-leaf nodes in the positive deconstruction group from the explosion center on the explosion axis are sorted in ascending order, and the components of the distances of the non-leaf nodes in the negative deconstruction group from the explosion center on the explosion axis are sorted in ascending order;
[0243] The maximum deconstruction distance of the leaf node of the current level in the deconstruction direction is used as the expansion distance of the non-leaf node of the current level.
[0244] It should be noted that this embodiment can implement all the method steps in Example 1 or Example 2, solve the same technical problems, and achieve the same technical effects, which will not be repeated here.
[0245] It should be noted that, in the present invention, the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0246] The method embodiment provided in this embodiment can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Figure 7 FIG. 1 shows a hardware structure block diagram of a computing device for implementing a model deconstruction method. Figure 7As shown, the computing device may include one or more processors 710 (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), and the computing device may also include a memory for storing data, a transmission device for communication functions, and an input / output interface. The memory, the transmission device, and the input / output interface are connected to the processor via a bus. In addition, it may also include: a display, a keyboard, and a cursor control device connected to the input / output interface. It can be understood by those skilled in the art that Figure 7 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 7 More or fewer components as shown, or with Figure 7 Different configurations shown.
[0247] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computing device. As involved in the embodiments of the present disclosure, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0248] The memory 720 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the model deconstruction method in Embodiment 1 or Embodiment 2 of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the model deconstruction method of the above-mentioned application is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0249] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0250] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0251] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0252] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0253] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0254] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0255] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0256] If the integrated unit is implemented in the form of 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 the present invention, 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0257] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A model deconstruction method for deconstructing an assembly, characterized in that: include: Determine the user-specified deconstruction level; Starting from the first level to the deconstruction level specified by the user, performing a deconstruction operation on each level, and determining the deconstruction distance of all leaf nodes in each level; For each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain the distance to be moved; For each leaf node, the position of the leaf node and the distance to be moved are added to obtain an exploded diagram; Wherein, the deconstruction ratio is preset; The leaf nodes are nodes in the deconstruction level.
2. The method according to claim 1, characterized in that: The deconstruction operation performed on each level includes: If this level is a deconstruction level specified by the user, all nodes in this level are determined to be leaf nodes. If this level is not a deconstruction level specified by the user, all nodes in this level are divided into leaf node groups and non-leaf node groups, and the parent-child relationship between all nodes in this level and their parent nodes is recorded. Perform the first type of operation on all leaf nodes in the leaf node group of this level to determine the deconstruction distance; Perform the second type of operation on all non-leaf nodes in the non-leaf node group of this level to determine the expansion distance; The first type of operation and the second type of operation are not completely the same.
3. The method according to claim 2, characterized in that The first type of operation is performed on all leaf nodes in the leaf node group of the current level to determine the deconstruction distance, including: Determine the deconstruction direction of all leaf nodes; Calculate the deconstruction distance of the leaf nodes at this level; After calculating the deconstruction distances of all leaf nodes in this level, record the maximum deconstruction distance in this level.
4. The method according to claim 3, characterized in that Determining the deconstruction direction of all leaf nodes includes: If the parent node of this leaf node has a deconstruction direction, its deconstruction direction is the same as that of its parent node; If the parent node of this leaf node has no deconstruction direction, the user determines whether to deconstruct along the positive semi-axis, or along the negative semi-axis, or along both the positive and negative semi-axis.
5. The method according to claim 3, characterized in that: The calculation of the deconstruction distance of the leaf node at this level includes: The leaf nodes with positive deconstruction directions are grouped into positive deconstruction groups, and the leaf nodes with negative deconstruction directions are grouped into negative deconstruction groups; The components of the distances from the leaf nodes in the positive deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order, and the components of the distances from the leaf nodes in the negative deconstruction group to the deconstruction center on the deconstruction axis are sorted in ascending order; Calculate the distance component of the leaf node moving out of the AABB bounding box of the entire assembly before deconstruction in the deconstruction direction, and record the distance component as the first moving distance; In a positive deconstruction group or a negative deconstruction group, all leaf nodes are traversed in ascending order to determine whether the first moving distances of all leaf nodes overlap with the first moving distance of the current leaf node. If overlap occurs, the current leaf node is moved to the leaf node that overlaps with the current leaf node, and the distance that the current leaf node needs to move after the leaf node that overlaps with the current leaf node is recorded as the overlap-free moving distance; the maximum value of all overlap-free moving distances is recorded as the second moving distance; Detect whether all leaf nodes at this level have a parent node. If so, record the extension distance of the parent node as the fourth moving distance. The deconstruction distance of a leaf node is determined as follows: The deconstruction distance of a leaf node = first moving distance + second moving distance + fourth moving distance.
6. The method according to claim 3, characterized in that After calculating the deconstruction distances of all leaf nodes in this level, recording the maximum deconstruction distance in this level includes: If there is only a forward deconstruction group, the maximum deconstruction distance of the forward deconstruction group is determined as the maximum deconstruction distance in the current level; If there is only a negative deconstruction group, the maximum deconstruction distance of the negative deconstruction group is determined as the maximum deconstruction distance in the current level; If there are both positive deconstruction groups and negative deconstruction groups, the maximum deconstruction distance of the positive deconstruction group and the maximum deconstruction distance of the negative deconstruction group are respectively determined as the maximum positive deconstruction distance and negative deconstruction distance in this level.
7. The method according to claim 3, characterized in that The performing the second type of operation on all non-leaf nodes in the non-leaf node group of the current level to determine the expansion distance includes: Determine the deconstruction direction of all non-leaf nodes; The maximum deconstruction distance of the leaf node of the current level in the deconstruction direction is used as the expansion distance of the non-leaf node of the current level.
8. A storage medium, characterized in that: Applied to deconstructing an assembly, the storage medium includes a stored program, wherein when the program is run, the processor executes the method according to any one of claims 1 to 7.
9. A model deconstruction device, used for deconstructing an assembly, characterized in that: include: A level determination module, configured to determine a deconstruction level specified by a user; A deconstruction distance calculation module is configured to perform a deconstruction operation on each level from the first level to the deconstruction level specified by the user, and determine the deconstruction distance of all leaf nodes in each level; The moving distance calculation module is configured to, for each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain a distance to be moved; A deconstruction diagram determination module is configured to add, for each leaf node, the position of the leaf node and the distance to be moved to obtain an exploded diagram; Wherein, the deconstruction ratio is preset; The leaf nodes are nodes in the deconstruction level.
10. A model deconstruction device, used for deconstructing an assembly, characterized in that: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps: Determine the user-specified deconstruction level; Starting from the first level to the deconstruction level specified by the user, performing a deconstruction operation on each level, and determining the deconstruction distance of all leaf nodes in each level; For each leaf node, subtract the current deconstruction ratio from the previous deconstruction ratio to obtain a difference, and multiply the difference by the deconstruction distance to obtain the distance to be moved; For each leaf node, the position of the leaf node and the distance to be moved are added to obtain an exploded diagram; Wherein, the deconstruction ratio is preset; The leaf nodes are nodes in the deconstruction level.
Citation Information
Patent Citations
Method of automatically generating layering exploded view
CN104598683A
An explosion view generation method based on collision detection
CN109376383A
Rotating and turbine drive machines (last work)
CA2593551A1
Image processing and rendering method and system
CN117836810A