Three-dimensional tree model generation method and device, electronic equipment and storage medium

By dynamically adjusting the origin and node coordinates in the tree dataset and combining with the path planning algorithm, a three-dimensional tree model is generated, which solves the problems of insufficient customization capabilities of random generation models and low manual construction efficiency in the existing technology, and achieves high efficiency and naturalness tree structure generation.

CN119169181APending Publication Date: 2024-12-20ZHEJIANG TONGHUASHUN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411136817.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In the existing three-dimensional tree generation methods, it is difficult for the random generation model to retain customization capabilities, resulting in the generated tree structure not natural enough; while manual construction is inefficient.

Method used

By obtaining the tree data set, setting the origin coordinates, determining the trunk length and node data, creating path and pipeline buffer geometry, generating a three-dimensional tree model, combining the path planning algorithm and offset of node data, dynamically adjusting node coordinates to achieve detailed results Natural tree structure generation.

Benefits of technology

On the basis of retaining customization capabilities, the generation efficiency of the three-dimensional tree model is improved, and the detailed and natural tree structure can be generated without the participation of manual designers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169181A_ABST
    Figure CN119169181A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional tree model generation method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a tree data set, the tree data set comprises a tree trunk length and at least one node data set, and the node data set comprises at least one node data; setting coordinates of the first original point, and determining coordinates of a second original point based on the coordinates of the first original point and the trunk length; determining at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; creating a path between the first origin, the second origin and the at least one node; and creating a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method, device, electronic device and storage medium for generating a three-dimensional tree model. Background Art

[0002] At present, tree generation schemes in three-dimensional scenes are generally divided into two categories. The first category is pre-generated models, which generate tree models during the development process and then load these models during the software operation process. For example, SpeedTree (a modeling software) and SketchUp (a three-dimensional design software) 3D plant generation plug-in Tree Maker (a three-dimensional plant generation plug-in) can randomly generate some tree models, or let designers use C4D (a modeling software) and other three-dimensional design software to manually design tree models. The second category is to directly generate models during the software operation process through random generation algorithms, such as the two-dimensional tree generation algorithm of Canvas (a tag in HTML5) based on P5.js (a JavaScript (a programming language) function library), which can generate tree-like geometric structures online. Randomly generating three-dimensional tree models will lose some customization capabilities for tree models, making it difficult to generate detailed and natural tree structures, and if designers are asked to build them manually, the efficiency is low. Summary of the invention

[0003] The present application provides a method, device, electronic device and storage medium for generating a three-dimensional tree model.

[0004] An embodiment of the present application provides a method for generating a three-dimensional tree model, the method comprising:

[0005] Obtaining a tree data set, wherein the tree data set includes a trunk length and at least one node data group, wherein the node data group includes the at least one node data;

[0006] Setting the coordinates of a first origin, and determining the coordinates of a second origin based on the coordinates of the first origin and the length of the tree trunk;

[0007] Determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group;

[0008] creating a path between the first origin, the second origin and the at least one node;

[0009] A pipeline buffer geometry is created based on the path to obtain a three-dimensional tree model.

[0010] Wherein, determining the second origin based on the first origin and the trunk length includes:

[0011] Determine the ordinate of the second origin based on the ordinate of the first origin and the length of the tree trunk;

[0012] The second origin is determined based on the longitudinal coordinates of the first origin and the second origin.

[0013] Wherein, determining at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group includes:

[0014] Determine the parent node corresponding to the node data;

[0015] Obtaining the coordinates of the parent node corresponding to the node data;

[0016] The coordinates of the parent node corresponding to the node data are adjusted based on the node data to obtain the coordinates of the node corresponding to the node data.

[0017] The adjusting the coordinates of the parent node corresponding to the node data based on the node data to obtain the coordinates of the node corresponding to the node data includes:

[0018] Adjusting the horizontal coordinate of the corresponding parent node based on the horizontal expansion radius in the node data to obtain the horizontal coordinate of the node;

[0019] Adjusting the vertical coordinate of the corresponding parent node based on the vertical expansion depth in the node data to obtain the vertical coordinate of the node;

[0020] Determine candidate coordinates of the node based on the abscissa, ordinate and vertical coordinate of the node and the vertical coordinate of the corresponding parent node;

[0021] The candidate coordinates of the node are rotated by a control angle in a preset direction with the vertical line of the corresponding parent node as the center to obtain the coordinates of the node. The node data also includes the control angle. The coordinates of the node are the coordinates of the candidate coordinates after the rotation is completed.

[0022] The step of creating a path between the first origin, the second origin, and the at least one node includes:

[0023] Determine at least one child node of the node;

[0024] The node is connected to at least one child node of the node to obtain a path between the node and at least one child node of the node.

[0025] The step of creating a pipeline buffer geometry based on the path to obtain a three-dimensional tree model includes:

[0026] determining pipeline parameters of the path based on the tree data set;

[0027] A pipeline buffer geometry of the path is created based on the pipeline parameters to obtain the three-dimensional tree model.

[0028] The method further comprises:

[0029] Selecting at least one intermediate node in the path;

[0030] Adjusting the horizontal coordinate, the vertical coordinate and / or the vertical coordinate of the at least one intermediate node based on a preset range to obtain at least one corresponding newly added node;

[0031] The nodes at both ends of the path are connected to the at least one newly added node to obtain a new path.

[0032] Another aspect of the present application provides a three-dimensional tree model generation device, the device comprising:

[0033] A collection module, used for obtaining a tree data set, wherein the tree data set includes a trunk length and at least one node data group, wherein the node data group includes the at least one node data;

[0034] a calculation module, configured to set the coordinates of a first origin, and determine the coordinates of a second origin based on the coordinates of the first origin and the length of the tree trunk; and determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group;

[0035] a processing module, configured to create a path between the first origin, the second origin and the at least one node;

[0036] The rendering module is used to create a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

[0037] In another aspect, the present application provides an electronic device, comprising: a collection device and a processor, wherein the collection device and the processor are electrically connected;

[0038] The acquisition device obtains a tree-like data set;

[0039] The processor sets the coordinates of the first origin, and determines the coordinates of the second origin based on the coordinates of the first origin and the length of the trunk; determines at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; creates a path between the first origin, the second origin and the at least one node; and creates a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

[0040] On the other hand, the present application provides a computer-readable storage medium, which stores a computer program, wherein the computer program is used to obtain a tree data set; set the coordinates of a first origin, and determine the coordinates of a second origin based on the coordinates of the first origin and the trunk length; determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; create a path between the first origin, the second origin and the at least one node; and create a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

[0041] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:

[0043] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0044] Figure 1 A flowchart of a method for generating a three-dimensional tree model according to an embodiment of the present application is shown;

[0045] Figure 2 A flowchart of a method for generating a three-dimensional tree model according to another embodiment of the present application is shown;

[0046] Figure 3 A flowchart of a method for generating a three-dimensional tree model according to another embodiment of the present application is shown;

[0047] Figure 4 A flowchart of a method for generating a three-dimensional tree model according to another embodiment of the present application is shown;

[0048] Figure 5 A schematic diagram showing a method of determining the coordinates of a first node based on candidate coordinates of the first node according to an embodiment of the present application is shown;

[0049] Figure 6 A flowchart of a method for generating a three-dimensional tree model according to another embodiment of the present application is shown;

[0050] Figure 7 A schematic diagram showing a path connection according to an embodiment of the present application;

[0051] Figure 8 A flowchart of a method for generating a three-dimensional tree model according to another embodiment of the present application is shown;

[0052] Fig. 9 A flowchart of a method for generating a three-dimensional tree model according to another embodiment of the present application is shown;

[0053] Fig.10 A schematic diagram showing adding a new node to a path and generating a new path according to an embodiment of the present application is shown;

[0054] Fig.11 A schematic diagram of the structure of a three-dimensional tree model generating device according to an embodiment of the present application is shown;

[0055] Fig.12 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0056] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0057] In order to retain the ability to customize the tree model and generate a detailed and natural tree structure while improving the efficiency of generating the tree structure, an embodiment of the present application provides a three-dimensional tree model generation method, such as Figure 1 As shown, the method includes:

[0058] Step 101: Obtain a tree data set, wherein the tree data set includes a trunk length and at least one node data group, wherein the node data group includes the at least one node data.

[0059] The tree data set includes a trunk length and at least one node data set.

[0060] The trunk length is set to 10. The node data group includes at least one node data. The node data at least includes data such as node identification, data type, child node identification and node parameters. Each node data group represents a data group of a tree-like bifurcation structure starting from any point in the trunk.

[0061] Step 102, setting the coordinates of a first origin, and determining the coordinates of a second origin based on the coordinates of the first origin and the length of the tree trunk.

[0062] In this embodiment, the first origin can be set as the root origin or the branch origin. When the first origin is set as the root origin, the second origin is set as the branch origin. The branch origin and the root origin are the two end points of the trunk in the tree model. Therefore, after setting the coordinates of the first origin, the second origin can be determined based on the first origin and the trunk length. That is, the branch origin can be determined based on the root origin and the trunk length, or the root origin can be determined based on the branch origin and the trunk length.

[0063] Step 103: determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group.

[0064] Since the position of trees in the three-dimensional coordinate system changes dynamically when generating a tree model, the coordinates of each node are not directly saved in the tree data set, but the offset of each node and its parent node is saved (stored in the node parameters). Therefore, after determining the coordinates of the first origin in the three-dimensional coordinate system and then determining the second origin based on the length of the trunk, traverse at least one node data in the node data group. For the first node data in the node data group, the offset of the node corresponding to the node data relative to the first origin or the second origin (i.e., the parent node of the node corresponding to the first node data) is recorded, and the coordinates of the node corresponding to the node data can be determined based on the coordinates of the first origin or the coordinates of the second origin, and the offset of the node corresponding to the node data relative to the first origin or the second origin. For other node data in the node data group, the coordinates of the node corresponding to the node data can be determined based on the coordinates of its parent node and its offset relative to the parent node coordinates. After traversing all the node data, at least one node corresponding to the node data group is obtained.

[0065] Step 104: Create a path between the first origin, the second origin and the at least one node.

[0066] After we determine the coordinates of the first origin, the second origin and at least one node in the three-dimensional coordinate system, we can use a path planning algorithm to create a path connecting all the nodes based on the coordinates of these nodes.

[0067] In this embodiment, the path planning algorithm may use algorithms such as Bezier curve, B-spline curve, Hermite curve, and Cardinal curve.

[0068] Step 106: Create a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

[0069] A path is just a straight line or curve, so it is necessary to use the path as the center to create a cylinder with a radius, that is, the pipeline buffer geometry, and finally obtain a three-dimensional tree model corresponding to the tree data set.

[0070] In the above scheme, the trunk length can be used to determine the second origin after setting the coordinates of the first origin, and the trunk of the tree model can be determined on this basis. Then, based on the offset of each node and its parent node, the coordinates of each node in the three-dimensional coordinate system are determined, and then the path and pipeline buffer geometry are created to obtain a three-dimensional tree model. Therefore, the designer does not need to manually build it, and the three-dimensional tree model can be efficiently generated while retaining the customization ability of the tree model and generating a detailed and natural tree structure.

[0071] In an example of the present application, a method for generating a three-dimensional tree model is also provided. Figure 2 As shown, the determining the second origin based on the first origin and the trunk length includes:

[0072] Step 201, determining the ordinate of the second origin based on the ordinate of the first origin and the length of the tree trunk.

[0073] For example, the first origin is set to the root origin, and the coordinates of the first origin are set to P0 = (x, y, z). The ordinate of the first origin is y. Based on the trunk length l0, the ordinate of the second origin can be determined, that is, the ordinate of the branch origin is y+l0.

[0074] For another example, the first origin is set as the branch origin, and the coordinates of the first origin are set to P0=(x, y, z). The ordinate of the first origin is y. Based on the trunk length l0, the ordinate of the second origin can be determined, that is, the ordinate of the root origin is y-l0.

[0075] Step 202: determine the second origin based on the longitudinal coordinates of the first origin and the second origin.

[0076] The horizontal coordinate and the vertical coordinate of the first origin are determined as the horizontal coordinate and the vertical coordinate of the second origin, and then combined with the vertical coordinate of the second origin to form the coordinates of the second origin.

[0077] For example, the coordinates of the first origin are P0=(x, y, z), then the horizontal coordinate of the first origin is x, the vertical coordinate is z, and the vertical coordinate of the second origin is y+l0, then the coordinates of the second origin are P1=(x, y+l0, z).

[0078] In the above scheme, since the position of the trees in the three-dimensional coordinate system changes dynamically when the tree model is generated, it is not necessary to directly save the coordinates of the first origin and the second origin in the tree data set, and only the trunk length needs to be saved. When generating the tree model, by determining the position of the tree generation (i.e., determining the coordinates of the first origin in the three-dimensional coordinate system), the corresponding second origin coordinates can be determined, and then the trunk of the tree model can be determined.

[0079] In an example of the present application, a method for generating a three-dimensional tree model is also provided. Figure 3 As shown, the determining at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group includes:

[0080] Step 301: determine the parent node corresponding to the node data.

[0081] The parent node corresponding to the node data can be determined by the node parameters in the node data, or the child node of the parent node can be determined by the child node identifier in the node parameters corresponding to the parent node. The parent node corresponding to the node data can be the first origin or the second origin, or other nodes.

[0082] For example, the first origin has three child nodes, namely, node A, node B, and node C. The child node identifier in the node data of node A indicates that node A has two child nodes, namely, node D and node E. The child node identifiers in the node data of nodes B, C, D, and E respectively indicate that nodes B, C, D, and E have no child nodes.

[0083] Step 302: Obtain the coordinates of the parent node corresponding to the node data.

[0084] After the parent node corresponding to the node data is determined, the coordinates of the parent node can be obtained.

[0085] Step 303: adjusting the coordinates of the parent node corresponding to the node data based on the node data to obtain the coordinates of the node corresponding to the node data.

[0086] The node parameters in the node data include the offset of the node relative to its parent node. Based on the offset and the coordinates of the parent node, the coordinates of the node can be determined.

[0087] In the above scheme, by saving the offset of the node relative to its parent node in the node data, when generating the tree model, the coordinates of each node in the tree model can be determined based on the dynamically set origin coordinates, thereby accurately generating the tree model.

[0088] In an example of the present application, a method for generating a three-dimensional tree model is also provided. Figure 4As shown, the adjusting the coordinates of the parent node corresponding to the node data based on the node data to obtain the coordinates of the node corresponding to the node data includes:

[0089] Step 401: Adjust the horizontal coordinate of the corresponding parent node based on the horizontal expansion radius in the node data to obtain the horizontal coordinate of the node.

[0090] The horizontal expansion radius refers to the offset of the horizontal coordinate of the node data relative to the horizontal coordinate of its parent node.

[0091] Step 402: adjusting the vertical coordinate of the corresponding parent node based on the vertical expansion depth in the node data to obtain the vertical coordinate of the node.

[0092] The vertical expansion depth refers to the offset of the vertical coordinate of the node data relative to the vertical coordinate of its parent node.

[0093] Step 403: Determine candidate coordinates of the node based on the abscissa and ordinate of the node and the vertical coordinate of the corresponding parent node.

[0094] Step 404, rotate the candidate coordinates of the node by a control angle in a preset direction with the vertical line of the corresponding parent node as the center to obtain the coordinates of the node. The node data also includes the control angle. The coordinates of the node are the coordinates of the candidate coordinates after the rotation is completed.

[0095] In the tree model, the extension of the tree-like bifurcation structure has an angle relative to the trunk, and when the angle changes, the horizontal coordinate, vertical coordinate and vertical coordinate of the node will change. Therefore, it is necessary to first determine the horizontal coordinate and vertical coordinate after the offset, and then perform an angle rotation on the offset coordinate to obtain the coordinate of the node.

[0096] For example, Figure 5 As shown, P p The first node P c The parent node, dotted line L p P p The vertical line, P c ′ To p The point obtained after the horizontal coordinate is offset to the negative x-axis by the horizontal expansion radius r and the vertical coordinate is offset to the positive y-axis by the longitudinal expansion depth d is P c ′ With P p The line connecting the p As the center, rotate the control angle θ clockwise, and the P c ′ The coordinates of the point are the first node P c The coordinates of .

[0097] In the above scheme, the offset of a node from its parent node is determined by the horizontal expansion radius, vertical expansion depth and control angle, which can more accurately describe the position change of the node relative to its parent node, make it easier to customize the tree model, and generate a more detailed and natural tree structure.

[0098] In an example of the present application, a method for generating a three-dimensional tree model is also provided. Figure 6 As shown, the creating a path between the first origin, the second origin and the at least one node includes:

[0099] Step 501: determine at least one child node of a node.

[0100] Step 502: Connect the node with at least one child node of the node to obtain a path between the node and at least one child node of the node.

[0101] For example, Figure 7 As shown, P0 is the first origin, P1 is the second origin, P2, P3 and P4 are all child nodes of P0, P5 and P6 are child nodes of P2, P7 and P8 are child nodes of P3, and P9 is a child node of P1. Through the path planning algorithm, P0 is first connected to P1 to create a path between P0 and P1. P2, P3 and P4 are respectively connected to P0 to create paths between P2, P3 and P4 and P0. P5 and P6 are respectively connected to P2 to create paths between P5 and P6 and P2. P7 and P8 are respectively connected to P3 to create paths between P7 and P8 and P3. P9 is connected to P1 to create a path between P9 and P1.

[0102] In an example of the present application, a method for generating a three-dimensional tree model is also provided. Figure 8 As shown, the pipeline buffer geometry is created based on the path to obtain a three-dimensional tree model, including:

[0103] Step 601, determining pipeline parameters of the path based on the tree data set.

[0104] The tree data set also includes the pipeline parameters of the path, which can be set as a path data group independently, or placed in a node data group, such as placing the pipeline parameters of the path in the node parameters of the starting node or the ending node of the path.

[0105] In this embodiment, the pipeline parameters at least include data such as size (radius), color, material type, shape, etc. In other implementations, other pipeline parameters may also be added.

[0106] It should be noted that the pipeline parameters do not necessarily correspond to the path, and the trunk and the pipeline parameters corresponding to the node data group can also be directly set, then the path connecting the first origin and the second origin (i.e., the trunk) is set with the pipeline parameters of the trunk, and the path connected to at least one node corresponding to the node data group is set with the pipeline parameters of the node data group. If the pipeline parameters of the trunk, at least one node data group, and the pipeline parameters of the path exist at the same time, they can also be set according to the corresponding priorities of the two.

[0107] Step 602: Create a pipeline buffer geometry of the path based on the pipeline parameters to obtain the three-dimensional tree model.

[0108] In an example of the present application, a method for generating a three-dimensional tree model is also provided. Fig. 9 As shown, the method also includes:

[0109] Step 701: Select at least one intermediate node in the path.

[0110] Step 702: Adjust the horizontal coordinate, the vertical coordinate and / or the vertical coordinate of the at least one intermediate node based on a preset range to obtain at least one corresponding newly added node.

[0111] Step 703: Connect the nodes at both ends of the path with the at least one newly added node to obtain a new path.

[0112] For example, Fig.10 As shown, the path with nodes A and B at both ends ( Fig.10 The middle node C and the middle node D are selected in the dashed line (in the middle), the coordinates of the middle node C are (x1, y1, z1), and the coordinates of the middle node D are (x2, y2, z2). The preset range is [-l, l], then l1, l2 and l3 are selected within the preset range, and the horizontal coordinate, vertical coordinate and vertical coordinate of the middle node C are adjusted respectively to obtain a new node E, and the coordinates of the new node E are (x1+l1, y1+l2, z1+l3). l4 is selected within the preset range, and the horizontal coordinate of the middle node D is adjusted to obtain a new node F, and the coordinates of the new node F are (x1+l4, y1, z1). Node A is connected to the new node E, the new node E is connected to the new node F, and the new node F is connected to node B to obtain a new path ( Fig.10 solid line).

[0113] In the above scheme, by randomly adding some nodes that deviate from the original path position in the generated path and connecting the nodes at both ends of the path to them, a more detailed and natural tree structure can be generated.

[0114] In order to realize the above-mentioned three-dimensional tree model generation method, Fig.11 As shown, an example of the present application provides a three-dimensional tree model generation device, including:

[0115] The acquisition module 10 is used to obtain a tree data set, wherein the tree data set includes a trunk length and at least one node data group, wherein the node data group includes the at least one node data;

[0116] A calculation module 20, configured to set the coordinates of a first origin, and determine the coordinates of a second origin based on the coordinates of the first origin and the trunk length; and determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group;

[0117] A processing module 30, configured to create a path between the first origin, the second origin and the at least one node;

[0118] The rendering module 40 is used to create a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

[0119] The calculation module 20 is further configured to determine the longitudinal coordinate of the second origin based on the longitudinal coordinate of the first origin and the trunk length; and to determine the second origin based on the longitudinal coordinates of the first origin and the second origin.

[0120] The calculation module 20 is further used to determine the parent node corresponding to the node data; obtain the coordinates of the parent node corresponding to the node data; and adjust the coordinates of the parent node corresponding to the node data based on the node data to obtain the coordinates of the node corresponding to the node data;

[0121] The calculation module 20 is further configured to adjust the horizontal coordinate of the corresponding parent node based on the horizontal expansion radius in the node data to obtain the horizontal coordinate of the node; adjust the vertical coordinate of the corresponding parent node based on the vertical expansion depth in the node data to obtain the vertical coordinate of the node; and determine the candidate coordinates of the node based on the horizontal coordinate, the vertical coordinate of the node and the vertical coordinate of the corresponding parent node;

[0122] The processing module 30 is further used to rotate the candidate coordinates of the node by a control angle in a preset direction with the vertical line where the corresponding parent node is located as the center, so as to obtain the coordinates of the node, wherein the node data also includes the control angle, and the coordinates of the node are the coordinates of the candidate coordinates after the rotation is completed;

[0123] The processing module 30 is further used to determine at least one child node of a node; and connect the node with at least one child node of the node to obtain a path between the node and at least one child node of the node.

[0124] The rendering module 40 is further used to determine the pipeline parameters of the path based on the tree data set; and to create the pipeline buffer geometry of the path based on the pipeline parameters to obtain the three-dimensional tree model.

[0125] The calculation module 20 is further configured to select at least one intermediate node in the path; and adjust the horizontal coordinate, the vertical coordinate and / or the vertical coordinate of the at least one intermediate node based on a preset range to obtain the corresponding at least one newly added node;

[0126] The processing module 30 is further configured to connect the nodes at both ends of the path with the at least one newly added node to obtain a new path.

[0127] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0128] Fig.12 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0129] like Fig.12 As shown, the electronic device 800 includes a collection device 801 and a processor 802, and the collection device 801 and the processor 802 are electrically connected;

[0130] The acquisition device 801 obtains a tree-like data set;

[0131] The processor 802 sets the coordinates of the first origin, and determines the coordinates of the second origin based on the coordinates of the first origin and the length of the trunk; determines at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; creates a path between the first origin, the second origin and the at least one node; and creates a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

[0132] The processor 802 determines the longitudinal coordinate of the second origin based on the longitudinal coordinate of the first origin and the length of the trunk; and determines the second origin based on the longitudinal coordinates of the first origin and the second origin.

[0133] The processor 802 determines the parent node corresponding to the node data; obtains the coordinates of the parent node corresponding to the node data; and adjusts the coordinates of the parent node corresponding to the node data based on the node data to obtain the coordinates of the node corresponding to the node data.

[0134] Among them, the processor 802 adjusts the horizontal coordinate of the corresponding parent node based on the horizontal expansion radius in the node data to obtain the horizontal coordinate of the node; adjusts the vertical coordinate of the corresponding parent node based on the vertical expansion depth in the node data to obtain the vertical coordinate of the node; determines the candidate coordinates of the node based on the horizontal coordinate, vertical coordinate and vertical coordinate of the corresponding parent node; rotates the candidate coordinates of the node by a control angle in a preset direction with the vertical line of the corresponding parent node as the center to obtain the coordinates of the node.

[0135] The processor 802 determines at least one child node of a node; and connects the node with at least one child node of the node to obtain a path between the node and the at least one child node of the node.

[0136] The processor 802 determines the pipeline parameters of the path based on the tree data set; and creates the pipeline buffer geometry of the path based on the pipeline parameters to obtain the three-dimensional tree model.

[0137] Among them, the processor 802 selects at least one intermediate node in the path; adjusts the horizontal coordinate, vertical coordinate and / or vertical coordinate of the at least one intermediate node based on a preset range to obtain at least one corresponding new node; and connects the nodes at both ends of the path with the at least one new node to obtain a new path.

[0138] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), integrated systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0139] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0140] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0141] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0142] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0143] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0144] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0145] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0146] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for generating a three-dimensional tree model, the method comprising: Obtaining a tree data set, wherein the tree data set includes a trunk length and at least one node data group, wherein the node data group includes the at least one node data; Setting the coordinates of a first origin, and determining the coordinates of a second origin based on the coordinates of the first origin and the length of the tree trunk; Determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; creating a path between the first origin, the second origin and the at least one node; A pipeline buffer geometry is created based on the path to obtain a three-dimensional tree model.

2. The method according to claim 1, wherein determining the second origin based on the first origin and the trunk length comprises: Determine the ordinate of the second origin based on the ordinate of the first origin and the length of the tree trunk; The second origin is determined based on the longitudinal coordinates of the first origin and the second origin.

3. The method according to claim 1, wherein determining at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group comprises: Determine the parent node corresponding to the node data; Obtaining the coordinates of the parent node corresponding to the node data; The coordinates of the parent node corresponding to the node data are adjusted based on the node data to obtain the coordinates of the node corresponding to the node data.

4. The method according to claim 3, wherein adjusting the coordinates of the parent node corresponding to the node data based on the node data to obtain the coordinates of the node corresponding to the node data comprises: Adjusting the horizontal coordinate of the corresponding parent node based on the horizontal expansion radius in the node data to obtain the horizontal coordinate of the node; Adjusting the vertical coordinate of the corresponding parent node based on the vertical expansion depth in the node data to obtain the vertical coordinate of the node; Determine candidate coordinates of the node based on the abscissa, ordinate and vertical coordinate of the node and the vertical coordinate of the corresponding parent node; The candidate coordinates of the node are rotated by a control angle in a preset direction with the vertical line of the corresponding parent node as the center to obtain the coordinates of the node. The node data also includes the control angle. The coordinates of the node are the coordinates of the candidate coordinates after the rotation is completed.

5. The method according to claim 1, wherein creating a path between the first origin, the second origin and the at least one node comprises: Determine at least one child node of the node; The node is connected to at least one child node of the node to obtain a path between the node and at least one child node of the node.

6. The method according to claim 1, wherein the step of creating a pipeline buffer geometry based on the path to obtain a three-dimensional tree model comprises: determining pipeline parameters of the path based on the tree data set; A pipeline buffer geometry of the path is created based on the pipeline parameters to obtain the three-dimensional tree model.

7. The method according to claim 1, further comprising: Selecting at least one intermediate node in the path; Adjusting the horizontal coordinate, the vertical coordinate and / or the vertical coordinate of the at least one intermediate node based on a preset range to obtain at least one corresponding newly added node; The nodes at both ends of the path are connected to the at least one newly added node to obtain a new path.

8. A three-dimensional tree model generation device, the device comprising: A collection module, used for obtaining a tree data set, wherein the tree data set includes a trunk length and at least one node data group, wherein the node data group includes the at least one node data; a calculation module, configured to set the coordinates of a first origin, and determine the coordinates of a second origin based on the coordinates of the first origin and the length of the tree trunk; and determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; a processing module, configured to create a path between the first origin, the second origin and the at least one node; The rendering module is used to create a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

9. An electronic device, comprising: A collection device and a processor, wherein the collection device and the processor are electrically connected; The acquisition device obtains a tree-like data set; The processor sets the coordinates of the first origin, and determines the coordinates of the second origin based on the coordinates of the first origin and the length of the trunk; determines at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; creates a path between the first origin, the second origin and the at least one node; and creates a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.

10. A computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program is used to obtain a tree data set; set the coordinates of a first origin, and determine the coordinates of a second origin based on the coordinates of the first origin and the length of the trunk; determine at least one node corresponding to the node data group based on the first origin, the second origin and at least one node data in the node data group; create a path between the first origin, the second origin and the at least one node; and create a pipeline buffer geometry based on the path to obtain a three-dimensional tree model.