A building block linkage rotation method and device, a terminal device and a storage medium
Patent Information
- Application Number
- CN202611379145.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]在现有方案中,当用户选中积木和目标旋转轴进行旋转的过程中,仅能控制单块积木独立旋转,但是由于实际的物理场景中,积木之间是存在连接关系的,一个积木的旋转往往会带动其他关联积木联动旋转,现有积木类搭建平台无法反正模拟出上述联动旋转的效果,虚拟积木搭建的仿真效果较差
本发明提供了一种积木联动旋转方法、装置、终端设备及存储介质,上述方法在用户选定了目标积木和目标旋转轴后,以目标积木为初始节点遍历对应的连接图,在遍历连接图的过程中判断当前节点的所有连接边中,是否存在轴线与目标旋转轴在同一轴线上、当对应的连接模式为轴孔耦合的连接方式,且轴孔为无销孔限制的十字轴孔的连接边,如果有则说明该连接边两端的节点所对应的积木之间是死连接,一个转动必然带动另一个转动,则此时将当前节点所对应的积木作为可跟目标积木一同转动的积木,进而加入联动旋转集合后,紧接着将通过对应连接边与当前积木连接的相邻积木,作为下一次遍历的节点,进而将联动关系的判断扩散到下一节点。在遍历连接图后,在控制目标积木绕目标旋转轴旋转时,同步控制最终生成的联动旋转集合中的各个积木进行转动。通过实施本发明上述方案,可根据选定的目标积木和目标旋转轴,确定在目标积木绕目标旋转轴旋转时,其余会跟着一同旋转的关联积木,并在控制目标积木旋转时,带动关联积木一同转动,提高了虚拟积木搭建的仿真效果。
Smart Images

Figure CN122965155A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital model building, and in particular to a method, apparatus, terminal device, and storage medium for the linkage and rotation of building blocks. Background Technology
[0002] RoboBuilder is a platform for building block creations, allowing users to design and create models, mechanical structures, and dynamic shapes by assembling various block components.
[0003] In the existing solution, when the user selects a block and the target rotation axis to rotate, only the individual block can be controlled to rotate independently. However, in the actual physical scene, there are connections between blocks. The rotation of one block often causes other related blocks to rotate in tandem. The existing block building platform cannot simulate the above-mentioned linkage rotation effect, and the simulation effect of virtual block building is poor. Summary of the Invention
[0004] This invention provides a method, apparatus, terminal device, and storage medium for the linkage and rotation of building blocks, which can improve the simulation level of virtual building block construction.
[0005] An embodiment of the present invention provides a method for the coordinated rotation of building blocks, comprising: In the current block-building scenario, respond to the user's selected operation and determine the target block and the target rotation axis; Starting with the target block as the initial node, the connection graph corresponding to the current block building scene is traversed. Specifically, each block physically connected in the current block building scene is used as a node. A connection edge is constructed between any two physically connected blocks. The region corresponding to the connection point of each block is used as the feature region of each block. For each connection edge, the feature type, axis, pivot point, and connection mode between the two feature regions corresponding to the two ends of the connection edge are used as the edge attributes. The connection graph is constructed based on the nodes, the connection edges between nodes, and the corresponding edge attributes. During each traversal, obtain all current connected edges corresponding to the current node. For each current connected edge, determine the axis of the current connected edge based on the axis and axis point in the edge attribute. If it is determined that the axis of the current connection edge is on the same axis as the axis of the target rotation axis, the connection mode corresponding to the current connection edge is shaft-hole coupling, and the shaft hole is a cross shaft hole without pin hole restriction, the current block corresponding to the current node is added to the linkage rotation set, and the other node corresponding to the current connection edge is used as the node for the next traversal. Based on the linkage rotation set, when the target block rotates around the target rotation axis, the other related blocks in the linkage rotation set are controlled to rotate synchronously.
[0006] Furthermore, it also includes: during each traversal, when it is determined that the axis of the current connecting edge is not on the same axis as the axis of the target rotation axis, the current block corresponding to the current node is added to the linkage rotation set, and the other node corresponding to the current connecting edge is used as the node for the next traversal.
[0007] Furthermore, during each traversal, if it is determined that the axis of the current connecting edge is on the same axis as the axis of the target rotation axis, and the connection mode corresponding to the current connecting edge is pin-hole coupling, the current block corresponding to the current node is added to the linkage rotation set, the current connecting edge is used as a blocking edge, and the block corresponding to the other node of the current connecting edge is used as a non-associated rotation block and is not added to the linkage rotation set.
[0008] Furthermore, it also includes: during each traversal, if it is determined that the axis of the current connecting edge is on the same axis as the target rotation axis and the connection mode corresponding to the current connecting edge is not axis-hole coupling or pin-hole coupling, it is determined whether the axis point of the current connecting edge coincides with the axis point of the target rotation axis; if so, the current block corresponding to the current node is added to the linkage rotation set, the current connecting edge is used as a blocking edge, and the block corresponding to the other node of the current connecting edge is used as a non-associated rotation block and is not added to the linkage rotation set; if not, the current block corresponding to the current node is added to the linkage rotation set, and the other node corresponding to the current connecting edge is used as the node for the next traversal.
[0009] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments; One embodiment of the present invention provides a block linkage rotation device, including: a target selection module, a connection diagram traversal module, an axis determination module, a linkage rotation set generation module, and a rotation control module; The target selection module is used to respond to the user's selection operation in the current block building scenario and determine the target block and the target rotation axis. The connection graph traversal module is used to traverse the connection graph corresponding to the current block building scene, with the target block as the initial node. Specifically, it uses each block physically connected in the current block building scene as a node, constructs a connection edge between any two physically connected blocks, and uses the region corresponding to the connection point of each block as the feature region of each block. For each connection edge, the feature type, axis, pivot point, and connection mode between the two feature regions corresponding to the two ends of the connection edge are used as the edge attributes. The connection graph is constructed based on the nodes, the connection edges between nodes, and the corresponding edge attributes. The axis determination module is used to obtain all current connected edges corresponding to the current node during each traversal. For each current connected edge, the axis of the current connected edge is determined according to the axis and axis point in the edge attribute. The linkage rotation set generation module is used to add the current block corresponding to the current node to the linkage rotation set when it is determined that the axis of the current connection edge and the axis of the target rotation axis are on the same axis, the connection mode corresponding to the current connection edge is shaft hole coupling, and the shaft hole is a cross shaft hole without pin hole restriction. The module also uses the other node corresponding to the current connection edge as the node for the next traversal. The rotation control module is used to control the other associated blocks in the linkage rotation set to rotate synchronously when the target block rotates around the target rotation axis, according to the linkage rotation set.
[0010] Furthermore, the linkage rotation set generation module is also used to add the current block corresponding to the current node to the linkage rotation set when it is determined that the axis of the current connecting edge and the axis of the target rotation axis are not on the same axis during each traversal, and to use the other node corresponding to the current connecting edge as the node for the next traversal.
[0011] Furthermore, the linkage rotation set generation module is also used to, during each traversal, if it is determined that the axis of the current connecting edge and the axis of the target rotation axis are on the same axis, and the connection mode corresponding to the current connecting edge is pin-hole coupling, add the current block corresponding to the current node to the linkage rotation set, treat the current connecting edge as a blocking edge, and treat the block corresponding to the other node of the current connecting edge as a non-associated rotation block, and not add it to the linkage rotation set.
[0012] Furthermore, the linkage rotation set generation module is also used during traversal to determine whether the axis point of the current connecting edge coincides with the axis point of the target rotation axis, provided that the axis of the current connecting edge is on the same axis as the target rotation axis and the connection mode corresponding to the current connecting edge is not axis-hole coupling or pin-hole coupling. If yes, the current block corresponding to the current node is added to the linkage rotation set, the current connecting edge is used as a blocking edge, and the block corresponding to the other node of the current connecting edge is used as a non-associated rotation block and is not added to the linkage rotation set. If no, the current block corresponding to the current node is added to the linkage rotation set, and the other node corresponding to the current connecting edge is used as the node for the next traversal.
[0013] Based on the above method embodiments, the present invention provides a corresponding terminal device embodiment; The present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a block linkage rotation method described in any embodiment of the present invention.
[0014] Based on the above method embodiments, the present invention provides a corresponding storage medium embodiment; The present invention provides a storage medium including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a block linkage rotation method described in any embodiment of the present invention.
[0015] The embodiments of the present invention have the following beneficial effects: This invention provides a method, apparatus, terminal device, and storage medium for linked rotation of building blocks. The method, after the user selects a target building block and a target rotation axis, traverses the corresponding connection graph using the target building block as the initial node. During the traversal, it determines whether any of the connecting edges of the current node have an axis that is on the same axis as the target rotation axis, and the corresponding connection mode is a shaft-hole coupling connection with a cross-shaped shaft hole without pin hole restrictions. If such an edge exists, it indicates that the building blocks corresponding to the nodes at both ends of this connecting edge are permanently connected; rotation of one edge inevitably causes rotation of the other. In this case, the building block corresponding to the current node is added to the linked rotation set as a building block that can rotate with the target building block. Then, adjacent building blocks connected to the current building block via corresponding connecting edges are used as nodes for the next traversal, thus extending the linkage determination to the next node. After traversing the connection graph, while controlling the target building block to rotate around the target rotation axis, the rotation of each building block in the final generated linked rotation set is synchronously controlled. By implementing the above-mentioned solution of the present invention, the associated blocks that will rotate together with the target block when the target block rotates around the target rotation axis can be determined according to the selected target block and the target rotation axis. When controlling the rotation of the target block, the associated blocks will be driven to rotate together, thereby improving the simulation effect of virtual block building. Attached Figure Description
[0016] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating a block linkage rotation method provided in an embodiment of the present invention.
[0018] Figure 2 This is a schematic diagram of a virtual block building interface provided in an embodiment of the present invention.
[0019] Figure 3 This is a schematic diagram illustrating the principle of a block linkage rotation method provided in an embodiment of the present invention.
[0020] Figure 4This is a schematic diagram of the structure of a block linkage rotation device provided in an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, 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.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0023] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0024] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0025] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0026] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0027] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0028] See Figure 1 An embodiment of the present invention provides a method for the linked rotation of building blocks, comprising: Step S101: In the current block building scenario, respond to the user's selection operation for blocks and rotation axes, and determine the target block and the target rotation axis; Indicative, such as Figure 2 As shown, in this invention, a virtual block building interface 1 is generated. The virtual block building interface 1 displays the blocks that exist in the current block building scene. The user selects the corresponding block to be rotated and the rotation axis on the virtual block building interface 1 with the mouse, thereby determining the target block 11 and the target rotation axis 12.
[0029] Step S102: Using the target block as the initial node, traverse the connection graph corresponding to the current block building scene; wherein, using each block that has a physical connection in the current block building scene as a node, construct a connection edge between any two blocks that have a physical connection, and use the area corresponding to the connection point of each block as the feature area of each block. For each connection edge, use the axis, pivot point, and connection mode between the two feature areas corresponding to the two ends of the connection edge as the edge attributes of the connection edge; construct the connection graph based on the nodes, the connection edges between nodes, and the corresponding edge attributes.
[0030] First, the construction of the connection diagram needs to be explained. In one embodiment of this invention, the connection diagram can be pre-configured and constructed by the user. Specifically, based on the actual connection relationship of each block in the current block-building scenario, with each block as a node, corresponding edges are constructed between the nodes corresponding to blocks with physical connections to form the aforementioned connection diagram. Each block has various regions, and the region where one block connects to another is defined as a feature region. In actual scenarios, the region where one block connects to another is generally a characteristic hole, shaft, pin, etc. These regions correspond to axes, and the axes of two interconnected feature regions are consistent. The axis points and axes of the feature regions can be determined in advance as edge attributes of the connection edges. At the same time, the connection mode and feature region type are also used as edge attributes of the aforementioned edges. The aforementioned feature region types include, for example: shaft, shaft hole, pin, pin hole, turntable top, turntable bottom, track shaft, track hole, etc. The connection between shafts and shaft holes forms a shaft hole coupling connection mode, and the connection between pins and pin holes forms a pin hole coupling connection mode. In this invention, for each feature region, a data object is configured with data including direction (e.g., a pin is inserted into a hole with a single opening, and can only be inserted from one side of the opening; the direction of this insertion is the direction of the feature region, i.e., the aforementioned axial direction), type, size, etc. The data is pre-configured and stored in a configuration file, and is used as an edge attribute of the connection edge when constructing the connection diagram. This data object contains data indicating the construction direction of the feature region.
[0031] Step S103: During each traversal, obtain all current connecting edges corresponding to the current node. For each current connecting edge, determine the axis of the current connecting edge based on the axis and axis point in the edge attributes. Specifically, the traversal begins with the target block as the initial node. During the first traversal, the current node is the node corresponding to the target block. For the current node, all connecting edges corresponding to the current node are extracted according to the connection graph to obtain several current connecting edges. Then, for each connecting edge, the axis of the current connecting edge can be determined according to the axial direction and axis point coordinates of any one of the two feature regions in the edge attribute.
[0032] Step S104: If it is determined that the axis of the current connection edge and the axis of the target rotation axis are on the same axis, the connection mode corresponding to the current connection edge is shaft-hole coupling, and the shaft hole is a cross shaft hole without pin hole restriction, add the current block corresponding to the current node to the linkage rotation set, and take the other node corresponding to the current connection edge as the node for the next traversal. In a preferred embodiment, the method further includes: during each traversal, when it is determined that the axis of the current connecting edge is not on the same axis as the axis of the target rotation axis, adding the current block corresponding to the current node to the linked rotation set, and using the other node corresponding to the current connecting edge as the node for the next traversal.
[0033] In a preferred embodiment, the method further includes: during each traversal, if it is determined that the axis of the current connecting edge is on the same axis as the axis of the target rotation axis, and the connection mode corresponding to the current connecting edge is pin-hole coupling, the current block corresponding to the current node is added to the linkage rotation set, the current connecting edge is used as a blocking edge, and the block corresponding to the other node of the current connecting edge is used as a non-associated rotation block and is not added to the linkage rotation set.
[0034] In a preferred embodiment, the method further includes: during each traversal, if it is determined that the axis of the current connecting edge is on the same axis as the target rotation axis and the connection mode corresponding to the current connecting edge is not shaft-hole coupling or pin-hole coupling, determining whether the axis point of the current connecting edge coincides with the axis point of the target rotation axis; if so, adding the current block corresponding to the current node to the linkage rotation set, using the current connecting edge as a blocking edge, and using the block corresponding to the other node of the current connecting edge as a non-associated rotation block, not adding it to the linkage rotation set; if not, adding the current block corresponding to the current node to the linkage rotation set, and using the other node corresponding to the current connecting edge as the node for the next traversal.
[0035] Specifically, the generation of linked rotation sets depends on the determination of rotational associations. In practice, this determination is made according to the following process: First, determine whether the axis of the current connecting edge and the axis of the target rotation axis are on the same axis. If they are not on the same axis, then allow this rotation relationship to continue to propagate along the connecting edge to the adjacent block (i.e., the other node corresponding to the current connecting edge besides the current node). Use this adjacent block as the node for the next traversal, and add the current node to the linked rotation set. If they are on the same axis, then the connection mode of the current connecting edge and the feature point types at both ends are further read.
[0036] If the current connecting edge corresponds to a pin and a pin hole connection, i.e., the pin hole coupling mode mentioned above, the current connecting edge is identified as a blocking edge. Then, the current block corresponding to the current node is added to the linkage rotation set, and the rotation relationship is no longer propagated across this edge.
[0037] If the current connecting edge corresponds to a shaft and a hole, i.e., in the aforementioned shaft-hole coupling mode, check whether the shaft hole is a cross-shaped shaft hole and whether the hole position also has a pin-hole type restriction feature. If the shaft hole is a pure cross-shaped shaft hole without pin-hole restriction, then it is allowed to continue propagating across the connecting edge to the adjacent block, and this adjacent block is used as the node for the next traversal. At the same time, the current node is added to the linkage rotation set; otherwise, the connecting edge is identified as a blocking edge, and then the current block corresponding to the current node is added to the linkage rotation set, and the rotation relationship is no longer propagated across the edge.
[0038] If the current connecting edge belongs to other connection types, such as the connection between the top and bottom of the turntable, it is determined whether the axis point of the connecting edge coincides with the axis point of the target rotation axis. If they coincide, the connecting edge is identified as a blocking edge; if they do not coincide, the rotation relationship is allowed to be propagated to the next adjacent block.
[0039] Using the above method, all blocks that are allowed to be reached through propagation are added to the linked rotation set until the traversal is complete. The linked block set corresponding to the target rotation axis is output and used for subsequent single-axis rotation control.
[0040] Step S105: According to the linkage rotation set, when the target block rotates around the target rotation axis, control the other related blocks in the linkage rotation set to rotate synchronously.
[0041] Indicative, such as Figure 3 As shown, assuming that the linked block 13 is within the linked rotation set, when the target block 11 is rotated around the target rotation axis 12, the linked block 13 will also rotate along with it, forming... Figure 3 The effect shown is due to Figure 3 and Figure 2 The comparison shows that when the target block 11 rotates, the position of the linked block 13 also moves, thus achieving the effect of rotating the target block and driving the associated blocks to rotate together, which improves the simulation effect of virtual block building.
[0042] like Figure 4 As shown, one embodiment of the present invention provides a block linkage rotation device, comprising: The module includes a target selection module, a connection graph traversal module, an axis determination module, a linkage rotation set generation module, and a rotation control module. The target selection module is used to respond to the user's selection operation in the current block building scenario and determine the target block and the target rotation axis. The connection graph traversal module is used to traverse the connection graph corresponding to the current block building scene, with the target block as the initial node. Specifically, it uses each block physically connected in the current block building scene as a node, constructs a connection edge between any two physically connected blocks, and uses the region corresponding to the connection point of each block as the feature region of each block. For each connection edge, the feature type, axis, pivot point, and connection mode between the two feature regions corresponding to the two ends of the connection edge are used as the edge attributes. The connection graph is constructed based on the nodes, the connection edges between nodes, and the corresponding edge attributes. The axis determination module is used to obtain all current connected edges corresponding to the current node during each traversal. For each current connected edge, the axis of the current connected edge is determined according to the axis and axis point in the edge attribute. The linkage rotation set generation module is used to add the current block corresponding to the current node to the linkage rotation set when it is determined that the axis of the current connection edge and the axis of the target rotation axis are on the same axis, the connection mode corresponding to the current connection edge is shaft hole coupling, and the shaft hole is a cross shaft hole without pin hole restriction. The module also uses the other node corresponding to the current connection edge as the node for the next traversal. The rotation control module is used to control the other associated blocks in the linkage rotation set to rotate synchronously when the target block rotates around the target rotation axis, according to the linkage rotation set.
[0043] In a preferred embodiment, the linkage rotation set generation module is further configured to, during each traversal, add the current block corresponding to the current node to the linkage rotation set when it is determined that the axis of the current connecting edge and the axis of the target rotation axis are not on the same axis, and use the other node corresponding to the current connecting edge as the node for the next traversal.
[0044] In a preferred embodiment, the linkage rotation set generation module is further configured to, during each traversal, if it is determined that the axis of the current connecting edge and the axis of the target rotation axis are on the same axis, and the connection mode corresponding to the current connecting edge is pin-hole coupling, add the current block corresponding to the current node to the linkage rotation set, treat the current connecting edge as a blocking edge, and treat the block corresponding to the other node of the current connecting edge as a non-associated rotation block, and not add it to the linkage rotation set.
[0045] In a preferred embodiment, the linkage rotation set generation module is further configured to, during traversal, determine whether the axis point of the current connecting edge coincides with the axis point of the target rotation axis if it is determined that the axis of the current connecting edge is on the same axis as the target rotation axis and the connection mode corresponding to the current connecting edge is not axis-hole coupling or pin-hole coupling; if yes, add the current block corresponding to the current node to the linkage rotation set, use the current connecting edge as a blocking edge, and use the block corresponding to the other node of the current connecting edge as a non-associated rotation block, not adding it to the linkage rotation set; if no, add the current block corresponding to the current node to the linkage rotation set, and use the other node corresponding to the current connecting edge as the node for the next traversal.
[0046] Based on the above method embodiments, the present invention provides corresponding terminal device embodiments.
[0047] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a block linkage rotation method described in any embodiment of the present invention.
[0048] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the device. The aforementioned terminal devices may be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. These devices may include, but are not limited to, processors and memory. The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the device, connecting various parts of the device via various interfaces and lines. The aforementioned memory can be used to store the aforementioned computer programs and / or modules. The aforementioned processor implements various functions of the aforementioned device by running or executing the computer programs and / or modules stored in the aforementioned memory, and by calling data stored in the memory. The aforementioned memory may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0049] Based on the above method embodiments, the present invention provides corresponding storage medium embodiments.
[0050] Another embodiment of the present invention provides a storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute the block linkage rotation method described in any embodiment of the present invention.
[0051] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0052] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for the coordinated rotation of building blocks, characterized in that, include: In the current block-building scenario, respond to the user's selected operation and determine the target block and the target rotation axis; Starting with the target block as the initial node, the connection graph corresponding to the current block building scene is traversed. Specifically, each block physically connected in the current block building scene is used as a node. A connection edge is constructed between any two physically connected blocks. The region corresponding to the connection point of each block is used as the feature region of each block. For each connection edge, the axis, pivot point, and connection pattern between the two feature regions corresponding to the two ends of the connection edge are used as the edge attributes. The connection graph is constructed based on the nodes, the connection edges between nodes, and the corresponding edge attributes. During each traversal, obtain all current connected edges corresponding to the current node. For each current connected edge, determine the axis of the current connected edge based on the axis and axis point in the edge attribute. If it is determined that the axis of the current connection edge is on the same axis as the axis of the target rotation axis, the connection mode corresponding to the current connection edge is shaft-hole coupling, and the shaft hole is a cross shaft hole without pin hole restriction, the current block corresponding to the current node is added to the linkage rotation set, and the other node corresponding to the current connection edge is used as the node for the next traversal. Based on the linkage rotation set, when the target block rotates around the target rotation axis, the other related blocks in the linkage rotation set are controlled to rotate synchronously.
2. The method for linkage rotation of building blocks according to claim 1, characterized in that, Also includes: During each traversal, when it is determined that the axis of the current connecting edge is not on the same axis as the axis of the target rotation axis, the current block corresponding to the current node is added to the linked rotation set, and the other node corresponding to the current connecting edge is used as the node for the next traversal.
3. The method for linkage rotation of building blocks according to claim 2, characterized in that, Also includes: During each traversal, if it is determined that the axis of the current connection edge is on the same axis as the axis of the target rotation axis, and the connection mode corresponding to the current connection edge is pin-hole coupling, the current block corresponding to the current node is added to the linkage rotation set, the current connection edge is used as a blocking edge, and the block corresponding to the other node of the current connection edge is used as a non-associative rotation block and is not added to the linkage rotation set.
4. The method for linkage rotation of building blocks according to claim 3, characterized in that, Also includes: During each traversal, if it is determined that the axis of the current connecting edge is on the same axis as the target rotation axis and the connection mode corresponding to the current connecting edge is not axis-hole coupling or pin-hole coupling, it is determined whether the axis point of the current connecting edge coincides with the axis point of the target rotation axis. If yes, the current block corresponding to the current node is added to the linkage rotation set, the current connecting edge is used as a blocking edge, and the block corresponding to the other node of the current connecting edge is used as a non-associative rotation block and is not added to the linkage rotation set. If no, the current block corresponding to the current node is added to the linkage rotation set, and the other node corresponding to the current connecting edge is used as the node for the next traversal.
5. A block-linked rotating device, characterized in that, include: The module includes a target selection module, a connection graph traversal module, an axis determination module, a linkage rotation set generation module, and a rotation control module. The target selection module is used to respond to the user's selection operation in the current block building scenario and determine the target block and the target rotation axis. The connection graph traversal module is used to traverse the connection graph corresponding to the current block building scene, with the target block as the initial node. Specifically, it uses each block physically connected in the current block building scene as a node, constructs a connection edge between any two physically connected blocks, and uses the region corresponding to the connection point of each block as the feature region of each block. For each connection edge, the axis, pivot point, and connection pattern between the two feature regions corresponding to the two ends of the connection edge are used as the edge attributes of the connection edge. The connection graph is constructed based on the nodes, the connection edges between nodes, and the corresponding edge attributes. The axis determination module is used to obtain all current connected edges corresponding to the current node during each traversal. For each current connected edge, the axis of the current connected edge is determined according to the axis and axis point in the edge attribute. The linkage rotation set generation module is used to add the current block corresponding to the current node to the linkage rotation set when it is determined that the axis of the current connection edge and the axis of the target rotation axis are on the same axis, the connection mode corresponding to the current connection edge is shaft hole coupling, and the shaft hole is a cross shaft hole without pin hole restriction. The module also uses the other node corresponding to the current connection edge as the node for the next traversal. The rotation control module is used to control the other associated blocks in the linkage rotation set to rotate synchronously when the target block rotates around the target rotation axis, according to the linkage rotation set.
6. The block linkage rotation device as described in claim 5, characterized in that, The linked rotation set generation module is also used to add the current block corresponding to the current node to the linked rotation set when it is determined that the axis of the current connecting edge and the axis of the target rotation axis are not on the same axis during each traversal, and to use the other node corresponding to the current connecting edge as the node for the next traversal.
7. The block linkage rotation device as described in claim 6, characterized in that, The linkage rotation set generation module is also used to, during each traversal, if it is determined that the axis of the current connecting edge and the axis of the target rotation axis are on the same axis, and the connection mode corresponding to the current connecting edge is pin-hole coupling, add the current block corresponding to the current node to the linkage rotation set, treat the current connecting edge as a blocking edge, and treat the block corresponding to the other node of the current connecting edge as a non-associated rotation block, and not add it to the linkage rotation set.
8. The block linkage rotation device as described in claim 6, characterized in that, The linkage rotation set generation module is also used, during traversal, to determine whether the axis point of the current connecting edge coincides with the axis point of the target rotation axis, provided that the axis of the current connecting edge is on the same axis as the target rotation axis and the connection mode corresponding to the current connecting edge is not axis-hole coupling or pin-hole coupling. If yes, the current block corresponding to the current node is added to the linkage rotation set, the current connecting edge is used as a blocking edge, and the block corresponding to the other node of the current connecting edge is used as a non-associated rotation block and is not added to the linkage rotation set. If no, the current block corresponding to the current node is added to the linkage rotation set, and the other node corresponding to the current connecting edge is used as the node for the next traversal.
9. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement a block linkage rotation method as described in any one of claims 1 to 4.
10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the storage medium is located to perform a block linkage rotation method as described in any one of claims 1 to 4.