Data extraction method and device, equipment and storage medium
By automating the extraction of structural data from plant models, the problems of low efficiency and difficulty in ensuring accuracy in manual configuration are solved, achieving efficient and accurate data extraction and resource utilization.
Patent Information
- Application Number
- CN202410959393.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2026-01-16
AI Technical Summary
In existing technologies, manually configuring the structural data of plant models is inefficient and prone to errors, resulting in wasted resources and difficulty in ensuring accuracy.
Structural data, including hierarchical data and pivot point data, is extracted from plant models using automated methods to generate a data structure diagram for plant animation.
It improves data extraction efficiency, reduces resource waste, enhances data extraction accuracy, and provides intuitive verification tools for quick error correction.
Smart Images

Figure CN121338339A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data extraction method, apparatus, device, and storage medium. Background Technology
[0002] In game development, a large number of plant models are typically needed to construct the game environment. Furthermore, to achieve plant animation, such as controlling plants to move in the wind, it's necessary to know the plant's structural data (hierarchical structure data and pivot point data). Only with known structural data can dynamic control of the plant models be achieved.
[0003] In related technologies, when a plant model does not have properly configured structural data, the developers typically configure the structural data in the plant model manually.
[0004] However, among the aforementioned related technologies, manually configuring structural data is inefficient. Summary of the Invention
[0005] This application provides a data extraction method, apparatus, device, and storage medium. The technical solutions provided by this application include the following aspects.
[0006] According to one aspect of the embodiments of this application, a data extraction method is provided, the method comprising the following steps.
[0007] Obtain a plant model, wherein the plant model is a three-dimensional model of the plant;
[0008] Based on the mesh information of the plant model, the structural data of the plant in the plant model is extracted. The structural data includes hierarchical structure data and pivot point data. The hierarchical structure data represents the levels included in the plant model, and the pivot point data represents data related to the joint positions of the plant growth in the plant model.
[0009] Based on the structural data of the plant, a data structure diagram corresponding to the plant model is generated, and the data structure diagram is used to generate animations related to the plant.
[0010] According to one aspect of the embodiments of this application, a data extraction apparatus is provided, the apparatus comprising the following modules.
[0011] The model acquisition module is used to acquire plant models, which are three-dimensional models of plants.
[0012] The data extraction module is used to extract the structural data of the plant in the plant model based on the grid information of the plant model. The structural data includes hierarchical structure data and pivot point data. The hierarchical structure data represents the levels included in the plant model, and the pivot point data represents data related to the joint positions of the plant growth in the plant model.
[0013] The graph generation module is used to generate a data structure graph corresponding to the plant model based on the plant's structural data. The data structure graph is used to generate animations related to the plant.
[0014] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described data extraction method.
[0015] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the above-described data extraction method.
[0016] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program, the computer program being loaded and executed by a processor to implement the above-described data extraction method.
[0017] The technical solutions provided in this application can bring the following beneficial effects.
[0018] Compared to related technologies that require manual configuration of structural data, this application directly extracts structural data from plant models, achieving automated extraction of structural data and improving data extraction efficiency.
[0019] In addition, in related technologies, when structural data is not included in the plant model, the plant model is redone. However, this application extracts the structural data of the original plant model, thereby improving the utilization rate of the plant model and avoiding resource waste.
[0020] In addition, compared with the manual configuration of structural data in related technologies, this application adopts an automated data extraction method, which improves the accuracy of data extraction. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of a computer system provided in one embodiment of this application;
[0022] Figure 2 This is a schematic diagram of a plant model provided in one embodiment of this application;
[0023] Figure 3 This is a flowchart of a data extraction method provided in one embodiment of this application;
[0024] Figure 4 This is a flowchart of a data extraction method provided in another embodiment of this application;
[0025] Figure 5 This is a flowchart of a data extraction method provided in another embodiment of this application;
[0026] Figure 6 This is a schematic diagram of the parameter panel provided by the relevant technology;
[0027] Figure 7 This is a schematic diagram of a parameter panel provided in one embodiment of this application;
[0028] Figure 8 This is a schematic diagram of a node provided in one embodiment of this application;
[0029] Figure 9 This is a schematic diagram of multiple nodes provided in one embodiment of this application;
[0030] Figure 10 This is a schematic diagram of a data extraction method provided in one embodiment of this application;
[0031] Figure 11 This is a block diagram of a data extraction method provided in one embodiment of this application;
[0032] Figure 12 This is a schematic diagram illustrating asset import provided in one embodiment of this application;
[0033] Figure 13 This is a schematic diagram illustrating automatic asset clearance provided in one embodiment of this application;
[0034] Figure 14 This is a parameter panel for the manual configuration section provided in one embodiment of this application;
[0035] Figure 15 This is a schematic diagram illustrating automatic redirection provided in one embodiment of this application;
[0036] Figure 16 This is a schematic diagram of a method for separating tree branches and leaves according to an embodiment of this application;
[0037] Figure 17 This is a schematic diagram of a trunk separation method provided in one embodiment of this application;
[0038] Figure 18 This is a schematic diagram of the pivot point and head point of a leaf provided in one embodiment of this application;
[0039] Figure 19 This is a schematic diagram of a numbering method provided in one embodiment of this application;
[0040] Figure 20 This is a schematic diagram of a node provided in another embodiment of this application;
[0041] Figure 21 This is a schematic diagram of the normal direction provided in one embodiment of this application;
[0042] Figure 22 This is a schematic diagram of a hierarchical data extraction method provided in one embodiment of this application;
[0043] Figure 23 This is a schematic diagram of a hierarchical data extraction method provided in another embodiment of this application;
[0044] Figure 24 This is a schematic diagram of a hierarchical data extraction method provided in another embodiment of this application;
[0045] Figure 25 This is a schematic diagram of a naming algorithm for hierarchical data provided in one embodiment of this application;
[0046] Figure 26 This is a schematic diagram of a sub-level tree provided in one embodiment of this application;
[0047] Figure 27 This is a schematic diagram of a method for determining length information provided in one embodiment of this application;
[0048] Figure 28 This is a schematic diagram of a method for determining the growth direction provided in one embodiment of this application;
[0049] Figure 29 This is a schematic diagram of the merging hierarchy provided in one embodiment of this application;
[0050] Figure 30 This is a schematic diagram of deleting a pivot point according to an embodiment of this application;
[0051] Figure 31 This is a schematic diagram of a parameter panel provided in another embodiment of this application;
[0052] Figure 32 This is a schematic diagram of a node provided in another embodiment of this application;
[0053] Figure 33 This is a schematic diagram of a rendered animation provided in one embodiment of this application;
[0054] Figure 34 This is a schematic diagram of a rendered animation provided in another embodiment of this application;
[0055] Figure 35 This is a schematic diagram of a rendered animation provided in another embodiment of this application;
[0056] Figure 36 This is a schematic diagram illustrating a method for viewing tree trunks and branches at different levels, provided in one embodiment of this application.
[0057] Figure 37 This is a schematic diagram illustrating the merging effect provided in one embodiment of this application;
[0058] Figure 38 This is a block diagram of a data extraction apparatus provided in one embodiment of this application;
[0059] Figure 39 This is a block diagram of a data extraction apparatus provided in another embodiment of this application;
[0060] Figure 40 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0062] Please refer to Figure 1 This illustration shows a schematic diagram of a computer system provided in one embodiment of this application. The computer system may include: a terminal device 10 and a server 20.
[0063] Terminal device 10 can be an electronic device such as a PC (Personal Computer), tablet computer, mobile phone, wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, or MR (Mixed Reality) device. A client application for the target application can be installed and run on terminal device 10. This target application can be a modeling application, a rendering application, or other applications that provide data extraction and structural diagram generation functions, such as design applications. This application does not limit the specific form of the target application. For example, the target application is a modeling application that provides data extraction functionality. Furthermore, this application does not limit the form of the target application, including but not limited to apps, mini-programs, etc., installed on terminal device 10, and can also be a webpage. For example, the client application of the target application obtains a plant model that does not include plant structural data, and extracts the plant structural data from the plant model based on the mesh information of the plant model. Further, based on the plant structural data, a data structure diagram corresponding to the plant model is generated to further generate animations related to the plant.
[0064] Server 20 is used to provide backend services for the client of the target application in terminal device 10. For example, server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but it is not limited to these.
[0065] Terminal device 10 and server 20 can communicate with each other via a network. This network can be a wired network or a wireless network.
[0066] The method provided in this application embodiment can be executed by a computer device, which refers to an electronic device capable of data calculation, processing, and storage. Figure 1 Taking the computer system shown as an example, the data extraction method can be executed by the terminal device 10 (such as by the client of the target application installed and running in the terminal device 10), or by the server 20, or by the terminal device 10 and the server 20 interacting and cooperating to execute it. This application does not limit this.
[0067] Before introducing the specific solution of this application, the relevant background technology involved in this application will be briefly explained below.
[0068] First, a brief explanation of the relevant terms used in this application will be provided.
[0069] Hierarchy data: This refers to the hierarchical structure of the plant asset model, primarily used in Unreal Engine to calculate wind animations and collision interaction animations. The default maximum is four levels.
[0070] Pivot data: This refers to the location information of a point abstracted from the joint position of plant branch growth, as well as the growth direction and length information of new shoots in this part.
[0071] Data structure graph: refers to a graph encoded based on hierarchical data and pivot point data. This data structure graph contains hierarchical data and pivot point data.
[0072] For Unreal Engine, a data structure graph needs to be obtained before rendering plant animations. Then, hierarchical data and pivot point data are decoded from the data structure graph. The plant is controlled based on this hierarchical data and pivot point data to generate the plant animation.
[0073] Before calculating the data structure diagram required by Unreal Engine, the following brief explanation is provided for cases where plant assets in related technologies do not include hierarchical data and pivot point data.
[0074] In game development, when faced with situations lacking hierarchical structure data and pivot point data, baking a data structure diagram is often necessary. Taking Unreal Engine assets as an example, when saving user-imported plant assets, if the plant asset doesn't have a SpeedTree or Houdini source file, Unreal Engine typically saves only the mesh information. Therefore, plant assets directly obtained by artists from the Unreal Engine marketplace naturally lack hierarchical structure data and pivot point data. Furthermore, some plant assets are not created using the PCG (Personal Computer Games) workflow; in this case, the plant asset might simply be a mesh drawn. In such cases, the plant asset never contains hierarchical structure data or pivot point data. For example... Figure 2 As shown in 200, a plant model 210 is shown, which includes more than 3,000 components, but does not include hierarchical data and pivot point data.
[0075] Therefore, related technologies require manual configuration to first obtain hierarchical structure data and then pivot point data. For example, artists manually select, group, and merge the mesh information of each branch and leaf in the plant model. Merged parts are considered to belong to the same level to determine the hierarchy of each part in the plant model. For example, artists manually configure each pivot point in the plant model and calculate branch length and growth direction. Finally, a data structure diagram is baked based on the hierarchical structure data and pivot point data. After importing this data structure diagram into Unreal Engine, Unreal Engine generates the plant animation based on the data structure diagram. However, manually configuring hierarchical structure data and pivot point data by artists is a large-scale project for complex plants, requiring significant manual labor. In complex plants, manually configured hierarchical structure data and pivot point data are prone to errors. Furthermore, because the data acquisition is manual rather than procedural, it is difficult to check the accuracy of the manually configured hierarchical structure data and pivot point data. If an error occurs, it may be necessary to reconfigure subsequent parts starting from the point of error.
[0076] Therefore, in such situations, artists often choose to discard the original plant assets that lacked hierarchical and pivot data, and instead recreate them with those data. This approach easily leads to a waste of resources. Furthermore, even with newly created plant assets, if they do not meet expectations, their hierarchical and pivot data need to be modified, thus perpetuating the aforementioned configuration difficulties.
[0077] It should be noted that plant animations in related technologies, such as controlling plants to move with the wind and interacting with game characters in a similar swaying manner, simulate realistic wind movement (the swaying of branches, not noise disturbance), and all require knowledge of the plant's structural data (hierarchical structure data and pivot point data). Dynamic control of the plant model can only be achieved with known structural data. Furthermore, the reason why skeletal data was not used to achieve similar swaying is that, in many cases, data structure graphs offer better rendering performance. Therefore, this application generates data structure textures based on structural data to achieve the aforementioned plant animations.
[0078] In view of the difficulties in manually configuring and modifying hierarchical data and pivot point data in related technologies, the technical solution provided in this application achieves the following two points.
[0079] 1. The entire process relies on geometric algorithms to reverse reconstruct plant assets, automatically generating hierarchical data and determining pivot point data, eliminating the need for manual configuration. The automatic determination of hierarchical data and pivot point data in this application is time-efficient, significantly improving efficiency compared to manual configuration.
[0080] 2. All data modifications in this application are procedural and non-destructive. This application provides intuitive verification tools; when there are errors in the configuration of hierarchical structure data and pivot point data, the specific location can be directly identified, allowing artists to quickly modify and adjust them. Compared to manual visual inspection of 3D views, this application achieves automated verification through visualization.
[0081] Please refer to Figure 3 The diagram illustrates a flowchart of a data extraction method provided in one embodiment of this application. The execution subject of this method can be the terminal device 10 described above, or the server 20. In the following method embodiments, for ease of description, the execution subject of each step is only referred to as "computer device". The method may include at least one of the following steps (310-330):
[0082] Step 310: Obtain the plant model, which is a three-dimensional model of the plant.
[0083] In some embodiments, the plant model in the technical solution provided in this application is a three-dimensional model of a plant. This application does not limit the type of plant; the plant may be at least one of a large tree, flower, bamboo, etc.
[0084] In some embodiments, the plant model is stored in the database of the target application. During step 310, the plant model is retrieved directly from the database of the target application.
[0085] In other embodiments, the plant model is obtained by the target application from other applications. During step 310, the plant model is obtained from the client or server of the other application. Exemplarily, the other application provides the plant model, such as by providing functionality for drawing plant models. Artists draw the plant model in the other application; the specific method used to draw the plant model is not limited in this application.
[0086] It should be understood that the plant model in step 310 should be a model that does not include the structural data described below. If the plant model includes the structural data described below, it should not be used as the plant model in step 310. In some embodiments, the plant model does not include hierarchical structure data and pivot point data. In some embodiments, all components in the plant model are at the same level and no pivot points are labeled.
[0087] For a detailed explanation of hierarchical data and pivot point data, please refer to the explanations in the following embodiments; they will not be repeated here. In some embodiments, such as Figure 2 The plant model shown in Figure 200 does not include hierarchical data and pivot point data.
[0088] In some embodiments, the plant model is a three-dimensional model of a plant. In some embodiments, the three-dimensional model is composed of a mesh. Exemplarily, a mesh can be understood as a mesh component, or also as the mesh or mesh information of a three-dimensional model. Exemplarily, the three-dimensional model is composed of multiple polygons, which are actually composed of multiple triangles, and the surface of the three-dimensional model is composed of multiple interconnected triangular faces. In three-dimensional space, the geometry of the points and edges that make up these triangles is called a mesh.
[0089] Step 320: Based on the grid information of the plant model, extract the structural data of the plant in the plant model. The structural data includes hierarchical structure data and pivot point data. The hierarchical structure data represents the levels included in the plant model, and the pivot point data represents the data related to the joint positions of plant growth in the plant model.
[0090] In some embodiments, the technical solution provided in this application can directly extract plant structural data from plant models. In some embodiments, the data extraction method mentioned in the technical solution provided in this application is encapsulated in a node of the target application. In response to an operation on that node, step 320 is executed without manual configuration.
[0091] In other embodiments, structural data of the plant in the plant model is extracted using a neural network model based on the grid information of the plant model. In some embodiments, the neural network model is also used to extract structural data of the plant. In some embodiments, the neural network model is a pre-trained machine learning model. In some embodiments, the input of the neural network model is the plant model, and the output is structural data. In some embodiments, the neural network model is trained by manually configuring the structural data of the plant model as training samples, resulting in a trained neural network model. In some embodiments, step 320 described above is performed using the trained neural network model.
[0092] In some embodiments, structural data of plants in the plant model are extracted based on the grid information of the plant model.
[0093] In some embodiments, structural data includes hierarchical data and pivot point data.
[0094] For example, hierarchical data can be understood as a hierarchical structure on a model, where different components in the model correspond to different levels. For example, this hierarchical structure corresponds to the rendering level of the model. For example, the level of a component in the model corresponds to the level at which that component is rendered in that model. For example, the higher the level of a component, the higher priority it is for rendering. For example, the hierarchy corresponds to the growth sequence of a plant. For example, if a plant grows from roots to trunk, then to branches, and finally to leaves, then correspondingly, in this plant model, the root level is the highest, followed by the trunk, then the branches, and finally the leaves.
[0095] For example, pivot point data is understood as data related to the joint positions of plant growth in a plant model. Here, joint positions can be understood as key locations in plant growth, such as nodes connecting roots and trunks, nodes connecting trunks and branches, nodes connecting branches and leaves, etc. In some embodiments, the joint positions of plant growth are also referred to as pivot points. For example, the pivot point data is data related to the pivot point. For example, the pivot point data includes the position of the pivot point, growth length (e.g., the growth length of a branch), growth direction (e.g., the growth direction of a branch), etc.
[0096] Step 330: Based on the plant's structural data, generate a data structure diagram corresponding to the plant model. The data structure diagram is used to generate animations related to the plant.
[0097] In some embodiments, step 330 may or may not be performed. When only structural data needs to be extracted from the plant model, steps 310 and 320 described above can be performed. In some embodiments, step 330 may also be understood as the process of generating a data structure diagram, which, when generated, can be used to generate animations related to the plant.
[0098] In some embodiments, a data structure diagram is generated based on plant structural data and a plant model.
[0099] In some embodiments, the data structure graph is a Pivot Painter texture. For example, the data structure graph is a PP2 (Pivot Painter2) texture. A PP2 texture is a data structure stored within a texture. In Unreal Engine, by decoding the hierarchical data and pivot point data stored on the two textures, high-quality plant wind animations and collision interaction animations can be rendered.
[0100] In some embodiments, the structural data of the plant is encoded into the texture of the plant model to obtain the data structure diagram. In some embodiments, hierarchical result data and pivot point data are encoded into the texture of the plant model to obtain the data structure diagram. In some embodiments, step 330 is implemented by the target application described above. In other embodiments, after the structural data is extracted, it is sent to a texture generation application, which generates a data structure diagram based on the structural data. In other embodiments, a game engine generates the data structure diagram based on the structural data. In some embodiments, a Houdini Labs tool or a plugin for Unreal Engine is used to generate the data structure diagram from the structural data.
[0101] In other embodiments, structural data is decoded from a data structure graph when rendering the plant's animation. Exemplarily, hierarchical data and pivot point data are decoded from the data structure graph. In some embodiments, after obtaining the data structure graph, the animation rendering application decodes the hierarchical data and pivot point data from it. Based on the obtained hierarchical data and pivot point data, the animation rendering application re-renders the plant model and controls the joint positions to obtain the plant's animation.
[0102] In some embodiments, the aforementioned other applications, texture generation applications, animation rendering applications, and the aforementioned target applications are different applications. Of course, the aforementioned other applications, texture generation applications, animation rendering applications, and the aforementioned target applications can also be the same application. This application does not limit this. In some embodiments, when the aforementioned other applications, texture generation applications, animation rendering applications, and the aforementioned target applications are the same application, the aforementioned other applications, texture generation applications, and animation rendering applications can be implemented as different functional modules within the target application, such as a model drawing module, a texture generation module, and an animation rendering module.
[0103] Compared to related technologies that require manual configuration of structural data, the technical solution provided in this application directly extracts structural data from the plant model, achieving automated extraction of structural data and improving data extraction efficiency.
[0104] In addition, in related technologies, when structural data is not included in the plant model, the plant model is redone. However, this application extracts the structural data of the original plant model, thereby improving the utilization rate of the plant model and avoiding resource waste.
[0105] The following explanation uses trees as an example to illustrate the specific data extraction process. It should be noted that the same explanation applies to other plants; the process for extracting structural data from trees will not be repeated here.
[0106] Please refer to Figure 4 The diagram illustrates a flowchart of a data extraction method provided in another embodiment of this application. The execution entity of this method can be the terminal device 10 described above, or the server 20. In the following method embodiments, for ease of description, the execution entity of each step is described only as a "computer device." The method may include at least one of the following steps (410-460):
[0107] Step 410: Obtain the plant model, which is a three-dimensional model of the plant.
[0108] In some embodiments, the plant is a tree. In some embodiments, the plant model includes branches and leaves. In some embodiments, when extracting structural data, the leaves and branches of the plant model are extracted separately.
[0109] In some embodiments, such as Figure 6 As shown in Figure 600, this is a parameter panel provided in the related art for implementing structural data configuration. In some embodiments, such as Figure 7 As shown in Figure 700, this is the parameter panel used to implement structural data extraction in this application. It is not difficult to see that the parameter panel in the embodiment of this application is more simplified.
[0110] In some embodiments, this application provides artists with nodes for extracting structural data. In some embodiments, such as... Figure 8 The 800 nodes shown are used to extract hierarchical data and pivot point data. In some embodiments, such as Figure 9 The nodes shown at 900 are several specific nodes used to extract hierarchical data and pivot point data. Different nodes correspond to different steps in the data extraction process.
[0111] In some embodiments, such as Figure 10 The diagram illustrates a data extraction method provided in one embodiment of this application. Node 1010 is used to import assets (i.e., plant models) and automatically clean up useless data. Node 1020 is used to manually and quickly configure main trunk and leaf groups. Node 1030 is used to automatically calculate hierarchical data and pivot point data. Node 1040 is used to output new assets and bake a data structure diagram. Node 1050 is used to provide an intuitive visualization module for the plant model.
[0112] In some embodiments, such as Figure 11 The diagram illustrates a block diagram of a data extraction method provided in one embodiment of this application. Exemplarily, the block diagram includes a process 1110 for extracting structural data of tree branches, a process 1120 for extracting structural data of tree leaves, and a process 1130 for merging levels and deriving a data structure diagram.
[0113] Specifically, such as Figure 12 As shown, this illustrates how plant assets are imported. Exemplarily, in response to an operation on control 1220, node portion 1210 is implemented, i.e., automatic import of plant assets. In some embodiments, in response to an operation on control 1240, automatic renaming of the imported plant assets is implemented.
[0114] In some embodiments, data is automatically cleaned and scaled to a uniform 5x5x5 size, achieving parameter calculation at a standardized size, reducing the chance of errors, and finally restoring the original matrix data. For example, as... Figure 13 As shown, node 1330 represents the plant assets before automatic cleanup, with data for the plant assets before automatic cleanup shown in 1310. Node 1370 represents the plant assets after automatic cleanup, with data for the plant assets before automatic cleanup shown in 1320. Node 1340 represents the cleanup of colliders, LOD (Levels of Detail), etc., in the plant assets. Node 1350 represents scaling to a uniform unit size and saving the original matrix. Node 1360 represents the cleanup of useless attributes and saving the original vertex and polygon IDs.
[0115] In some embodiments, such as Figure 14 As shown, it displays the parameter panel for the parts that require manual configuration. Among them, control 1410 jumps to select the leaf part, control 1420 jumps to select the trunk part, control 1430 jumps to select the pivot point of the leaf, and control 1440 jumps to select the head point of the leaf.
[0116] Step 420: Determine the leaf and branch parts in the plant model.
[0117] In some embodiments, the leaf portion and the branch portion of the plant model together constitute the plant model. Exemplarily, the leaf portion of the plant model refers to the portion related to the leaves in the plant model. Exemplarily, the branch portion of the plant model refers to the portion related to the branches in the plant model, which of course includes the trunk.
[0118] In some embodiments, the leaf and branch portions of the plant model are determined based on a two-dimensional view of the plant model. In some embodiments, the leaf and branch portions of the plant model are determined based on a UV view of the plant model.
[0119] In some embodiments, the leaves and branches in the plant model are determined based on the material information of each part in the plant model. In some embodiments, the materials of each part are different, and the branches and trunk are selected by material.
[0120] In some embodiments, the leaf and branch parts in the plant model are determined based on the grouping information of each part in the plant model. In some embodiments, the groups of each part are different, and the branch and trunk parts are filtered based on the grouping information.
[0121] In some embodiments, such as Figure 15 As shown, node 1510 indicates the automatic jump position. 1520 shows that the 3D view is switched to UV mode during the jump.
[0122] In some embodiments, such as Figure 16 As shown, node 1610 represents the use of material information to separate the leaf and branch parts. For example, the separation of the leaf and branch parts is achieved by selecting different materials 1620.
[0123] In some cases, all three methods described above can achieve the separation of the branch and leaf parts. For example, these three methods correspond to three different controls (or nodes). Different methods are used to separate the branch and leaf parts in response to selection operations on different controls (or nodes).
[0124] Step 430: Based on the grid information of the branch section, determine the hierarchical structure data and pivot point data corresponding to each branch in the branch section.
[0125] In some embodiments, the hierarchical structure data and pivot point data corresponding to each branch in the branch section are determined based on the grid information of the branch section.
[0126] In some embodiments, during the actual growth of a plant, branches may have numerous forks, meaning the actual layer level may be very high. Considering this, a layer threshold is set to improve rendering efficiency. For example, the layer threshold is I, where I is a positive integer. In some embodiments, portions of the plant model above layer I are assigned to layer I, or portions above layer I are directly removed; this application does not limit this. In some embodiments, a smaller layer value indicates a higher layer, closer to the root. Conversely, a larger layer value indicates a lower layer, closer to the plant's growth tip (such as the last leaf to grow).
[0127] In some embodiments, when the threshold of a level is I, I iterations are required for the plant model to find the portion of the plant model that belongs to that level I.
[0128] In some embodiments, the extraction process of the structure data of the i-th iteration is represented as at least one of the following steps S1 to S5 (not shown in the figure), where i is a positive integer not greater than 1 and greater than 1.
[0129] Before introducing the i-th iteration, let's first introduce the 1st iteration. In some embodiments, in the 1st iteration, the branch of the first level is the trunk portion determined from the branch portion.
[0130] For example, considering that the trunk occupies a large portion of the branches, the trunk is automatically extracted from the branches based on the continuity in the mesh information. Of course, the extraction of the trunk is relatively simple, but to improve accuracy, it can also be extracted manually by artists or developers.
[0131] In some embodiments, such as Figure 17 As shown, the automatic extraction of the tree trunk is achieved through node 1710. The tree trunk in this plant model is divided into... Figure 17 The black part is 1720.
[0132] For example, if the root portion is considered the highest level, then the trunk portion is the next level derived from the root portion, such as the first level. For example, the root portion is not shown in the plant model.
[0133] For example, in the second iteration, the branches that derive from the trunk are identified, and the level of these derived branches is the second level.
[0134] Step S1: For the kth branch in the (i-1)th level, remove the branches from the first level to the (i-1)th level from the branch part to obtain the branch part after the i-th separation, where i is an integer greater than 1 and k is a positive integer.
[0135] For example, in the i-th iteration, it is necessary to remove the branches from the first level to the (i-1)-th level determined in the previous i-1 iterations from the branch part to obtain the branch part after the i-th separation.
[0136] For example, in the second iteration, it is necessary to remove the first-level branch (i.e., the trunk) from the branch section to obtain the branch section excluding the trunk.
[0137] For example, during the i-th iteration, the number of branches at the (i-1)-th level may be multiple. For example, there exist branches 1, 2, and 3 that are all branches at the (i-1)-th level. Then, steps S1 to S3 need to be executed for branches 1, 2, and 3. At this time, the k-th branch is any one of branches 1, 2, and 3.
[0138] For example, when branch 1, branch 2, and branch 3 are all branches derived from branch 0, branch 1, branch 2, and branch 3 are child branches of branch 0, and branch 0 is the parent branch of branch 1, branch 2, and branch 3. Here, 0, 1, 2, and 3 are the numbers of each branch (including the trunk) in the branch section.
[0139] In some embodiments, the hierarchical data corresponding to a branch includes the branch's level and its corresponding parent-level branch, where the parent-level branch refers to the branch at the next higher level connected to the branch. Further, the hierarchical data corresponding to a branch includes the branch's level, its corresponding parent-level branch, and the parent-level branch (grandparent-level branch) of that parent-level branch, where the parent-level branch refers to the branch at the next higher level connected to the branch. That is, the hierarchical data corresponding to the branch includes not only the branch's level but also its parent-level branch and all branches (or historical branches) up to the root. Further, the hierarchical data corresponding to the branch also includes the branch's identification information (ID). In some embodiments, this identification information is represented by a number. Exemplarily, this identification information is also called an ID attribute.
[0140] For example, before performing the above iterations, the branches and leaves in the plant model are numbered. For example, each branch and each leaf in the plant model is numbered according to the grid information in the plant model. For example, branches and leaves can be numbered separately or jointly. In some embodiments, the leaf number can be "leaf_0", "leaf_1", "leaf_2", etc. In some embodiments, the branch number can be "branch_0", "branch_1", "branch_2", etc.
[0141] For example, it is necessary to calculate the unique attributes (i.e., identification information) of branches and leaves based on the mesh vertex connectivity. Since the main trunk, remaining branches, and all leaves have now been separated, the identification information is calculated separately. Therefore, it is necessary to add an offset based on the maximum value of the number in one part, so that the number of all components in each part is a unique value in the asset. For example, as shown... Figure 19As shown, the maximum value is first obtained through node 1910, then the offset is added through node 1920, and finally, the numbering of all small components in the plant model is achieved through node 1930.
[0142] In some embodiments, such as Figure 20 As shown, the hierarchical structure data of the tree branch is automatically calculated through node 2000.
[0143] For example, for the branch portion, performing the i-th iteration can also be considered as the process of determining the i-th level. For example, the i-th level is denoted as "level_i". For example, the i-th level of the branch portion is denoted as "branch_level_i".
[0144] For example, the level of the root part is "Root". For example, the level of the trunk part is "level_1" and the number of the trunk part is "branch_1".
[0145] For example, the hierarchical structure data of the trunk is "root / level_1_branch_1". Here, root indicates that the parent level branch of the trunk is the root part, level_1 indicates that the level of the trunk is the first level, and branch_1 indicates the number of the trunk.
[0146] For example, if the hierarchical structure data of one of the branches derived from the trunk is "root / level_1_branch_1 / level_2_branch_9", then level_1_branch_1 represents the level of the parent branch of this branch and the number of the parent branch; level_2 indicates that the level of this branch is the second level; and branch_9 represents the number of this branch. "Root" indicates that the parent branch of the parent branch of this branch (the grandparent branch) is the root of the tree.
[0147] For example, the hierarchical data corresponding to a branch includes the branch's level and its corresponding parent level branch. For example, the hierarchical data includes the branch's identification information and hierarchical relationship. For example, the hierarchical relationship includes the branch's level and its corresponding parent level branch. For example, the hierarchical relationship includes the branch's level and its corresponding historical level branches.
[0148] For example, the hierarchical structure data of the branches is "root / level_1_branch_1 / level_2_branch_9 / level_3_branch_13 / level_4_branch_10 / level_5_branch_11". Here, "root / level_1_branch_1 / level_2_branch_9 / level_3_branch_13 / level_4_branch_10 / level_5" represents the hierarchical relationship, and branch_11 represents the branch's identification information. For example, "level_5" represents the level of this branch, and "root / level_1_branch_1 / level_2_branch_9 / level_3_branch_13 / level_4_branch_10" represents the branches at the corresponding historical levels.
[0149] In some embodiments, the tree can be traced back to its roots based on the hierarchical data of the tree branches.
[0150] Step S2: Based on the grid information of the k-th branch and the grid information of the branch portion after the i-th separation, determine the branch connected to the k-th branch from the branch portion after the i-th separation.
[0151] In some embodiments, based on the grid information of the k-th branch and the grid information of the branch portion after the i-th separation, the branch connected to the k-th branch is determined from the branch portion after the i-th separation. That is, from the separated branch portion, it is necessary to find the sub-level branches of the k-th branch.
[0152] It should be understood that the k-th branch mentioned in this application refers to a branch without any branches. That is, the k-th branch has no branches and its grid is continuous.
[0153] For example, the sub-level branches of the k-th branch are determined from the branch portion after the i-th separation based on the grid information of the k-th branch and the grid information of the branch portion after the i-th separation.
[0154] In some embodiments, the branches inserted into the parent level mesh can be accurately found first by judging the cross-sectional volume of the bounding box of the vertex group and the expansion (flood) algorithm of the point group. These branches are the branches of the child level, and at the same time, the child level obtains the ID attribute of the parent level.
[0155] In some embodiments, the mesh information of the k-th branch is extended outward along the normal direction to obtain the extended mesh information of the k-th branch; from the mesh information of the branch portion after the i-th separation, at least one intersection point that intersects with the mesh information of the extended k-th branch is determined; based on the at least one intersection point, the branch connected to the k-th branch is determined from the branch portion after the i-th separation.
[0156] For example, the mesh of the k-th branch is expanded outward along the normal direction to obtain the expanded mesh of the k-th branch. From the mesh information of the branch portion after the i-th separation, at least one intersection point is determined that intersects with the mesh of the expanded k-th branch; for example, different intersection points are distributed on different branches. In some embodiments, the sub-level branches of the k-th branch are branch x and branch y (this is merely an example, and the number of sub-level branches is not limited in this application), and both branch x and branch y are branches in the branch portion after the i-th separation. Then branch x and branch y each have intersection points with the mesh of the expanded k-th branch. For example, the mesh of branch x has 5 intersection points with the mesh of the expanded k-th branches, and the mesh of branch y has 6 intersection points with the mesh of the expanded k-th branches. In some embodiments, these 5 and 6 intersection points are considered to be at least one of the aforementioned intersection points. In some embodiments, based on at least one intersection point, the branch connected to the k-th branch is determined from the branch portion after the i-th separation. In some embodiments, branches x and y are determined based on the 5 and 6 intersection points. In some embodiments, based on an expansion algorithm, the expansion extends from the positions of the 5 intersection points to the entire branch x, and from the positions of the 6 intersection points to the entire branch y, until the grid is no longer continuous, indicating that the branch has branched, at which point the expansion stops.
[0157] For example, firstly, point clouds are scattered across the surface of the parent-level mesh based on area. These point clouds inherit the branch ID attributes from the parent-level mesh. Then, by finding points on the separated branch sections that are close to the points on the parent-level mesh, these points are separated, and their IDs are passed to the child-level points. In this way, the child-level mesh receives the parent-level ID attributes. An extension algorithm then extends the attributes of these points to the entire complete branch—that is, the branch where the mesh has no breaks; this is typically the first-level branch when creating the model.
[0158] In some embodiments, such as Figure 22 As shown, when determining the sub-level branches of the trunk, first identify point 2200, which is inserted into the trunk section 2210. Point 2200 (hollow circle) is just an example; there should be many more points.
[0159] In some embodiments, such as Figure 23As shown, first determine the point 2300 that is inserted into the trunk, then find the point 2310 on the separated branch that is close to the point cloud of the parent level, and extend the attributes of this part of the point to the whole complete branch 2330 through the extension algorithm, thereby determining the sub-level branches of the trunk.
[0160] In some embodiments, such as Figure 24 As shown in 2400, the algorithm result 2410 of the extended algorithm is shown (for example only).
[0161] In some embodiments, such as Figure 25 As shown, it illustrates the naming algorithm 2500 for the hierarchical data corresponding to the branch section.
[0162] For example, when expanding the grid of the k-th branch outwards, the threshold for the expansion range can be set in advance. If the expansion range is z, then z should be less than the threshold for the expansion range. Of course, this is for accuracy considerations. When a large expansion range is required for an intersection to occur, it indicates that the distance between the parent branch and the child branch is large. In this case, a parent-child hierarchical relationship should not be considered between the two branches.
[0163] For example, when expanding the grid of the k-th branch outwards, the point cloud is also distributed on the grid of the k-th branch, and the distributed point cloud is used as the grid of the k-th branch. This method can improve the efficiency and accuracy of determining intersection points.
[0164] In some embodiments, such as Figure 21 As shown, the normal direction of the tree trunk at one point is 2100. Of course, the normal direction of 2100 is just an example; the normal direction will be different at different locations in the mesh.
[0165] In this embodiment, expanding the parent-level mesh along the normal direction can improve the success rate of finding intersections, thereby improving the accuracy of determining sub-level branches and thus improving the accuracy of data extraction.
[0166] Step S3: Determine the branch connected to the k-th branch as the sub-level branch of the k-th branch, the k-th branch as the parent level branch corresponding to the branch connected to the k-th branch, and the level of the branch connected to the k-th branch as the i-th level.
[0167] For example, if branch 1 is connected to the root, branch 1 is connected to branches 2 and 3, branch 2 is connected to branches 4 and 5, and branch 3 is connected to branches 6 and 7, then the root is considered the parent branch of branch 1, branch 1 is the parent branch of branches 2 and 3, branch 2 is the parent branch of branches 4 and 5, and branch 3 is the parent branch of branches 6 and 7. Conversely, if branch 1 is a child branch of the root, branches 2 and 3 are child branches of branch 1, branches 4 and 5 are child branches of branch 2, and branches 6 and 7 are child branches of branch 3.
[0168] Step S4: Traverse all branches in the (i-1)th level until all branches in the i-th level are found.
[0169] In some embodiments, in the i-th iteration, it is necessary to traverse all branches of the (i-1)-th level until all branches of the i-th level are found, then stop the i-th iteration.
[0170] Step S5: Determine the pivot point data of each branch in the i-th level based on the grid information of each branch in the i-th level.
[0171] In some embodiments, the pivot point data can be determined for each branch of the i-th level as soon as it is determined. Alternatively, the pivot point data can be determined one by one after all branches of the i-th level have been determined. This application does not limit this approach.
[0172] In some embodiments, the pivot point data of a branch includes the pivot point of the branch, the growth direction of the branch, and the length information of the branch.
[0173] In some embodiments, the point cloud corresponding to the m-th branch is determined based on the grid information of the m-th branch. In some embodiments, a point cloud is uniformly distributed in the grid of the m-th branch.
[0174] In some embodiments, the points with the maximum and minimum distances to the parent level branches corresponding to the m-th branch are determined from the point cloud. The point with the minimum distance is determined as the pivot point of the m-th branch, and the point with the maximum distance is determined as the head point (Tip) of the m-th branch. For example, the points with the maximum and minimum distances to the parent level branches corresponding to the m-th branch are found from the point cloud, and the point with the minimum distance is determined as the pivot point of the m-th branch, and the point with the maximum distance is determined as the head point (Tip) of the m-th branch.
[0175] In some embodiments, an algorithm node HU_Find_Pivot_and_Tip_Point_by_Surface_Dist was developed. This algorithm node HU_Find_Pivot_and_Tip_Point_by_Surface_Dist is used to determine the pivot point and head point of a branch.
[0176] In some embodiments, the growth direction and length information of the m-th branch are determined based on the pivot point and head point of the m-th branch.
[0177] In some embodiments, such as Figure 26 As shown, the pivot point of one of the branches is point 2600, and the growth direction of the branch is 2610.
[0178] In some embodiments, such as Figure 27 As shown, the length information of the m-th branch is automatically determined through node part 2710, which is the distance from pivot point 2720 to head point 2730.
[0179] For example, the growth direction of the m-th branch is determined based on the direction of the line connecting the pivot point of the m-th branch and the head point of the m-th branch.
[0180] For example, the direction of the line connecting the pivot point and the head point of the m-th branch is determined as the growth direction of the m-th branch.
[0181] For example, the direction of the line connecting the pivot point of the m-th branch and the head point of the m-th branch is determined as the first direction of the m-th branch; the direction bounding box of the m-th branch is determined, and the direction of the longest side of the direction bounding box is determined as the second direction of the m-th branch; the growth direction of the m-th branch is obtained by interpolating the first direction and the second direction.
[0182] For example, an Oriented Bounding Box (OBB) is a bounding box with the smallest volume that completely encloses the mesh of the m-th branch. For example, the direction of the longest side of this Oriented Bounding Box is determined as the second direction.
[0183] In some embodiments, such as Figure 28 As shown, the direction bounding box 2810 is determined. The direction of the longest side 2820 of the direction bounding box 2810 is determined as the second direction.
[0184] For example, when the first direction and the second direction are the same or opposite, the first direction is determined as the growth direction of the m-th branch.
[0185] For example, when the first direction and the second direction are neither the same nor opposite, the first direction is taken as the primary factor, combined with the second direction, to determine the growth direction of the m-th branch. Specifically, the dot product (inner product) value between the first direction and the second direction is calculated, and then this value is normalized. The normalized result is used as the coefficient for the leap function interpolation. For example, using this coefficient as the weight, the first direction and the second direction are weighted and summed, and the resulting interpolation result is used as the growth direction of the m-th branch.
[0186] In some embodiments, the length information of the m-th branch is determined by the distance between the pivot point and the head point of the m-th branch. For example, the distance between the pivot point and the head point of the m-th branch is used to determine the length information of the m-th branch.
[0187] Step 440: Based on the hierarchical structure data corresponding to each branch and the grid information of the leaf part, determine the hierarchical structure data and pivot point data corresponding to each leaf in the leaf part.
[0188] In some embodiments, the hierarchical structure data and pivot point data corresponding to each leaf in the leaf part are determined based on the hierarchical structure data corresponding to each branch and the grid information of the leaf part.
[0189] Similar to the hierarchy of the branch sections, the leaf sections also have their own hierarchy. For example, the hierarchy of the leaf sections and the hierarchy of the branch sections are named separately.
[0190] For example, leaf 1, leaf 2, and leaf 3 are all leaves that grow from branch 0. Leaf 1, leaf 2, and leaf 3 are child-level leaves of branch 0, and branch 0 is the parent-level branch of leaf 1, leaf 2, and leaf 3. Here, 0, 1, 2, and 3 are the numbers of each leaf in the leaf section.
[0191] In some embodiments, the hierarchical data corresponding to a leaf includes the leaf's level and its parent-level branch or parent-level leaf. The parent-level branch refers to the branch at the next higher level connected to the leaf, and the parent-level leaf refers to the leaf at the next higher level connected to the leaf. Further, the hierarchical data corresponding to a leaf includes the leaf's level, its parent-level branch or parent-level leaf, and the branch or leaf at the leaf's historical level. Further, the hierarchical data corresponding to a leaf also includes the leaf's ID. In some embodiments, this identification information is represented by a number.
[0192] For example, the nth level is denoted as "level_n". For example, the nth level of the leaf section is denoted as "leaf_level_n". n is a positive integer.
[0193] For example, the levels of the leaf section and the branch section are numbered separately. For example, the levels of the branch section are branch_level_1, branch_level_2, branch_level_3, and so on. For example, the levels of the leaf section are leaf_level_1, leaf_level_2, leaf_level_3, and so on.
[0194] For example, the levels of the leaf and branch sections are jointly numbered. That is, both the branch and leaf sections are numbered using level_x.
[0195] For example, when the leaf grows from a parent branch, if the level of the parent branch is x, then the level of the leaf is x+1.
[0196] For example, when the leaf grows from a parent leaf, if the parent leaf has a level of y, then the leaf has a level of y+1.
[0197] Therefore, the leaf has different tiers depending on where it grows.
[0198] For example, if the hierarchical structure data of the leaves deriving from the trunk is "root / level_1_branch_1 / level_2_leaf_1", then level_2 indicates that the leaf is at the second level, and leaf_1 indicates the branch number. level_1_branch_1 indicates the level of the parent branch of the leaf and the number of the parent branch, and root indicates that the parent branch of the parent branch of the leaf (the grandparent branch) is the root.
[0199] For example, if the hierarchical structure data of leaves derived from a leaf is "root / level_1_branch_1 / level_2_leaf_1 / level_3_leaf_5", then level_3 indicates that the leaf is at the third level, and leaf_5 indicates the branch number. level_2_leaf_1 indicates the level and number of the parent leaf of leaf_5, and level_1_branch_1 indicates the level and number of the grandparent branch of leaf_5.
[0200] For example, the hierarchical data corresponding to a leaf includes the leaf's level and the parent-level branch or leaf corresponding to the leaf. For example, the hierarchical data includes the leaf's identification information and hierarchical relationship. For example, the hierarchical relationship includes the leaf's level and the parent-level branch or leaf corresponding to the branch. For example, the hierarchical relationship includes the leaf's level and the branch or leaf of the leaf's historical level.
[0201] In some embodiments, the iteration count is 6. After 6 iterations, the hierarchical structure data and pivot point data of all branches can be obtained. For example, most plant assets typically do not exceed level 5, and those exceeding this level are automatically removed.
[0202] In some embodiments, whether it is a leaf or a branch, its hierarchical structure data is a unique string formed by combining a unique ID and a hierarchical relationship, such as "root / level_1_branch_1 / level_2_branch_9 / level_3_branch_13 / level_4_branch_10 / level_5_branch_11" and "root / level_1_branch_1 / level_2_leaf_1 / level_3_leaf_5" as mentioned above.
[0203] In some embodiments, the determination of the leaf hierarchy includes at least one of the following steps P1 to P7 (not shown in the figure).
[0204] Step P1: Based on the grid information of the leaf section, determine the pivot point and head point of each leaf in the leaf section.
[0205] In some embodiments, when constructing a plant model, the leaves are typically obtained by copying and pasting at least one preset leaf. Therefore, all the leaves in the plant model are based on this at least one preset leaf, and the shapes of these preset leaves are all different.
[0206] For example, at least one preset leaf is selected from the plant model. For example, the pivot point and head point corresponding to each of the at least one preset leaf are determined. For example, after determining the pivot point and head point corresponding to each of the at least one preset leaf, the pivot point and head point of all leaves in the leaf portion of the plant model are determined. For example, the determination of the pivot point and head point corresponding to each of the at least one preset leaf can be configured manually or automatically determined by the target application described above.
[0207] In some embodiments, in response to Figure 14The operation of the control 1430 jumps to display a two-dimensional view (UV view) of the plant model. In this two-dimensional view, the pivot point of the leaf is selected. In some embodiments, in response to... Figure 14 The operation of control 1440 jumps to display a two-dimensional view of the plant model. In this two-dimensional view, the head point of a leaf is selected. For example, as shown... Figure 18 In the two-dimensional view 1800 of the leaves shown, the pivot point of one leaf is 1810, and the head point of the leaf is 1820.
[0208] Step P2: On each branch, determine the first face that is closest to the pivot point of each leaf.
[0209] For example, here a face refers to a face on the grid of a branch. Once the first face is determined, the branch on which that first face is located is also determined.
[0210] For example, after determining the hierarchy of all branches in the aforementioned branch section, the hierarchical structure data of the leaves is then determined. For example, from each branch, the first face closest to the pivot point of each leaf is determined. For example, all branches are traversed to determine the first face closest to the pivot point of each leaf. The first face closest to the pivot point of different leaves is on different branches.
[0211] Step P3: If the distance between the pivot point of the leaf and the first face corresponding to the leaf is less than the first threshold, the leaf is determined to be a sub-level leaf of the branch where the first face corresponding to the leaf is located, and the level of the leaf is the next level of the branch where the first face corresponding to the leaf is located.
[0212] For example, if the distance between the pivot point of a leaf and the first face corresponding to the leaf is less than a first threshold, the leaf is determined to be a sub-level leaf of the branch containing the first face, and the level of the leaf is the next level of the branch containing the first face. For example, if the level of the branch containing the first face is h, then the level of the leaf is h+1.
[0213] For example, during the first iteration of the process targeting the leaf portion, step P3 is performed. That is, the first batch of leaves growing from the branch is determined.
[0214] For example, after the first iteration, the levels of some leaves were determined. At this point, the leaves whose levels were determined in step P3 are considered to be the leaves whose levels were determined in step P4.
[0215] Step P4: If the distance between the pivot point of a leaf and the face closest to the pivot point of the leaf is greater than the first threshold, determine the second face closest to the pivot point of each undetermined leaf from the leaves of the determined level.
[0216] For example, here a face refers to a face on the grid of a leaf. Once the second face is determined, the leaf on which that second face is located is also determined.
[0217] For example, if the distance between the pivot point of a leaf and the face closest to the pivot point of the leaf is greater than a first threshold, the second face closest to the pivot point of each leaf of an undetermined level is determined from the leaves or branches of the determined level.
[0218] For example, the "face" here can also refer to a face on the grid of a branch. Once the second face is determined, the branch on which that second face is located is also determined.
[0219] For example, after the first iteration, some leaves may have their levels uncertain, so a second iteration is performed. For example, during the second iteration, steps P4 and P5 are executed. For example, in each iteration, the leaves with determined levels are updated.
[0220] In step P5, if the distance between the pivot point of the leaf and the corresponding second face of the leaf is less than the second threshold, the leaf is determined to be a sub-level leaf of the leaf in the determined layer where the corresponding second face of the leaf is located, and the layer of the leaf is the next layer of the leaf in the determined layer where the corresponding second face of the leaf is located.
[0221] For example, if the distance between the pivot point of a leaf and the corresponding second face of the leaf is less than a second threshold, the leaf is determined to be a sub-level leaf of the leaf in the determined layer where the corresponding second face of the leaf is located, and the layer of the leaf is the next layer of the leaf in the determined layer where the corresponding second face of the leaf is located. For example, if the layer of the leaf in the determined layer where the corresponding second face of the leaf is located is c, then the layer of the leaf is c+1.
[0222] For example, if the distance between the pivot point of a leaf and the corresponding second face of the leaf is less than a second threshold, the leaf is determined to be a sub-level leaf of the branch at the determined level where the corresponding second face of the leaf is located, and the level of the leaf is the next level of the branch at the determined level where the corresponding second face of the leaf is located. For example, if the level of the branch at the determined level where the corresponding second face of the leaf is located is d, then the level of the leaf is d+1.
[0223] Step P6: If the distance between the pivot point of a leaf and the corresponding second face of the leaf is greater than the second threshold, then determine the third face that is closest to the pivot point of each leaf of an undetermined level from the leaves of the determined level, until the hierarchical structure data corresponding to each leaf in the leaf part is determined.
[0224] For example, here a face refers to a face on the grid of a leaf. Once the third face is determined, the leaf on which that third face is located is also determined.
[0225] For example, if the distance between the pivot point of a leaf and the corresponding second face of the leaf is greater than a second threshold, the third face closest to the pivot point of each undetermined leaf is determined again from the leaves or branches of the determined level, until the hierarchical structure data corresponding to each leaf in the leaf part is determined.
[0226] For example, the "face" here can also refer to a face on the grid of a branch. Once the third face is determined, the branch on which that third face is located is also determined.
[0227] For example, iteration stops when the required number of iterations for the leaf portion is met.
[0228] In some embodiments, all leaf meshes and all branches are interleaved once, using the same algorithm as the branch section above. An additional step is to calculate the intersection of the interleaved points and the set of leaf pivot points. This ensures that only leaves interleaved with pivot points are treated as sub-levels. In other words, leaves are always sub-levels of branches, and the highest level of a leaf cannot exceed the highest level of a branch.
[0229] In some embodiments, when searching for leaves at the next level, considering that some leaves may be suspended and cannot be calculated by interleaving, a new algorithm is needed. This algorithm calculates the primitive (face) closest to the parent branch (or parent level leaf) from the pivot point of each leaf, and then passes the ID attribute (identification information) and level information of the found face to the corresponding leaf's mesh to calculate the next level of leaves.
[0230] In some embodiments, this algorithm is encapsulated as the HU_Find_Leaves_by_Dist node. For example, for the leaf section, the hierarchical structure data and pivot point data of all leaves in the leaf section are obtained through 7 iterations.
[0231] Step P7: Determine the pivot point data of each leaf in the leaf section based on the pivot point and head point of each leaf in the leaf section.
[0232] In some embodiments, the pivot point data of a leaf includes the pivot point of the leaf, the growth direction of the leaf, and the length information of the leaf.
[0233] In some embodiments, for the nth leaf (where n is a positive integer), the direction of the line connecting the pivot point and the head point of the nth leaf is determined as the growth direction of the nth leaf. In some embodiments, the direction from the pivot point of the nth leaf to the head point of the nth leaf is determined as the growth direction of the nth leaf.
[0234] In some embodiments, the length information of the nth leaf is determined by the distance between the pivot point and the head point of the nth leaf. In some embodiments, the length information of the nth leaf is determined by the Euclidean distance between the pivot point and the head point of the nth leaf in three-dimensional space.
[0235] Step 450: Determine the hierarchical structure data and pivot point data corresponding to each branch and each leaf as the structural data of the plant.
[0236] Step 460: Based on the plant's structural data, generate a data structure diagram corresponding to the plant model. The data structure diagram is used to generate animations related to the plant.
[0237] In the technical solution provided in this application embodiment, when determining structural data, the trunk is first determined based on the continuity of the grid information. Then, through interleaving calculations, the sub-level branches of the trunk are determined, and further, the sub-level branches of the sub-level branches are determined. This method ensures the accuracy of the determination of hierarchical structure data. Additionally, when determining pivot point data, the growth direction is determined based on the first and second directions, which also ensures the accuracy of the determined generation direction.
[0238] After performing multiple iterations on the tree branch section, combining the hierarchy of the tree branch section with multiple iterations on the leaf section can improve the efficiency and accuracy of extracting structural data from the leaf section.
[0239] Furthermore, in the embodiments of this application, the hierarchy of the plant model can be intuitively displayed through visualization, which is beneficial to improving modification efficiency. See the following explanation of the embodiments.
[0240] Please refer to Figure 5The diagram illustrates a flowchart of a data extraction method provided in another embodiment of this application. The execution entity of this method can be the terminal device 10 described above, or the server 20. In the following method embodiments, for ease of description, the execution entity of each step is described only as a "computer device." The method may include at least one of the following steps (510-540):
[0241] Step 510: Obtain the plant model, which is a three-dimensional model of the plant.
[0242] Step 520: Based on the grid information of the plant model, extract the structural data of the plant in the plant model. The structural data includes hierarchical structure data and pivot point data. The hierarchical structure data represents the levels included in the plant model, and the pivot point data represents the data related to the joint positions of plant growth in the plant model.
[0243] Step 530: Based on the hierarchical data, if the plant's level is greater than the third threshold, adjust the hierarchical data to obtain the adjusted hierarchical data.
[0244] In some embodiments, the adjusted hierarchical data is used in conjunction with pivot point data to generate a data structure diagram corresponding to the plant model.
[0245] In some embodiments, based on hierarchical data, if the number of plant levels is greater than a third threshold, the number of levels in the hierarchical data is reduced to obtain adjusted hierarchical data, such that the number of levels in the adjusted hierarchical data is equal to the third threshold.
[0246] For example, automatic degradation is achieved through the HU_Degrade_Hierarchy node. For example, degradation processing is performed on the strings corresponding to the hierarchical data; demoting by one level will delete the string to the right of the " / ".
[0247] For example, taking the hierarchical structure data as "root / level_1_branch_1 / level_2_branch_9 / level_3_branch_13 / level_4_branch_10 / level_5_branch_11", deleting "level_5_branch_11" means deleting the level_5. For example, "level_5_branch_11" is merged into level_4, meaning that branch_11 is now also level_4.
[0248] In some embodiments, such as Figure 29 As shown, the automatic downgrade is achieved by deleting the string "2910" to the right of " / ".
[0249] In some embodiments, such as Figure 30 As shown, after merging and downgrading, the pivot point of the current level needs to be deleted by checking the box for control 3000.
[0250] In some embodiments, at least two levels of the plant model are merged to obtain adjusted hierarchical data.
[0251] For example, when merging the i-th level and the (i+1)-th level, the branches or leaves of the (i+1)-th level are directly incorporated into the i-th level, that is, the branches or leaves of the original (i+1)-th level and the branches or leaves of the i-th level share the hierarchical structure data of the branches or leaves of the i-th level.
[0252] The technical solution provided in this application improves the efficiency and speed of subsequent model rendering while ensuring model accuracy through downgrading processing.
[0253] In some embodiments, a plant model is shown.
[0254] In some embodiments, in response to an operation on a first control, a step of extracting structural data of plants from a plant model is performed. Exemplarily, this application implements one-click extraction of structural data, automating the extraction process, avoiding the cost of manual configuration, and improving data extraction efficiency.
[0255] In some embodiments, a parameter panel is displayed, which shows at least one level included in the plant model.
[0256] In some embodiments, such as Figure 31 As shown, the parameter panel 3100 displays at least one level 3110 included in the plant model.
[0257] In some embodiments, in response to the operation of selecting a first level in at least one level, the portion of the plant model belonging to the first level is highlighted in the plant model.
[0258] For example, the technical solution provided in this application embodiment enables the preview of each layer in the plant model. Through intuitive preview, it is possible to determine whether the number of layers is correct and whether the layer merging is correct.
[0259] For example, in this embodiment of the application, each level can be viewed directly on the parameter panel, without having to search through complex nested nodes, thus improving the efficiency of data viewing.
[0260] In some embodiments, in response to the operation of selecting a second level in at least one level, if a target branch or target leaf belonging to the second level in the plant model is selected, a rendered screen showing the reverse growth from the target branch or target leaf to the trunk of the plant model is displayed; wherein the rendered screen is used to verify the first level.
[0261] For example, by coloring different levels separately and filtering out the parent-level grid using the aforementioned degradation tool, a chain-like visualization result is obtained recursively, such as... Figure 33 3300 and Figure 34 The 3400 is shown.
[0262] For example, through the Find Parent Branch node (such as...) Figure 32 As shown in Figure 3200, hierarchical data can be examined intuitively by directly rendering the parent-level grid of each level. This method is crucial for merging levels. Through rendering animations, it's possible to intuitively determine how and whether the merge was successful. The advantage of this visualization method is that it provides a clear view of the merging process. For example, when merging from level 0 to level 1, you can see the color change; level 0 and level 1 become the same color, indicating a successful merge. Figure 35 The 3500 is shown.
[0263] For example, adjusted structure data is obtained based on the adjusted hierarchical structure data.
[0264] Step 540: Based on the adjusted hierarchical structure data of the plants, generate a data structure diagram corresponding to the plant model. The data structure diagram is used to generate animations related to the plants.
[0265] In some embodiments, after merging to level four, i.e., obtaining the adjusted structural data, such as Figure 14 As shown, in response to an operation on the export control 1450, a data structure diagram corresponding to the plant model is obtained. For example, in response to a user clicking a button, a new model asset and two data structure diagrams are exported.
[0266] In some embodiments, such as Figure 36 As shown, you can view the trunks and branches at different levels.
[0267] In some embodiments, the technical solution provided in this application can be used to view the final hierarchical structure data and pivot point data to determine whether they have been merged to level four. For example... Figure 37 As shown in 3710, the levels can be merged by unchecking the box. Currently, the tree has been merged to level 4.
[0268] In some embodiments, before exporting, the tool retrieves information such as normals, vertex colors, and UV1 values from the old asset using the pivot point ID and face ID. For example, by customizing the export node, the UV2 attribute generated for the new asset is passed to the LOD.
[0269] The technical solution provided in this application simplifies plant morphing and interaction processes. Especially for a pre-made game scene, it eliminates the need to recreate assets due to the enormous workload of manually configuring structural data. Therefore, this application improves production efficiency and enhances animation rendering effects.
[0270] In addition, the embodiments of this application include the following aspects to further simplify the workflow. Firstly, it automatically generates the LOD of plants and allows the LOD to inherit UV information. Secondly, it automatically preserves the vertex colors, colliders, normals, and LODs of the original assets, eliminating the need for manual reconfiguration. Thirdly, when reconstructing assets, it automatically removes some non-compliant, suspended leaves or branches. Fourthly, when dealing with situations where the maximum is four levels, it supports merging multiple levels and automatically calculates the new parent-child relationships after merging, without requiring manual configuration or processing. Finally, the tool's usage logic is uniquely designed. By determining the existence of attributes, associating parameters, encapsulating, and locking, the number of key parameters is reduced, significantly lowering the difficulty of use. Only a few basic parameters need to be configured to automatically calculate and generate textures with a single click.
[0271] In summary, the technical solution provided in this application enables automatic reverse asset calculation. For example, it helps artists perform reverse calculations on plant assets, automatically generating structural data to replace manual configuration. Furthermore, this application provides visualization and flexible adjustment of structural data: the calculation results can be visualized intuitively, allowing artists to subjectively decide how to merge layers and which pivot points to activate based on the visual presentation, ultimately determining the final artistic representation of the asset in Unreal Engine.
[0272] This application integrates these two approaches and workflows into a single tool. Artists do not need prior training; they can generate the desired data structure diagram with just the following simple steps. For example, in Houdini, the initial tool, the Tree Reconstruction node, is invoked. Clicking the button and following the prompts, the plant assets exported from software such as Unreal Engine are imported, and the tool automatically configures the new asset names. Further, the groups of leaves and base trunks are selected in the UV view and 3D view, respectively. Only these two steps require manual configuration. However, the UV view and base trunks have high distinguishability, making selection easier and faster. There is no need to select from dense foliage. The tool automatically calculates the structural data and generates the first version. Intuitive visualization tools are used for verification, allowing for subjective adjustments based on subsequent effect requirements to compress the calculated layers to no more than four (trees typically have more than seven). Clicking the output button simultaneously outputs the reconstructed new assets (including new LODs, colliders, normals, and vertex colors) and the data structure diagram.
[0273] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0274] Please refer to Figure 38 This diagram illustrates a block diagram of a data extraction apparatus according to an embodiment of this application. The apparatus has the function of implementing the aforementioned information display method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be the computer device described above, or it can be installed within a computer device. For example... Figure 38 As shown, the device 3800 may include: a model acquisition module 3810, a data extraction module 3820, and a graph generation module 3830.
[0275] The model acquisition module 3810 is used to acquire a plant model, which is a three-dimensional model of a plant.
[0276] The data extraction module 3820 is used to extract the structural data of the plant in the plant model based on the grid information of the plant model. The structural data includes hierarchical structure data and pivot point data. The hierarchical structure data represents the levels included in the plant model, and the pivot point data represents data related to the joint positions of the plant growth in the plant model.
[0277] The graph generation module 3830 is used to generate a data structure graph corresponding to the plant model based on the structural data of the plant. The data structure graph is used to generate animations related to the plant.
[0278] In some embodiments, the data extraction module 3820 is used to determine the leaf portion and branch portion in the plant model; determine the hierarchical structure data and pivot point data corresponding to each branch in the branch portion according to the grid information of the branch portion; determine the hierarchical structure data and pivot point data corresponding to each leaf in the leaf portion according to the hierarchical structure data corresponding to each branch and the grid information of the leaf portion; and determine the hierarchical structure data and pivot point data corresponding to each branch and each leaf as the structural data of the plant.
[0279] In some embodiments, the hierarchical data corresponding to the branch includes the level of the branch and the parent level branch corresponding to the branch, wherein the parent level branch refers to the branch at the next higher level connected to the branch.
[0280] In some embodiments, the data extraction module 3820 is configured to, in the i-th iteration, for the k-th branch in the (i-1)-th level, remove the branches from the first level to the (i-1)-th level from the branch portion to obtain the branch portion after the i-th separation, where i is an integer greater than 1 and k is a positive integer; determine the branches connected to the k-th branch from the branch portion after the i-th separation based on the grid information of the k-th branch and the grid information of the branch portion after the i-th separation; and determine the branches connected to the k-th branch as... The sub-level branches of the k-th branch, where the k-th branch is the parent-level branch corresponding to the branch connected to the k-th branch, and the level of the branch connected to the k-th branch is the i-th level; traverse all branches in the (i-1)-th level until all branches in the i-th level are found; determine the pivot point data of each branch in the i-th level based on the grid information of each branch in the i-th level; wherein, in the first iteration, the branch in the first level is the trunk part determined from the branch part.
[0281] In some embodiments, the data extraction module 3820 is used to extend the mesh information of the k-th branch outward along the normal direction to obtain the extended mesh information of the k-th branch; determine at least one intersection point that intersects with the mesh information of the extended k-th branch from the mesh information of the branch portion after the i-th separation; and determine the branch connected to the k-th branch from the branch portion after the i-th separation based on the at least one intersection point.
[0282] In some embodiments, the pivot point data of the branch includes the pivot point of the branch, the growth direction of the branch, and the length information of the branch;
[0283] For the m-th branch in the i-th level of branches, where m is a positive integer, the data extraction module 3820 is used to determine the point cloud corresponding to the m-th branch based on the grid information of the m-th branch; determine the points with the maximum and minimum distances to the parent level branches corresponding to the m-th branch from the point cloud, determine the point with the minimum distance as the pivot point of the m-th branch, and determine the point with the maximum distance as the head point of the m-th branch; and determine the growth direction and length information of the m-th branch based on the pivot point and the head point of the m-th branch.
[0284] In some embodiments, the data extraction module 3820 is used to determine the growth direction of the m-th branch based on the direction of the line connecting the pivot point of the m-th branch and the head point of the m-th branch; and to determine the length information of the m-th branch by the distance between the pivot point of the m-th branch and the head point of the m-th branch.
[0285] In some embodiments, the data extraction module 3820 is used to determine the direction of the line connecting the pivot point of the m-th branch and the head point of the m-th branch as the first direction of the m-th branch; determine the direction bounding box of the m-th branch, and determine the direction of the longest side of the direction bounding box as the second direction of the m-th branch; and interpolate the first direction and the second direction to obtain the growth direction of the m-th branch.
[0286] In some embodiments, the data extraction module 3820 is configured to: determine the pivot point and head point of each leaf in the leaf portion based on the grid information of the leaf portion; determine the first face closest to the pivot point of each leaf from each branch; if the distance between the pivot point of a leaf and the first face corresponding to the leaf is less than a first threshold, determine that the leaf is a sub-level leaf of the branch containing the first face of the leaf, and the level of the leaf is the next level of the branch containing the first face of the leaf; if the distance between the pivot point of a leaf and the face closest to the pivot point of the leaf is greater than a first threshold, determine the pivot point closest to each undetermined level leaf from the leaves of the determined level. The closest second face; if the distance between the pivot point of the leaf and the corresponding second face is less than a second threshold, the leaf is determined to be a sub-level leaf of the leaf in the determined level of the leaf corresponding to the second face, and the level of the leaf is the next level of the leaf in the determined level of the leaf corresponding to the second face; if the distance between the pivot point of the leaf and the corresponding second face is greater than the second threshold, the closest third face to the pivot point of each undetermined level leaf is determined again from the leaves in the determined level, until the hierarchical structure data corresponding to each leaf in the leaf part is determined; the pivot point data of each leaf in the leaf part is determined according to the pivot point and head point of each leaf in the leaf part.
[0287] In some embodiments, the pivot point data of the leaf includes the pivot point of the leaf, the growth direction of the leaf, and the length information of the leaf;
[0288] For the nth leaf among all the leaves, where n is a positive integer, the data extraction module 3820 is used to determine the growth direction of the nth leaf by the direction of the line connecting the pivot point and the head point of the nth leaf; and to determine the length information of the nth leaf by the distance between the pivot point and the head point of the nth leaf.
[0289] In some embodiments, the data extraction module 3820 is used to determine the leaf and branch parts in the plant model based on a two-dimensional view of the plant model; or, based on the material information of each part in the plant model, to determine the leaf and branch parts in the plant model; or, based on the grouping information of each part in the plant model, to determine the leaf and branch parts in the plant model.
[0290] In some embodiments, the data extraction module 3820 is used to adjust the hierarchical structure data based on the hierarchical structure data when the plant's level is greater than a third threshold, to obtain adjusted hierarchical structure data; wherein the adjusted hierarchical structure data is used to combine with the pivot point data to generate a data structure diagram corresponding to the plant model.
[0291] In some embodiments, the data extraction module 3820 is used to merge at least two levels of the plant model to obtain the adjusted hierarchical structure data.
[0292] In some embodiments, such as Figure 39 As shown, the device also includes a display module 3840.
[0293] In some embodiments, the display module 3840 is used to display the plant model.
[0294] In some embodiments, in response to an operation on the first control, the data extraction module 3820 performs the step of extracting structural data of the plant in the plant model.
[0295] In some embodiments, the display module 3840 is used to display a parameter panel, which displays at least one level included in the plant model.
[0296] Display module 3840 is configured to, in response to an operation of selecting a first level among the at least one levels, highlight the portion of the plant model belonging to the first level in the plant model.
[0297] In some embodiments, the display module 3840 is configured to, in response to an operation of selecting a second level in the at least one level, display a rendered image of a target branch or target leaf growing backward from the target branch or target leaf to the trunk of the plant model when the target branch or target leaf belonging to the second level in the plant model is selected; wherein the rendered image is used to verify the first level.
[0298] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0299] Please refer to Figure 40This diagram illustrates a structural block diagram of a computer device 4000 provided in one embodiment of this application. The computer device 4000 can be any electronic device capable of data calculation, processing, and storage. The computer device 4000 can be used to implement the information display method provided in the above embodiments.
[0300] Typically, a computer device 4000 includes a processor 4001 and a memory 4002.
[0301] Processor 4001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 4001 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 4001 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 4001 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 4001 may also include an AI processor, which is used to handle computational operations related to machine learning.
[0302] The memory 4002 may include one or more computer-readable storage media, which may be non-transitory. The memory 4002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 4002 are used to store a computer program configured to be executed by one or more processors to implement the above-described information display method.
[0303] Those skilled in the art will understand that Figure 40 The structure shown does not constitute a limitation on the computer device 4000, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0304] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and the computer program, when executed by a processor, implements the above-described data extraction method. Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0305] In an exemplary embodiment, a computer program product is also provided, the computer program product including a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the data extraction method described above.
[0306] It should be noted that the collection and processing of relevant data (including plant models, etc.) in this application should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0307] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.
[0308] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data extraction method, characterized by, The method comprises: acquiring a plant model, the plant model being a three-dimensional model of a plant; extracting structural data of the plant in the plant model according to mesh information of the plant model, the structural data comprising hierarchical structure data and pivot point data, the hierarchical structure data representing a hierarchy included in the plant model, and the pivot point data representing data related to joint positions at which the plant grows in the plant model; generating a data structure diagram corresponding to the plant model based on the structural data of the plant, the data structure diagram being used to generate an animation related to the plant.
2. The method of claim 1, wherein, The extracting of the structural data of the plant in the plant model according to the mesh information of the plant model comprises: determining a leaf part and a branch part in the plant model; determining hierarchical structure data and pivot point data corresponding to each branch in the branch part according to mesh information of the branch part; determining hierarchical structure data and pivot point data corresponding to each leaf in the leaf part according to the hierarchical structure data corresponding to each branch and the mesh information of the leaf part; determining the hierarchical structure data and the pivot point data corresponding to each branch and the hierarchical structure data and the pivot point data corresponding to each leaf as the structural data of the plant.
3. The method of claim 2, wherein, The hierarchical structure data corresponding to the branch comprises a hierarchy of the branch and a parent hierarchy branch corresponding to the branch, the parent hierarchy branch corresponding to the branch being a branch at a previous hierarchy level connected to the branch; The determining of the hierarchical structure data and the pivot point data corresponding to each branch in the branch part according to the mesh information of the branch part comprises: in the i th iteration, removing branches from a 1 st hierarchy level to an i-1 st hierarchy level from the branch part to obtain a branch part after the i th separation for a k th branch in the i-1 st hierarchy level, i being an integer greater than 1, and k being a positive integer; determining branches connected to the k th branch from the branch part after the i th separation according to mesh information of the k th branch and mesh information of the branch part after the i th separation; determining the branches connected to the k th branch as child hierarchy branches of the k th branch, the k th branch being a parent hierarchy branch corresponding to the branches connected to the k th branch, and the branches connected to the k th branch being at the i th hierarchy level; traversing all branches in the i-1 st hierarchy level until all branches at the i th hierarchy level are found; determining pivot point data of each branch at the i th hierarchy level according to mesh information of each branch at the i th hierarchy level. In the 1 st iteration, the branches at the 1 st hierarchy level are determined from the branch part.
4. The method of claim 3, wherein, The determining of the branches connected to the k th branch from the branch part after the i th separation according to the mesh information of the k th branch and the mesh information of the branch part after the i th separation comprises: Expand the grid information of the kth branch in the normal direction to obtain the expanded grid information of the kth branch; Determine at least one intersection point intersecting the expanded grid information of the kth branch from the grid information of the ith separated branch part; Determine a branch connected to the kth branch from the ith separated branch part based on the at least one intersection point.
5. The method according to claim 3 or 4, characterized in that, The pivot point data of the branch includes a pivot point of the branch, a growth direction of the branch, and length information of the branch; For the mth branch in the ith level of branches, m is a positive integer, and the pivot point data of each branch in the ith level of branches is determined according to the grid information of each branch in the ith level of branches, including: Determine the point cloud corresponding to the mth branch according to the grid information of the mth branch; Determine the maximum and minimum distance points of the parent level branch corresponding to the mth branch from the point cloud, determine the minimum distance point as the pivot point of the mth branch, and determine the maximum distance point as the head point of the mth branch; Determine the growth direction of the mth branch and the length information of the mth branch according to the pivot point of the mth branch and the head point of the mth branch.
6. The method of claim 5, wherein, The determination of the growth direction of the mth branch and the length information of the mth branch according to the pivot point of the mth branch and the head point of the mth branch includes: Determine the growth direction of the mth branch based on the direction of the line segment between the pivot point of the mth branch and the head point of the mth branch; Determine the length information of the mth branch based on the distance between the pivot point of the mth branch and the head point of the mth branch.
7. The method of claim 6, wherein, The determination of the growth direction of the mth branch based on the direction of the line segment between the pivot point of the mth branch and the head point of the mth branch includes: Determine the first direction of the mth branch as the direction of the line segment between the pivot point of the mth branch and the head point of the mth branch; Determine the second direction of the mth branch as the direction of the longest side of the direction bounding box in which the mth branch is located; Interpolate the first direction and the second direction to obtain the growth direction of the mth branch.
8. The method according to any one of claims 2 to 7, characterized in that, The determination of the hierarchical structure data and the pivot point data of each leaf in the leaf part according to the hierarchical structure data corresponding to each branch and the grid information of the leaf part includes: Determine the pivot point and the head point of each leaf in the leaf part according to the grid information of the leaf part; Determine the first face closest to the pivot point of each leaf from each branch; In the case that the distance between the pivot point of the leaf and the first face corresponding to the leaf is less than a first threshold, determine the leaf as a child level leaf of the branch where the first face corresponding to the leaf is located, and the level of the leaf is the next level of the branch where the first face corresponding to the leaf is located. in a case where a distance between the pivot point of the leaf and a second face closest to the pivot point of the leaf is greater than a first threshold value, determining, from the leaves of the determined level, a second face closest to the pivot point of each leaf of an undetermined level, respectively; in a case where a distance between the pivot point of the leaf and the second face corresponding to the leaf is less than a second threshold value, determining the leaf as a sub-level leaf of the leaf of the determined level to which the second face corresponding to the leaf belongs, the level of the leaf being a next level of the leaf of the determined level to which the second face corresponding to the leaf belongs; in a case where the distance between the pivot point of the leaf and the second face corresponding to the leaf is greater than the second threshold value, determining, again from the leaves of the determined level, a third face closest to the pivot point of each leaf of an undetermined level, respectively, until the hierarchical structure data corresponding to each leaf in the leaf part is determined; determining, according to the pivot point and the head point of each leaf in the leaf part, the pivot point data of each leaf in the leaf part.
9. The method of claim 8, wherein, The pivot point data of the leaf includes the pivot point of the leaf, the growth direction of the leaf, and the length information of the leaf. For the nth leaf in the leaves, n being a positive integer, the determining, according to the pivot point and the head point of each leaf in the leaf part, the pivot point data of each leaf in the leaf part, includes: determining a direction of a line connecting the pivot point of the nth leaf and the head point of the nth leaf as the growth direction of the nth leaf; determining a distance between the pivot point of the nth leaf and the head point of the nth leaf as the length information of the nth leaf.
10. The method according to any one of claims 2 to 9, characterized in that, The determining the leaf part and the branch part in the plant model includes: determining the leaf part and the branch part in the plant model according to a two-dimensional view of the plant model; or, determining the leaf part and the branch part in the plant model according to material information of each part in the plant model; or, determining the leaf part and the branch part in the plant model according to grouping information of each part in the plant model.
11. The method according to any one of claims 1 to 10, characterized in that, The method further includes: adjusting the hierarchical structure data to obtain adjusted hierarchical structure data, based on the hierarchical structure data, in a case where the level of the plant is greater than a third threshold value; wherein the adjusted hierarchical structure data is used to generate a data structure diagram corresponding to the plant model in combination with the pivot point data.
12. The method of claim 11, wherein, The adjusting the hierarchical structure data to obtain adjusted hierarchical structure data includes: merging at least two levels of the plant model to obtain the adjusted hierarchical structure data.
13. The method according to any one of claims 1 to 12, characterized in that, The method further includes: displaying the plant model; in response to an operation on a first control, performing the step of extracting the structure data of the plant in the plant model; displaying a parameter panel in which at least one level included in the plant model is displayed; in response to an operation of selecting a first level in the at least one level, highlighting, in the plant model, a part belonging to the first level in the plant model.
14. The method of claim 13, wherein, The method further includes: In response to an operation of selecting a second level in the at least one level, a rendering picture is displayed, which is grown from a target branch or a target leaf belonging to the second level in the plant model to a trunk part of the plant model, in a case that the target branch or the target leaf is selected; The rendering picture is used for verifying the first level.
15. A data extraction apparatus characterized by comprising: The apparatus comprises: a model obtaining module configured to obtain a plant model, the plant model being a three-dimensional model of a plant; a data extracting module configured to extract structure data of the plant in the plant model according to mesh information of the plant model, the structure data comprising hierarchical structure data and pivot point data, the hierarchical structure data representing levels included in the plant model, and the pivot point data representing data related to joint positions of the plant in the plant model; a graph generating module configured to generate a data structure graph corresponding to the plant model based on the structure data of the plant, the data structure graph being used for generating an animation related to the plant.
16. A computer device, comprising: The computer device comprises a processor and a memory, the memory storing a computer program, and the processor is configured to execute the computer program to implement the method according to any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the method according to any one of claims 1 to 14.
18. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is loaded and executed by a processor to implement the method according to any one of claims 1 to 14.
