Model road generation method and device, equipment and storage medium

By generating sampling points and process points in the game's geographic model, constructing a network of guiding curves and finding paths, the problem of existing technologies failing to conform to the terrain and landforms in mountain roads is solved, achieving more realistic and coherent road generation.

CN117815655BActive Publication Date: 2026-11-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311597120.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-27
Publication Date
2026-11-10
Estimated Expiration
2043-11-27

AI Technical Summary

Technical Problem

Existing technologies, when generating mountain roads in open-world games, struggle to make road curves conform to the terrain; they can only control the overall slope of the curves.

Method used

By acquiring the target area and key road points in the geographic model, multiple sampling points are generated. Process points are generated based on the relative direction between the terrain voxels and the sampling points. A guide curve network is constructed, and a pathfinding algorithm is used to find the path on the guide curve network to generate road curves that conform to the terrain.

Benefits of technology

The generated road curves better conform to the terrain, improving the realism and consistency of road generation and enhancing the overall road effect in the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117815655B_ABST
    Figure CN117815655B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of computers, and provides a model road generation method, device and equipment and storage medium. The method comprises: obtaining a target region and a road key point in a geographic model, and generating a plurality of sampling points according to region information of the target region; generating a plurality of process points according to the relative direction of each terrain voxel corresponding to the target region and the plurality of sampling points, and generating a plurality of guide curves of the target region according to the plurality of process points and the plurality of sampling points; generating a guide curve network according to the plurality of guide curves, and performing path searching on the guide curve network according to a preset path searching algorithm and the road key point to obtain a road curve. The method generates a guide curve network containing guide curves similar in shape to terrain contour lines. Since the guide lines are connected by line segments approximately perpendicular to the direction of the guide lines, the shape of the road curve obtained by path searching on the guide curve network will have the shape of the guide curve, and a guide curve that fits the terrain and landscape is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computers, and more particularly to a method, apparatus, device, and storage medium for generating model roads. Background Technology

[0002] In recent years, the world maps in open-world games have become increasingly larger, providing developers with more space to create diverse terrains. As an indispensable element in open-world games, roads play a crucial role. However, in real life, mountain roads, as a special terrain feature, present a complex and winding nature, making their generation in games a time-consuming and labor-intensive task. Existing technologies generate roads by using pathfinding algorithms on anisotropic networks and adding slope-related parameters as factors to be considered during pathfinding. However, the resulting curves can only control the overall slope, and the generated road curves do not perfectly match the corresponding terrain. Summary of the Invention

[0003] The main purpose of this disclosure is to solve the technical problem that existing pathfinding algorithms used to generate roads on anisotropic networks can only control the overall slope of the curve, and the generated road curves cannot conform to the terrain.

[0004] The first aspect of this disclosure provides a method for generating model roads, the method comprising: Obtain the target area and key road points in the geographic model, and generate multiple sampling points based on the regional information of the target area; Based on the relative directions of the various shape elements corresponding to the target area and the multiple sampling points, multiple process points are generated, and multiple guide curves for the target area are generated based on the multiple process points and the multiple sampling points; A guide curve network is generated based on the multiple guide curves, and the guide curve network is used to find the road curves of the target area according to the preset pathfinding algorithm and the road key points.

[0005] A second aspect of this disclosure provides a model road generation apparatus, the apparatus comprising: The acquisition module is used to acquire the target area and road key points in the geographic model, and generate multiple sampling points based on the regional information of the target area; The guide curve generation module is used to generate multiple process points based on the relative directions of the various shape elements corresponding to the target area and the multiple sampling points, and to generate multiple guide curves for the target area based on the multiple process points and the multiple sampling points; The road curve generation module is used to generate a guide curve network based on the multiple guide curves, and to perform pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curve of the target area.

[0006] A third aspect of this disclosure provides a model road generation apparatus, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the model road generation apparatus to perform the steps of the model road generation method described above.

[0007] A fourth aspect of this disclosure provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the model road generation method described above.

[0008] This disclosure obtains a target area and road key points from a geographic model, and generates multiple sampling points based on the regional information of the target area. Based on the relative directions of the various landform elements corresponding to the target area and the multiple sampling points, multiple process points are generated. Multiple guide curves for the target area are then generated based on these process points and the multiple sampling points. A guide curve network is generated based on these guide curves, and a pathfinding algorithm and the road key points are used to navigate through the guide curve network to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to their direction, the road curves obtained by navigating on the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0009] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objects and other advantages of this disclosure are realized and obtained through the structures particularly pointed out in the description, claims and drawings.

[0010] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of one embodiment of the model road generation method in this disclosure; Figure 2 This is a schematic diagram of another embodiment of the model road generation method in this disclosure; Figure 3This is a schematic diagram of another embodiment of the model road generation method in this disclosure; Figure 4 This is a schematic diagram of one embodiment of the model road generation device in this disclosure; Figure 5 This is a schematic diagram of another embodiment of the model road generation device in this disclosure; Figure 6 This is a schematic diagram of one embodiment of the model road generation device in this disclosure. Detailed Implementation

[0012] This invention provides a method, apparatus, device, and storage medium for generating model roads. It acquires a target region and key road points from a geographic model, and generates multiple sampling points based on the regional information of the target region. Based on the relative directions of the topographical elements corresponding to the target region and the multiple sampling points, it generates multiple process points, and generates multiple guide curves for the target region based on the process points and the multiple sampling points. It then generates a guide curve network based on the multiple guide curves, and performs pathfinding on the guide curve network according to a preset pathfinding algorithm and the key road points to obtain the road curves of the target region. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to their direction, pathfinding on the guide curve network results in road curves with shapes similar to the guide curves, thus obtaining guide curves that conform to the terrain.

[0013] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the model road generation method in this invention includes: 101. Obtain the target area and key road points in the geographic model, and generate multiple sampling points based on the regional information of the target area; In practical applications, the geographic model in a game refers to a virtual geographic environment created using computer graphics technology. It can include elements such as terrain, scenes, buildings, roads, and water bodies to construct the geographic features and landscapes of the game world. The target area is the region within the geographic model where the disclosed solution needs to be applied. For example, the geographic model can be a hill model, and the target area can be a portion of that hill model. If a road needs to be generated for that portion, then that portion is considered the target area. Road key points are the point information that the user needs to provide when using this tool; that is, the key points through which the road curve obtained through the tool's pathfinding operation must pass. In other words, the road curve generated by the technical solution disclosed in this invention must ultimately pass through all the key points selected by the user. The user can select road key points based on the specific terrain of the target area and the locations through which the road curve needs to pass within the target area. For example, a location in the game that needs to guide the player can be set as one of the road key points.

[0015] In this embodiment, the step of obtaining the target area and road key points in the geographic model, and generating multiple sampling points based on the regional information of the target area includes: obtaining the target area and road key points in the geographic model, and obtaining corresponding regional information based on the target area, wherein the regional information includes a regional mask; calculating the density information of the terrain voxels in the geographic model at the corresponding positions on the regional mask based on the ratio data between the terrain voxels in the geographic model and the regional mask; and generating sampling points at the corresponding positions on the regional mask based on the density information to obtain multiple sampling points.

[0016] Specifically, during game development, terrain modeling is performed based on collected terrain data. This can be achieved using 3D modeling software or terrain editing tools within the game engine. Based on the terrain data, a geographic model for the game is created, and appropriate materials and textures are set. After terrain modeling is completed, the terrain is analyzed. This can be achieved using tools provided by the game engine or by writing scripts. Common terrain analyses include height analysis, slope analysis, and water flow analysis. Based on the results of the terrain analysis, regions are divided. Different regions can be divided based on height, slope, water flow, etc. For example, different types of terrain such as plains, mountains, and rivers can be divided into different regions. Based on the results of the region division, corresponding region masks are generated. A region mask can be a grayscale image, where different grayscale values ​​represent different regions. In this embodiment, regions with large elevation differences and steep slopes are selected for masking.

[0017] Specifically, the weight value of the terrain voxel on the corresponding position of the target area's mask is set according to the proportion of the terrain voxel in the area where sampling points need to be added. For example, if the terrain voxel is completely within the area, the weight value will be 1; if it is not within the area, the weight value will be 0; and if it is in the transition part of the area's edge, the weight value will be between 0 and 1. Based on this weight value, the density information of the sampling point to be added at the corresponding position is determined. For example, if the terrain voxel is completely within the area where sampling points need to be added, the weight value will be 1, and the density information at that position will likely be 1, thus the probability of adding a sampling point is 1 (100%). Other weight values, such as 0.5, will result in a density information of 0.5, and the corresponding probability of adding a sampling point is 0.5 (50%). Based on the preset density parameters and density information, sampling points at the corresponding positions can be added. For example, if the density parameter is set to 1000, the number of sampling points generated within a certain range will be equal to the density parameter 1000. Density information (weight) 0.5 = 500. The actual density parameter value will be set differently depending on the project requirements.

[0018] 102. Based on the relative directions of the various topographic features corresponding to the target area and multiple sampling points, generate multiple process points, and generate multiple guide curves for the target area based on the multiple process points and multiple sampling points; In this embodiment, the terrain voxels near each sampling point are traversed. A terrain voxel is a unit element used in terrain modeling (a voxel, i.e., a 3D pixel, to represent terrain). Within a terrain voxel, the terrain is divided into multiple small cubic units, each called a terrain voxel. Each terrain voxel records spatial information at that location, such as height and material. By combining these terrain voxels, complex 3D terrain can be constructed. The gradient information recorded by the terrain voxels can be obtained; the gradient information records the direction of the fastest descent from the current sampling point. This yields the direction of voxels with the same height on the terrain relative to the current sampling point. This process is then recursively applied, adding new process points at each step. Finally, all process points are connected to the starting sampling point to obtain a guide curve on the terrain, similar to contour lines.

[0019] 103. Generate a guide curve network based on multiple guide curves, and perform pathfinding on the guide curve network according to the preset pathfinding algorithm and road key points to obtain the road curves of the target area.

[0020] In this embodiment, multiple guide curves are summarized and connected to obtain a guide curve network. A pathfinding algorithm is then executed on this network, with control factors regarding slope and curve length added to the algorithm. The specific pathfinding algorithm can use A... The pathfinding algorithm calculates a parameter for judging the slope by the ratio of the height difference between the two endpoints of each small segment on the guide curve network to the distance between them. By further processing this parameter, such as exponentiation, the weight of the parameter is increased, thereby controlling the slope of the final pathfinding curve. By executing the pathfinding algorithm on the guide curve network, the road curve of the target area is finally obtained.

[0021] Furthermore, after generating a guide curve network based on the multiple guide curves, and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curves of the target area, the method further includes: traversing the road points on the road curves and taking the traversed road points as the current road points; calculating the directional angle between the current road point and two adjacent road points; determining whether the directional angle is less than a preset angle; if so, obtaining the point positions of the current road point and the two adjacent road points, and adjusting the current road point according to the point positions of the current road point and the two adjacent road points.

[0022] Specifically, road curves may have very sharp turns, which is unrealistic and aesthetically displeasing. Therefore, a smoothing process is needed to create gentler curves. This involves determining if the angle between each point on the curve and its two connected points is less than a set value. If it is, a sharp turn is considered. The positions of these three points are then averaged to ensure the middle point is positioned more appropriately. This averaging process is applied to points on the curve that are deemed too sharp, and then the software's smoothing nodes are used to further smooth the result. By adjusting the positions of the road points on the curve, the road curve is adjusted accordingly.

[0023] Furthermore, after generating a guide curve network based on the multiple guide curves and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curve of the target area, the method further includes: traversing the road points on the road curve and taking the traversed road point as the current road point; determining the height difference between the current road point and two adjacent road points, and calculating the ratio of the height difference to the curve length of the road curve to obtain slope information; determining whether the slope information is greater than a preset slope threshold; if so, obtaining the road segment corresponding to the current road point and two adjacent road points, and performing slope restriction processing on the road segment to obtain a new road segment; and adjusting the road curve of the target area according to the new road segment.

[0024] Specifically, road curves may have excessively steep slopes due to a large ratio of height to length between the two guide lines connected by the guide curves. For these excessively steep sections, slope limitation processing is required to ensure the final curve's gradient does not exceed the expected value. This is achieved by calculating the ratio of the height difference between points on the curve to the curve length, resulting in a slope assessment attribute. If this attribute exceeds a set threshold, the slope is considered excessive and requires limitation processing. Specifically, slope limitation processing involves acquiring the excessively steep section of the curve—the road segment corresponding to the road point and its adjacent points. This curve segment is then expanded, and each processed segment is traversed to obtain the highest and lowest height values. This height difference is then smoothly distributed to each point on each segment and merged with the original height value of each point based on its relative position within the curve segment to obtain a new height value. This process yields new road segments, which are then used to adjust the road curve, thus limiting the slope to a certain extent.

[0025] In this embodiment, a target area and road key points are acquired from a geographic model, and multiple sampling points are generated based on the regional information of the target area. Multiple process points are generated based on the relative directions of the various topographical elements corresponding to the target area and the multiple sampling points. Multiple guide curves for the target area are then generated based on these process points and the multiple sampling points. A guide curve network is generated based on these multiple guide curves, and the guide curve network is used for pathfinding according to a preset pathfinding algorithm and the road key points to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to the direction of the guide lines, the resulting road curves obtained by pathfinding on the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0026] Please see Figure 2 Another embodiment of the model road generation method in this disclosure includes: 201. Obtain the target area and key road points in the geographic model, and generate multiple sampling points based on the regional information of the target area; In this embodiment, step 201 is similar to step 101 in the first embodiment, and will not be described again here.

[0027] 202. Traverse multiple sampling points and use the sampling point at the time of traversal as the current sampling point; It is important to note that by traversing all sampling points, a corresponding guiding curve will be generated for each sampling point. Sampling points during the traversal process are all considered as the current sampling points. The specific traversal process can be implemented using a loop structure.

[0028] 203. Obtain the relative direction of the contour voxels with respect to the current sampling point; In this embodiment, obtaining the relative direction between the contour voxel and the current sampling point includes: determining the terrain voxel at the current sampling point and obtaining the gradient information of the terrain voxel at the current sampling point, wherein the gradient information records the fastest descent direction of the terrain voxel at the current sampling point; performing a cross product between the fastest descent direction and the vertical direction in the geographic model to obtain the relative direction between the contour voxel and the current sampling point.

[0029] Specifically, in the geographic model, the terrain voxels at the current sampling point can be located by querying terrain data and obtaining their gradient information. The gradient information records the fastest descent direction at the current sampling point. Typically, the gradient can be obtained by calculating the local derivative of the elevation data or using other terrain analysis methods. Finally, the fastest descent direction of the terrain voxels at the current sampling point is cross-multiplied with the vertical direction in the geographic model. This means performing a perpendicular cross-product of these two vectors to obtain the relative direction of the contour voxels with respect to the current sampling point. This allows us to determine the relative position and orientation of the contour voxels relative to the current sampling point.

[0030] 204. Based on the preset extension distance, extend the sampling point in a relative direction to obtain the voxel search position; In this embodiment, the extension range is determined based on a preset extension distance. This distance can be a fixed value set in advance, or it can be dynamically adjusted according to actual needs and application scenarios. Based on the relative direction between the contour voxel obtained in the previous step and the current sampling point, the extension is performed at the current sampling point in this relative direction. The extension distance is the preset extension distance. Based on the extension distance and the relative direction, a displacement operation is performed at the current sampling point to obtain the voxel search position. The displacement operation can be achieved by adding the product of the relative direction vector and the extension distance to the coordinates of the current sampling point.

[0031] 205. Perform a spatial search based on the voxel search location, determine the terrain voxel closest to the voxel search location, and generate a process point at the location of the terrain voxel closest to the voxel search location. In this embodiment, firstly, a spatial search is performed in the geographic model to determine the terrain voxel closest to the voxel search location. After the spatial search is completed, the terrain voxel closest to the voxel search location is found, that is, the closest contour voxel. This voxel will become the generation location of the process point. Finally, based on the determined closest contour voxel, the process point is generated near its location.

[0032] 206. Connect the current sampling point with the corresponding multiple process points to generate the corresponding guide curve, and obtain multiple guide curves when the multiple sampling points have been traversed; In this embodiment, for the current sampling point and its corresponding multiple process points, they are connected sequentially to form a guiding curve. The connection can be a straight line segment or a curved segment, and the specific method can be determined according to the application scenario and requirements. This sampling and guiding curve generation process is repeated multiple times until all sampling points have been traversed. During each traversal, a guiding curve is generated based on the current sampling point and its corresponding process points. After all sampling points have been traversed, multiple guiding curves are obtained.

[0033] 207. Generate a guide curve network based on multiple guide curves, and perform pathfinding on the guide curve network according to the preset pathfinding algorithm and road key points to obtain the road curves of the target area.

[0034] In this embodiment, step 207 is similar to step 103 in the first embodiment, and will not be described again here.

[0035] In this embodiment, a target area and road key points are acquired from a geographic model, and multiple sampling points are generated based on the regional information of the target area. Multiple process points are generated based on the relative directions of the various topographical elements corresponding to the target area and the multiple sampling points. Multiple guide curves for the target area are then generated based on these process points and the multiple sampling points. A guide curve network is generated based on these multiple guide curves, and the guide curve network is used for pathfinding according to a preset pathfinding algorithm and the road key points to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to the direction of the guide lines, the resulting road curves obtained by pathfinding on the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0036] Please see Figure 3 Another embodiment of the model road generation method in this disclosure includes: 301. Obtain the target area and key road points in the geographic model, and generate multiple sampling points based on the regional information of the target area; 302. Based on the relative directions of the various topographic features corresponding to the target area and multiple sampling points, generate multiple process points, and generate multiple guide curves for the target area based on the multiple process points and multiple sampling points; In this embodiment, steps 301-302 are similar to steps 101-102 in the first embodiment, and will not be described again here.

[0037] 303. Generate a guide curve network based on multiple guide curves; In this embodiment, generating a guide curve network based on the multiple guide curves includes: traversing the multiple guide curves, performing a spatial search on curve points of any guide curve, and determining whether there exists a nearest point of the curve point within a preset search range; if a nearest point of the curve point exists, determining whether the nearest point has been connected; if the nearest point has not been connected, connecting the curve point and the nearest point to obtain a connecting line; if there is no nearest point or the nearest point has been connected, skipping the curve point; when the traversal of the multiple guide curves is completed, generating a guide curve network based on the multiple guide curves and the connecting line.

[0038] Specifically, for each point on each obtained guide curve, a spatial search is performed on other nearby guide curves to find the nearest point within the set search range. It is then determined whether this point has already been connected to points on other guide curves. If not, a connection is made. If no other points on other guide curves are found within the set range, or if the found points are already connected, this operation is skipped and no further connection is made. Based on the multiple guide curves and the connecting lines, a guide curve network can be generated.

[0039] 304. Obtain the pathfinding factor of the preset road curve and input the pathfinding factor into the pathfinding algorithm; It is important to note that when the generated road is a mountain road, the key points of the road input by the user can be filtered by height and location to obtain the key points for the mountain road search section. There are many rules for filtering key points. Based on the common characteristics of mountain road search terrain, such as large height differences, it can be determined whether the height difference between two road key points reaches the set trigger value. If the height difference exceeds the set value, it can be determined that a mountain road search operation is required. If the height difference does not reach the set value, it can be determined that only a normal road search is needed.

[0040] 305. The pathfinding algorithm, by inputting pathfinding factors, performs pathfinding on key road points in the guide curve network and calculates the cost of the pathfinding factors; In this embodiment, firstly, an appropriate pathfinding algorithm is selected for path search. Common pathfinding algorithms include A... Algorithms such as Dijkstra's algorithm and shortest path algorithm are used, and the choice of algorithm depends on the application scenario and requirements. Starting from key points on the road, the selected pathfinding algorithm searches a network of guiding curves. This network can be viewed as a network of multiple guiding curves generated in previous steps, where each point on a curve is a node, and points on adjacent curves are connected. During the pathfinding process, the path is evaluated and its cost is calculated based on specific pathfinding factors. These factors can include distance, elevation difference, slope, obstacles, etc. Depending on the pathfinding requirements and objectives, different factors are assigned weights and calculation methods to obtain an appropriate path cost.

[0041] 306. The curve with the lowest cost during the pathfinding process is taken as the road curve for the target area.

[0042] In this embodiment, for all possible paths, the curve with the lowest cost is selected based on the calculated cost. That is, among the pathfinding paths from the starting point to the target point, the curve corresponding to the path with the lowest cost is selected, and the selected curve with the lowest cost is used as the road curve for the target area.

[0043] In this embodiment, a target area and road key points are acquired from a geographic model, and multiple sampling points are generated based on the regional information of the target area. Multiple process points are generated based on the relative directions of the various topographical elements corresponding to the target area and the multiple sampling points. Multiple guide curves for the target area are then generated based on these process points and the multiple sampling points. A guide curve network is generated based on these guide curves, and a pathfinding algorithm and the road key points are used to navigate through the guide curve network to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to their direction, the resulting road curves obtained by navigating the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0044] The method for generating model roads in the embodiments of this disclosure has been described above. The apparatus for generating model roads in the embodiments of this disclosure is described below. Please refer to [link / reference]. Figure 4 One embodiment of the model road generation device in this disclosure includes: The acquisition module 401 is used to acquire the target area and road key points in the geographic model, and generate multiple sampling points based on the regional information of the target area; The guide curve generation module 402 is used to generate multiple process points based on the relative directions of the various topographical elements corresponding to the target area and the multiple sampling points, and to generate multiple guide curves for the target area based on the multiple process points and the multiple sampling points; The road curve generation module 403 is used to generate a guide curve network based on the multiple guide curves, and to perform pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curve of the target area.

[0045] In this embodiment, a target area and road key points are acquired from a geographic model, and multiple sampling points are generated based on the regional information of the target area. Multiple process points are generated based on the relative directions of the various topographical elements corresponding to the target area and the multiple sampling points. Multiple guide curves for the target area are then generated based on these process points and the multiple sampling points. A guide curve network is generated based on these multiple guide curves, and the guide curve network is used for pathfinding according to a preset pathfinding algorithm and the road key points to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to the direction of the guide lines, the resulting road curves obtained by pathfinding on the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0046] Please see Figure 5 Another embodiment of the model road generation device in this disclosure includes: The acquisition module 401 is used to acquire the target area and road key points in the geographic model, and generate multiple sampling points based on the regional information of the target area; The guide curve generation module 402 is used to generate multiple process points based on the relative directions of the various topographical elements corresponding to the target area and the multiple sampling points, and to generate multiple guide curves for the target area based on the multiple process points and the multiple sampling points; The road curve generation module 403 is used to generate a guide curve network based on the multiple guide curves, and to perform pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curve of the target area.

[0047] In one feasible implementation, the acquisition module 401 is specifically used for: Obtain the target region and road key points in the geographic model, and obtain the corresponding region information based on the target region, wherein the region information includes region masking; Based on the ratio data between the terrain voxels in the geographic model and the area mask, calculate the density information of the terrain voxels in the geographic model at the corresponding positions on the area mask; Based on the density information, sampling points are generated at corresponding positions on the region mask to obtain multiple sampling points.

[0048] In one feasible implementation, the guide curve generation module 402 includes: The traversal unit 4021 is used to traverse the multiple sampling points and take the sampling point during traversal as the current sampling point; The process point generation unit 4022 is used to generate multiple corresponding process points according to the relative direction between the current sampling point and the contour voxels in the terrain voxels of the target area, wherein the contour voxels are terrain voxels at the same height as the current sampling point; The connection unit 4023 is used to connect the current sampling point with the corresponding multiple process points to generate the corresponding guide curve, and to obtain multiple guide curves when the multiple sampling points have been traversed.

[0049] In one feasible implementation, the process point generation unit 4022 is specifically used for: Obtain the relative orientation of the contour voxel to the current sampling point; Based on the preset extension distance, the sampling point is extended in the relative direction to obtain the voxel search position; A spatial search is performed based on the voxel search location to determine the terrain voxel closest to the voxel search location, and a process point is generated at the location of the terrain voxel closest to the voxel search location.

[0050] In one feasible implementation, the process point generation unit 4022 is further configured to: Determine the terrain voxels at the current sampling point and obtain the gradient information of the terrain voxels at the current sampling point, wherein the gradient information records the fastest descent direction of the terrain voxels at the current sampling point; The cross product of the fastest descent direction and the vertical direction in the geographic model is used to obtain the relative direction between the contour voxel and the current sampling point.

[0051] In one feasible implementation, the road curve generation module 403 is specifically used for: Traverse the multiple guide curves, perform a spatial search on the curve points of any guide curve, and determine whether there is a nearest point of the curve point within a preset search range; If there exists a nearest point to the curve point, then determine whether the nearest point has been connected; If the nearest point is not connected, then connect the curve point and the nearest point to obtain a connecting line; If the nearest point does not exist or the nearest point has already been connected, then skip the curve point; When the traversal of the multiple guide curves is completed, a guide curve network is generated based on the multiple guide curves and the connecting lines.

[0052] In one feasible implementation, the road curve generation module 403 is further configured to: Obtain the pathfinding factor of the preset road curve and input the pathfinding factor into the pathfinding algorithm; The routing algorithm, by inputting routing factors, searches for the key points of the road in the guide curve network and calculates the cost of the routing factors. The curve with the lowest cost during the pathfinding process is taken as the road curve for the target area.

[0053] In one feasible implementation, the model road generation device further includes a turning adjustment module 404, which is specifically used for: Iterate through the road points on the road curve and use the road point at the time of traversal as the current road point; Calculate the directional angle between the current road point and the two adjacent road points; Determine whether the included angle of the directions is less than a preset angle; If so, the current road point and the positions of the two adjacent road points are obtained, and the current road point is adjusted according to the positions of the current road point and the two adjacent road points.

[0054] In one feasible implementation, the model road generation device further includes a slope adjustment module 405, which is specifically used for: Iterate through the road points on the road curve and use the road point at the time of traversal as the current road point; Determine the height difference between the current road point and two adjacent road points, and calculate the ratio of the height difference to the curve length of the road curve to obtain the slope information; Determine whether the slope information is greater than a preset slope threshold; If so, obtain the road segments corresponding to the current road point and the two adjacent road points, and perform slope restriction processing on the road segments to obtain new road segments; The road curves of the target area are adjusted based on the new road segments.

[0055] In this embodiment, a target area and road key points are acquired from a geographic model, and multiple sampling points are generated based on the regional information of the target area. Multiple process points are generated based on the relative directions of the various topographical elements corresponding to the target area and the multiple sampling points. Multiple guide curves for the target area are then generated based on these process points and the multiple sampling points. A guide curve network is generated based on these guide curves, and a pathfinding algorithm and the road key points are used to navigate through the guide curve network to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to their direction, the resulting road curves obtained by navigating the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0056] above Figure 4 and Figure 5 The model road generation device in this embodiment is described in detail from the perspective of modular functional entities. The model road generation device in this embodiment is described in detail from the perspective of hardware processing.

[0057] Figure 6 This is a schematic diagram of the structure of a model road generation device 600 provided in an embodiment of this disclosure. The model road generation device 600 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) for storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the model road generation device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute a series of instruction operations in the storage media 630 on the model road generation device 600 to implement the following steps: The process involves acquiring the target area and key road points from the geographic model, generating multiple sampling points based on the regional information of the target area, generating multiple process points based on the relative directions of the various landform elements corresponding to the target area and the multiple sampling points, and generating multiple guide curves for the target area based on the multiple process points and multiple sampling points. A guide curve network is then generated based on these multiple guide curves, and the network is used for pathfinding according to a preset pathfinding algorithm and the key road points to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to their direction, the resulting road curves obtained by pathfinding on the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0058] The above method generates a guide curve network containing guide curves with shapes similar to terrain contour lines, connecting the guide lines with line segments approximately perpendicular to their direction. This topology allows road curves to extend smoothly across the terrain and conform to common landform features, enhancing the overall coherence and realism of the road.

[0059] Optionally, obtaining the target area and road key points in the geographic model, and generating multiple sampling points based on the regional information of the target area includes: obtaining the target area and road key points in the geographic model, and obtaining the corresponding regional information based on the target area, wherein the regional information includes a regional mask; calculating the density information of the terrain voxels in the geographic model at the corresponding positions on the regional mask based on the ratio data between the terrain voxels in the geographic model and the regional mask; and generating sampling points based on the corresponding positions on the regional mask according to the density information, thereby obtaining multiple sampling points.

[0060] The above method generates sampling points based on the corresponding positions of density information on the region mask, resulting in multiple sampling points. These sampling points can be used for subsequent operations such as road planning and path search. By selecting an appropriate number and location of sampling points, the geographical features of the target area can be effectively represented, improving the accuracy and feasibility of road planning.

[0061] Optionally, multiple process points are generated based on the relative directions of the various terrain voxels corresponding to the target area and multiple sampling points. Multiple guide curves for the target area are then generated based on these process points and sampling points, including: traversing multiple sampling points and using the sampling point at the time of traversal as the current sampling point; generating multiple corresponding process points based on the relative directions of the current sampling point and the contour voxels in the various terrain voxels of the target area, wherein the contour voxels are terrain voxels at the same height as the current sampling point; connecting the current sampling point with the corresponding multiple process points to generate corresponding guide curves, and obtaining multiple guide curves when the traversal of multiple sampling points is completed.

[0062] The above method, during the generation of the guide curve, allows for spatial relationship analysis by considering the relative orientation of contour voxels between the current sampling point and various landform voxels in the target area. This helps in understanding the terrain features and geomorphic structure within the target area, identifying potential obstacles or terrain changes, and adjusting the guide curve accordingly to ensure the safety and effectiveness of road generation.

[0063] Optionally, generating multiple process points based on the relative directions of the current sampling point and the contour voxels in various terrain voxels in the target area includes: obtaining the relative directions of the contour voxels and the current sampling point; extending the current sampling point in the relative direction according to a preset extension distance to obtain the voxel search position; performing a spatial search based on the voxel search position to determine the terrain voxel closest to the voxel search position, and generating a process point at the position of the terrain voxel closest to the voxel search position.

[0064] The above method obtains high-precision terrain data by determining the terrain voxel at the same height as the current sampling point as the contour voxel, and performing a spatial search at the voxel search position to determine the terrain voxel closest to the voxel search position.

[0065] Optionally, obtaining the relative direction between the contour voxels and the current sampling point includes: determining the terrain voxels at the current sampling point and obtaining the gradient information of the terrain voxels at the current sampling point, wherein the gradient information records the fastest descent direction of the terrain voxels at the current sampling point; and performing a cross product between the fastest descent direction and the vertical direction in the geographic model to obtain the relative direction between the contour voxels and the current sampling point.

[0066] The above method yields the relative orientation of the contour voxels to the current sampling point by cross-productting the fastest descent direction with the vertical direction in the geographic model. Calculating this relative orientation helps determine the azimuth of the contour voxels around the current sampling point.

[0067] Optionally, generating a guide curve network based on multiple guide curves includes: traversing multiple guide curves, performing a spatial search on curve points of any guide curve, and determining whether there is a nearest point within a preset search range for each curve point; if a nearest point exists, determining whether the nearest point has already been connected; if the nearest point has not been connected, connecting the curve point and the nearest point to obtain a connecting line; if there is no nearest point or the nearest point has already been connected, skipping the curve point; when traversing multiple guide curves is complete, generating a guide curve network based on the multiple guide curves and connecting lines.

[0068] The above method connects different guide curves to obtain a guide curve network containing all guide curves, and determines whether the curve points are connected to avoid duplicate connections.

[0069] Optionally, the pathfinding algorithm and road key points are used to find the road curves in the target area by performing pathfinding on the guide curve network, including: obtaining the pathfinding factors of the preset road curves and inputting the pathfinding factors into the pathfinding algorithm; using the pathfinding algorithm with input pathfinding factors to find the road key points in the guide curve network and calculating the cost of the pathfinding factors; and taking the curve with the lowest cost during the pathfinding process as the road curve of the target area.

[0070] The above method uses a pathfinding algorithm to evaluate each possible road curve based on preset pathfinding factors and calculate its cost value. The cost value can be a comprehensive indicator based on factors such as distance, time, and traffic flow, used to measure the quality of a path. By considering the cost value of pathfinding factors, the optimal road curve can be selected as the road for the target area to meet specific needs, such as the shortest path, the fastest path, or the least congested path.

[0071] Optionally, after generating a guide curve network based on multiple guide curves and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and road key points to obtain the road curves of the target area, the method further includes: traversing the road points on the road curves and taking the road points during traversal as the current road point; calculating the directional angle between the current road point and two adjacent road points; determining whether the directional angle is less than a preset angle; if so, obtaining the point positions of the current road point and two adjacent road points, and adjusting the current road point based on the point positions of the current road point and two adjacent road points.

[0072] The above method limits sharp turns that may occur in road curves, resulting in gentler curve segments.

[0073] Optionally, after generating a guide curve network based on multiple guide curves and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and road key points to obtain the road curve of the target area, the method further includes: traversing the road points on the road curve and taking the road point at the time of traversal as the current road point; determining the height difference between the current road point and two adjacent road points, and calculating the ratio of the height difference to the curve length of the road curve to obtain slope information; determining whether the slope information is greater than a preset slope threshold; if so, obtaining the road segment corresponding to the current road point and two adjacent road points, and performing slope restriction processing on the road segment to obtain a new road segment; and adjusting the road curve of the target area according to the new road segment.

[0074] The above method limits the slope of curves that are too steep because the height-to-length ratio between the two guide lines connected by the guide curves is too large, so that the slope of the final curve will not exceed the expected value.

[0075] The model road generation device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The illustrated model road generation device structure does not constitute a limitation on the model road generation device provided in this disclosure. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0076] This disclosure also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the following steps: The process involves acquiring the target area and key road points from the geographic model, generating multiple sampling points based on the regional information of the target area, generating multiple process points based on the relative directions of the various landform elements corresponding to the target area and the multiple sampling points, and generating multiple guide curves for the target area based on the multiple process points and multiple sampling points. A guide curve network is then generated based on these multiple guide curves, and the network is used for pathfinding according to a preset pathfinding algorithm and the key road points to obtain the road curves for the target area. By generating a guide curve network containing guide curves with shapes similar to terrain contour lines, and since the guide lines are connected by line segments approximately perpendicular to their direction, the resulting road curves obtained by pathfinding on the guide curve network will have the shape of the guide curves, thus obtaining guide curves that conform to the terrain.

[0077] The above method generates a guide curve network containing guide curves with shapes similar to terrain contour lines, connecting the guide lines with line segments approximately perpendicular to their direction. This topology allows road curves to extend smoothly across the terrain and conform to common landform features, enhancing the overall coherence and realism of the road.

[0078] Optionally, obtaining the target area and road key points in the geographic model, and generating multiple sampling points based on the regional information of the target area includes: obtaining the target area and road key points in the geographic model, and obtaining the corresponding regional information based on the target area, wherein the regional information includes a regional mask; calculating the density information of the terrain voxels in the geographic model at the corresponding positions on the regional mask based on the ratio data between the terrain voxels in the geographic model and the regional mask; and generating sampling points based on the corresponding positions on the regional mask according to the density information, thereby obtaining multiple sampling points.

[0079] The above method generates sampling points based on the corresponding positions of density information on the region mask, resulting in multiple sampling points. These sampling points can be used for subsequent operations such as road planning and path search. By selecting an appropriate number and location of sampling points, the geographical features of the target area can be effectively represented, improving the accuracy and feasibility of road planning.

[0080] Optionally, multiple process points are generated based on the relative directions of the various terrain voxels corresponding to the target area and multiple sampling points. Multiple guide curves for the target area are then generated based on these process points and sampling points, including: traversing multiple sampling points and using the sampling point at the time of traversal as the current sampling point; generating multiple corresponding process points based on the relative directions of the current sampling point and the contour voxels in the various terrain voxels of the target area, wherein the contour voxels are terrain voxels at the same height as the current sampling point; connecting the current sampling point with the corresponding multiple process points to generate corresponding guide curves, and obtaining multiple guide curves when the traversal of multiple sampling points is completed.

[0081] The above method, during the generation of the guide curve, allows for spatial relationship analysis by considering the relative orientation of contour voxels between the current sampling point and various landform voxels in the target area. This helps in understanding the terrain features and geomorphic structure within the target area, identifying potential obstacles or terrain changes, and adjusting the guide curve accordingly to ensure the safety and effectiveness of road generation.

[0082] Optionally, generating multiple process points based on the relative directions of the current sampling point and the contour voxels in various terrain voxels in the target area includes: obtaining the relative directions of the contour voxels and the current sampling point; extending the current sampling point in the relative direction according to a preset extension distance to obtain the voxel search position; performing a spatial search based on the voxel search position to determine the terrain voxel closest to the voxel search position, and generating a process point at the position of the terrain voxel closest to the voxel search position.

[0083] The above method obtains high-precision terrain data by determining the terrain voxel at the same height as the current sampling point as the contour voxel, and performing a spatial search at the voxel search position to determine the terrain voxel closest to the voxel search position.

[0084] Optionally, obtaining the relative direction between the contour voxel and the current sampling point includes: determining the terrain voxel at the current sampling point and obtaining the gradient information of the terrain voxel at the current sampling point, wherein the gradient information records the fastest descent direction of the terrain voxel at the current sampling point; performing a cross product between the fastest descent direction and the vertical direction in the geographic model to obtain the relative direction between the contour voxel and the current sampling point.

[0085] The above method yields the relative orientation of the contour voxels to the current sampling point by cross-productting the fastest descent direction with the vertical direction in the geographic model. Calculating this relative orientation helps determine the azimuth of the contour voxels around the current sampling point.

[0086] Optionally, generating a guide curve network based on multiple guide curves includes: traversing multiple guide curves, performing a spatial search on curve points of any guide curve, and determining whether there is a nearest point within a preset search range for each curve point; if a nearest point exists, determining whether the nearest point has already been connected; if the nearest point has not been connected, connecting the curve point and the nearest point to obtain a connecting line; if there is no nearest point or the nearest point has already been connected, skipping the curve point; when traversing multiple guide curves is complete, generating a guide curve network based on the multiple guide curves and connecting lines.

[0087] The above method connects different guide curves to obtain a guide curve network containing all guide curves, and determines whether the curve points are connected to avoid duplicate connections.

[0088] Optionally, the pathfinding algorithm and road key points are used to find the road curves in the target area by performing pathfinding on the guide curve network, including: obtaining the pathfinding factors of the preset road curves and inputting the pathfinding factors into the pathfinding algorithm; using the pathfinding algorithm with input pathfinding factors to find the road key points in the guide curve network and calculating the cost of the pathfinding factors; and taking the curve with the lowest cost during the pathfinding process as the road curve of the target area.

[0089] The above method uses a pathfinding algorithm to evaluate each possible road curve based on preset pathfinding factors and calculate its cost value. The cost value can be a comprehensive indicator based on factors such as distance, time, and traffic flow, used to measure the quality of a path. By considering the cost value of pathfinding factors, the optimal road curve can be selected as the road for the target area to meet specific needs, such as the shortest path, the fastest path, or the least congested path.

[0090] Optionally, after generating a guide curve network based on multiple guide curves and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and road key points to obtain the road curves of the target area, the method further includes: traversing the road points on the road curves and taking the road points during traversal as the current road point; calculating the directional angle between the current road point and two adjacent road points; determining whether the directional angle is less than a preset angle; if so, obtaining the point positions of the current road point and two adjacent road points, and adjusting the current road point based on the point positions of the current road point and two adjacent road points.

[0091] The above method limits sharp turns that may occur in road curves, resulting in gentler curve segments.

[0092] Optionally, after generating a guide curve network based on multiple guide curves and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and road key points to obtain the road curve of the target area, the method further includes: traversing the road points on the road curve and taking the road point at the time of traversal as the current road point; determining the height difference between the current road point and two adjacent road points, and calculating the ratio of the height difference to the curve length of the road curve to obtain slope information; determining whether the slope information is greater than a preset slope threshold; if so, obtaining the road segment corresponding to the current road point and two adjacent road points, and performing slope restriction processing on the road segment to obtain a new road segment; and adjusting the road curve of the target area according to the new road segment.

[0093] The above method limits the slope of curves that are too steep because the height-to-length ratio between the two guide lines connected by the guide curves is too large, so that the slope of the final curve will not exceed the expected value.

[0094] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

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

[0096] The above-described embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit it. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure.

Claims

1. A method for generating model roads, characterized in that, The model road generation method includes: Obtain the target area and key road points in the geographic model, and generate multiple sampling points based on the regional information of the target area; Based on the relative directions of the various terrain voxels corresponding to the target area and the multiple sampling points, multiple process points are generated, and multiple guide curves for the target area are generated based on the multiple process points and the multiple sampling points. The process of generating multiple process points and multiple guide curves for the target area based on the relative directions of the various terrain voxels corresponding to the target area and the multiple sampling points includes: traversing the multiple sampling points and using the sampling point at the time of traversal as the current sampling point; generating multiple corresponding process points based on the relative directions of the current sampling point and the contour voxels in the various terrain voxels of the target area, wherein the contour voxels are terrain voxels at the same height as the current sampling point; connecting the current sampling point with the corresponding multiple process points to generate corresponding guide curves, and obtaining multiple guide curves when the traversal of the multiple sampling points is completed. The step of generating multiple corresponding process points based on the relative directions of the current sampling point and the contour voxels in the various terrain voxels in the target area includes: obtaining the relative direction of the contour voxels and the current sampling point; extending the current sampling point along the relative direction according to a preset extension distance to obtain the voxel search position; performing a spatial search based on the voxel search position to determine the terrain voxel closest to the voxel search position, and generating a process point at the position of the terrain voxel closest to the voxel search position; A guide curve network is generated based on the multiple guide curves, and the guide curve network is used to find the road curves of the target area according to the preset pathfinding algorithm and the road key points.

2. The model road generation method according to claim 1, characterized in that, The process of acquiring the target region and key road points in the geographic model, and generating multiple sampling points based on the regional information of the target region, includes: Obtain the target region and road key points in the geographic model, and obtain the corresponding region information based on the target region, wherein the region information includes region masking; Based on the ratio data between the terrain voxels in the geographic model and the area mask, calculate the density information of the terrain voxels in the geographic model at the corresponding positions on the area mask; Based on the density information, sampling points are generated at corresponding positions on the region mask to obtain multiple sampling points.

3. The model road generation method according to claim 1, characterized in that, The step of obtaining the relative direction between the isohyet voxel and the current sampling point includes: Determine the terrain voxels at the current sampling point and obtain the gradient information of the terrain voxels at the current sampling point, wherein the gradient information records the fastest descent direction of the terrain voxels at the current sampling point; The cross product of the fastest descent direction and the vertical direction in the geographic model is used to obtain the relative direction between the contour voxel and the current sampling point.

4. The model road generation method according to claim 1, characterized in that, The step of generating a guide curve network based on the multiple guide curves includes: Traverse the multiple guide curves, perform a spatial search on the curve points of any guide curve, and determine whether there is a nearest point of the curve point within a preset search range; If there exists a nearest point to the curve point, then determine whether the nearest point has been connected; If the nearest point is not connected, then connect the curve point and the nearest point to obtain a connecting line; If the nearest point does not exist or the nearest point has already been connected, then skip the curve point; When the traversal of the multiple guide curves is completed, a guide curve network is generated based on the multiple guide curves and the connecting lines.

5. The model road generation method according to claim 1, characterized in that, The step of finding the road curve of the target area by tracing the guiding curve network according to the preset pathfinding algorithm and the road key points includes: Obtain the pathfinding factor of the preset road curve and input the pathfinding factor into the pathfinding algorithm; The routing algorithm, by inputting routing factors, searches for the key points of the road in the guide curve network and calculates the cost of the routing factors. The curve with the lowest cost during the pathfinding process is taken as the road curve for the target area.

6. The model road generation method according to claim 1, characterized in that, After generating a guide curve network based on the multiple guide curves, and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curves of the target area, the method further includes: Iterate through the road points on the road curve and use the road point at the time of traversal as the current road point; Calculate the directional angle between the current road point and the two adjacent road points; Determine whether the included angle of the directions is less than a preset angle; If so, the current road point and the positions of the two adjacent road points are obtained, and the current road point is adjusted according to the positions of the current road point and the two adjacent road points.

7. The model road generation method according to claim 1, characterized in that, After generating a guide curve network based on the multiple guide curves, and performing pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curves of the target area, the method further includes: Iterate through the road points on the road curve and use the road point at the time of traversal as the current road point; Determine the height difference between the current road point and two adjacent road points, and calculate the ratio of the height difference to the curve length of the road curve to obtain the slope information; Determine whether the slope information is greater than a preset slope threshold; If so, obtain the road segments corresponding to the current road point and the two adjacent road points, and perform slope restriction processing on the road segments to obtain new road segments; The road curves of the target area are adjusted based on the new road segments.

8. A model road generation device, characterized in that, The model road generation device includes: The acquisition module is used to acquire the target area and road key points in the geographic model, and generate multiple sampling points based on the regional information of the target area; The guide curve generation module is used to generate multiple process points based on the relative directions of the various terrain voxels corresponding to the target area and the multiple sampling points, and to generate multiple guide curves for the target area based on the multiple process points and the multiple sampling points; traverse the multiple sampling points and take the sampling point at the time of traversal as the current sampling point; generate multiple corresponding process points based on the relative directions of the current sampling point and the contour voxels in the various terrain voxels on the target area, wherein the contour voxels are terrain voxels at the same height as the current sampling point; connect the current sampling point with the corresponding multiple process points to generate corresponding guide curves, and obtain multiple guide curves when the traversal of the multiple sampling points is completed; obtain the relative direction of the contour voxels and the current sampling point; extend the current sampling point in the relative direction according to the preset extension distance to obtain the voxel search position; perform a spatial search based on the voxel search position to determine the terrain voxel closest to the voxel search position, and generate a process point at the position of the terrain voxel closest to the voxel search position; The road curve generation module is used to generate a guide curve network based on the multiple guide curves, and to perform pathfinding on the guide curve network according to a preset pathfinding algorithm and the road key points to obtain the road curve of the target area.

9. A model road generation device, characterized in that, The model road generation device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the model road generation device to perform the steps of the model road generation method as described in any one of claims 1-7.

10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the model road generation method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Virtual character path planning method and device, electronic equipment and storage medium

    CN114404985A

  • Route planning method and device, electronic equipment and storage medium

    CN116637372A