Virtual road generation method and device, readable storage medium and electronic equipment
Virtual highways are generated by drawing spline curves. The first and second main roads and secondary roads are generated by using closed and open curves. This solves the problems of high cost and insufficient rationality in the existing technology of virtual highway generation, and realizes efficient and accurate virtual highway generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-12-27
- Publication Date
- 2026-05-29
AI Technical Summary
Existing virtual highway generation methods rely on external data, resulting in high drawing costs, large workloads, and an inability to guarantee the rationality of the roads.
By drawing spline curves, closed and open curves are generated. The first main road is generated based on the closed curve, the second main road is generated based on the open curve, and secondary roads are generated according to the regional orientation of the closed area. This avoids dependence on external data and improves generation efficiency and road rationality.
It achieves high efficiency and accuracy in virtual highway generation, avoids dependence on external data, and ensures the rationality and accuracy of road generation.
Smart Images

Figure CN116099201B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of virtual scene technology, and in particular to a method and apparatus for generating virtual highways, a computer-readable storage medium, and an electronic device. Background Technology
[0002] To enhance the player's gaming experience, virtual roads are often generated in the game scene to fulfill certain gaming needs of players.
[0003] In related technologies, road modules in the game scene can be planned in advance, and then placed according to the rules pre-planned by the network system to obtain virtual highways. However, this relies on external data (such as road data in the real world), which limits the planning freedom of virtual highways. Alternatively, virtual roads can be generated based on road data in the real world. Another approach is to have users draw spline curves and then generate intersecting roads through algorithms. However, drawing each road would increase the drawing cost and workload, and would also fail to guarantee the overall rationality of the roads.
[0004] Therefore, there is an urgent need in this field to develop a new method and apparatus for generating virtual highways.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this disclosure is to provide a method for generating virtual highways, a device for generating virtual highways, a computer-readable storage medium, and an electronic device, thereby overcoming, to at least a certain extent, the problems of high cost, large workload, and inability to guarantee the overall rationality of virtual highways caused by related technologies.
[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0008] According to a first aspect of the present invention, a method for generating virtual highways is provided, the method comprising: drawing spline curves, the spline curves including closed curves connected end-to-end and open curves not connected end-to-end; obtaining closed regions based on the closed curves; generating a first arterial road between the closed regions according to the region boundaries corresponding to the closed regions; generating a second arterial road corresponding to the open curves; and generating a secondary arterial road for connecting the arterial roads based on the region orientation corresponding to the closed regions; wherein the arterial roads include the first arterial road and / or the second arterial road.
[0009] According to a second aspect of the present invention, a virtual highway generation apparatus is provided, the apparatus comprising: a drawing module configured to draw spline curves, the spline curves including closed curves connected end-to-end and open curves not connected end-to-end; a first generation module configured to obtain closed regions based on the closed curves, and generate a first main road between the closed regions according to the region boundaries corresponding to the closed regions; and a second generation module configured to generate a second main road corresponding to the open curves, and generate secondary roads for connecting the main roads based on the region orientation corresponding to the closed regions; the main roads include the first main road and / or the second main road.
[0010] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores computer-readable instructions, which, when executed by the processor, implement the virtual highway generation method of any of the above exemplary embodiments.
[0011] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method for generating virtual highways in any of the above exemplary embodiments.
[0012] As can be seen from the above technical solutions, the virtual highway generation method, virtual highway generation device, computer storage medium, and electronic device in the exemplary embodiments of the present invention have at least the following advantages and positive effects:
[0013] In the methods and apparatus provided in the exemplary embodiments of this disclosure, the first main road is generated based on a closed curve, the second main road is generated based on an open curve, and the secondary roads are generated based on the orientation of the closed area corresponding to the closed curve. On the one hand, this avoids dependence on external data and also avoids the situation where users manually control the road direction. Virtual highways can be generated through spline curves, thereby improving the generation efficiency of virtual highways. On the other hand, it avoids the situation where roads of equal width are directly generated based on spline curves. Different main roads are generated based on different spline curves, ensuring the accuracy and rationality of road generation.
[0014] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0016] Figure 1 The schematic diagram illustrates a flowchart of a method for generating virtual highways in an embodiment of this disclosure;
[0017] Figure 2 This illustration schematically shows a spline curve drawn in an embodiment of the present disclosure;
[0018] Figure 3 A schematic diagram of the first main road in an embodiment of this disclosure is shown;
[0019] Figure 4 This schematic diagram illustrates the process of obtaining a closed region based on a closed curve in an embodiment of this disclosure.
[0020] Figure 5 This schematic diagram illustrates a closed area in an embodiment of the present disclosure.
[0021] Figure 6 This schematic diagram illustrates the process of generating the first main road between enclosed areas in an embodiment of the present disclosure;
[0022] Figure 7 A schematic diagram of the target spline curve in an embodiment of this disclosure is shown.
[0023] Figure 8 A schematic diagram of the first main road in an embodiment of this disclosure is shown;
[0024] Figure 9 This schematically illustrates a process diagram of determining the edge subdivision surfaces corresponding to the bounding box from among multiple subdivision surfaces in an embodiment of this disclosure;
[0025] Figure 10 This schematic diagram illustrates the process of generating target spline curves between closed regions based on edge subdivision surfaces in an embodiment of this disclosure;
[0026] Figure 11 This schematic diagram illustrates the process of generating the second main road corresponding to the open curve in an embodiment of this disclosure;
[0027] Figure 12 This schematic diagram illustrates the process of obtaining intersection detection results for trunk roads through trunk road intersection detection in an embodiment of this disclosure;
[0028] Figure 13This schematic diagram illustrates a process for determining the intersection type of a trunk road based on the intersection detection results in an embodiment of this disclosure.
[0029] Figure 14 This schematic diagram illustrates the process of achieving the interleaving between arterial roads according to the interleaving type in an embodiment of this disclosure to obtain a second arterial road;
[0030] Figure 15 This schematic diagram illustrates the process of obtaining a second main road by intersecting main roads according to the intersecting type in an embodiment of this disclosure;
[0031] Figure 16 This schematic diagram illustrates the process of generating an overpass corresponding to an interlaced grid surface based on quantity in an embodiment of this disclosure;
[0032] Figure 17 A schematic diagram of the second main road of a three-level grade-separated interchange in an embodiment of this disclosure is shown.
[0033] Figure 18 This illustration schematically shows a process diagram for generating secondary roads for connecting main roads in an embodiment of this disclosure;
[0034] Figure 19 A schematic diagram of a secondary arterial road in an embodiment of this disclosure is shown.
[0035] Figure 20 This schematic diagram illustrates the process of adjusting the first main road in an embodiment of the present disclosure;
[0036] Figure 21 This schematic diagram illustrates the process of adjusting the second main road in an embodiment of this disclosure;
[0037] Figure 22 The schematic diagram illustrates the structure of a virtual highway generation device according to an embodiment of the present disclosure;
[0038] Figure 23 An electronic device for a method of generating virtual highways according to an embodiment of the present disclosure is illustrated schematically;
[0039] Figure 24 The illustration schematically shows a computer-readable storage medium for a method of generating virtual highways according to an embodiment of the present disclosure. Detailed Implementation
[0040] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0041] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.
[0042] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0043] In view of the problems existing in related technologies, this disclosure proposes a method for generating virtual highways. Figure 1 A flowchart illustrating the method for generating virtual highways is shown, such as... Figure 1 As shown, the method for generating a virtual highway includes at least the following steps:
[0044] Step S110. Draw spline curves, which include closed curves that are connected end to end and open curves that are not connected end to end.
[0045] Step S120. Obtain the closed region based on the closed curve, and generate the first main road between the closed regions according to the region boundary corresponding to the closed region.
[0046] Step S130. Generate a second main road corresponding to the open curve, and generate a secondary road to connect the main road based on the area orientation corresponding to the closed area; the main road includes the first main road and / or the second main road.
[0047] In the method and apparatus provided in the exemplary embodiments of this disclosure, the first main road is generated based on a closed curve, the second main road is generated based on an open curve, and the secondary roads are generated based on the orientation of the closed area corresponding to the closed curve. On the one hand, this avoids dependence on external data and also avoids the situation where users manually draw each road, reducing production costs. Virtual highways can be generated through spline curves, improving the production efficiency of virtual highway networks. On the other hand, different roads can be generated according to different spline curves, distinguishing between the first and second main roads and ensuring the rationality of road generation.
[0048] The following section details each step of the method for generating virtual highways.
[0049] In step S110, spline curves are drawn, including closed curves that are connected end to end and open curves that are not connected end to end.
[0050] In the exemplary embodiments of this disclosure, a virtual highway can be generated using a terminal or a system in the terminal that can draw spline curves; this exemplary embodiment does not impose any particular limitation on this.
[0051] A spline curve is a curve composed of a set of control points. It's worth noting that the shape of a spline curve is formed by controlling these control points. Specifically, spline curves can be drawn by artists or other personnel involved in the generation of virtual roads; this exemplary embodiment does not impose any particular limitation on this.
[0052] The spline curves drawn are specifically divided into two types. The first type is a closed curve, where the two ends of the curve are connected. The second type is an open curve, where the two ends of the curve are not connected.
[0053] For example, Figure 2 This schematically illustrates a spline curve plotted in an embodiment of the present disclosure, such as... Figure 2 As shown, curve 210 is a closed curve with its beginning and end connected, and curve 220 is an open curve with its beginning and end disconnected.
[0054] In this exemplary embodiment, drawing closed and open curves helps to generate two types of main roads in the virtual highway based on spline curves, avoiding the dependence on external data in the prior art and thus improving the efficiency of virtual highway generation.
[0055] In step S120, a closed region is obtained based on the closed curve, and the first main road between the closed regions is generated according to the region boundary corresponding to the closed region.
[0056] In an exemplary embodiment of this disclosure, a closed region is a region formed by a closed curve, and the closed region can be viewed as an administrative region in a virtual highway. Based on this, the region boundary refers to the boundary of the closed region (i.e., the closed curve). The first arterial road refers to the arterial road between closed regions, and the first arterial road is generated based on the region boundary.
[0057] For example, Figure 3 A schematic diagram of the first main road in an embodiment of this disclosure is shown, such as... Figure 3 As shown, curve 310 is an open curve, region 320 is a closed region formed by closed curves, and trunk road 330 is the first trunk road between closed regions 320.
[0058] In an optional embodiment, Figure 4 The diagram illustrates the process of generating closed regions based on closed curves in the method for generating virtual highways. Figure 4 As shown, the method includes at least the following steps: in step S410, multiple vertices are determined on the closed curve, and multiple non-overlapping triangles are generated based on the multiple vertices.
[0059] The process of obtaining a closed region based on a closed curve is the process of converting the closed region into a surface. The specific conversion process can be obtained through a triangulation algorithm or based on other algorithms. This exemplary embodiment does not impose any special limitations on this.
[0060] The transformation process first requires identifying multiple vertices on the closed curve. These vertices refer to the points generated on the closed curve. Connecting these vertices yields multiple triangles. It's important to note that the triangles obtained by connecting multiple vertices must not overlap.
[0061] For example, Figure 5 A schematic diagram of a closed region in an embodiment of this disclosure is shown, such as... Figure 5 As shown, curve 510 is a closed curve with multiple vertices. Connecting these vertices yields the following result: Figure 5 The multiple non-overlapping triangles shown can be used to obtain a C-shaped closed region composed of multiple non-overlapping triangles.
[0062] In step S420, a closed region corresponding to the closed curve is formed by multiple triangles.
[0063] In this process, after obtaining multiple non-overlapping triangles, multiple faces of triangles corresponding to the triangles are obtained. These faces of multiple triangles form a closed region corresponding to the closed curve.
[0064] For example, such as Figure 5 The C-shaped closed region shown.
[0065] In this exemplary embodiment, multiple vertices are determined on the closed curve. Based on these multiple vertices, multiple non-overlapping triangles can be obtained, which in turn can yield a closed region corresponding to the closed curve, laying the foundation for generating the first main road.
[0066] In an optional embodiment, Figure 6 The diagram illustrates the process of generating the first main road between closed areas in the virtual highway generation method, as shown below. Figure 6 As shown, the method includes at least the following steps: In step S610, a bounding box corresponding to each closed region is determined, and the bounding box is divided to obtain multiple subdivision surfaces.
[0067] Here, the bounding box refers to a two-dimensional shape that covers the closed area. Specifically, the bounding box can be a rectangle or a square, and this exemplary embodiment does not make any special limitation on it.
[0068] By dividing the bounding box as defined above, multiple subdivision surfaces can be obtained. The bounding box is composed of these multiple subdivision surfaces.
[0069] For example, such as Figure 3 As shown, for Figure 3 The four closed regions 320 can be divided into four rectangular bounding boxes. These four rectangular bounding boxes correspond one-to-one with the four closed regions 320. By subdividing these four rectangular bounding boxes, multiple subdivision surfaces corresponding to each of the four bounding boxes can be obtained.
[0070] In step S620, edge subdivision surfaces corresponding to the bounding box are determined from multiple subdivision surfaces, and target spline curves between closed regions are generated based on the edge subdivision surfaces.
[0071] Here, the edge subdivision surface refers to a portion of the subdivision surface corresponding to the bounding box, that is, the subdivision surface located at the edge of the bounding box. The edge subdivision surface contains the boundary corresponding to the bounding box, and target spline curves between closed regions can be generated based on the points on these boundaries.
[0072] For example, Figure 7 This schematically illustrates a target spline curve in this exemplary embodiment, such as... Figure 7 As shown, curves 710, 720, and 730 are each part of three target spline curves. Figure 7 The faces represented by the multiple squares in the diagram are called subdivision faces (specifically, they include three subdivision faces, namely...). Figure 7 The subdivisions above, Figure 7 The subdivisions on the left and Figure 7 (The subdivision facet on the right). Based on Figure 7 The edge subdivision surfaces in the upper subdivision surface can obtain the target spline curve 710, based on Figure 7 The edge subdivision surfaces in the subdivision surface on the left can obtain the target spline curve 720, based on... Figure 7 The edge subdivision surface in the subdivision surface on the right can be used to obtain the target spline curve 730.
[0073] In step S630, the first main road between closed regions is generated based on the target spline curve.
[0074] The first main road can be generated by using the target spline curve as the center line of the first main road.
[0075] For example, Figure 8 A schematic diagram of the first main road in an embodiment of this disclosure is shown, such as... Figure 8 As shown, road 810 is the first main road generated based on target spline curve 710, road 820 is the first main road generated based on target spline curve 720, and road 830 is the first main road generated based on target spline curve 730.
[0076] In this exemplary embodiment, on the one hand, the first main road is logically the main road formed between administrative regions (i.e., closed regions), and this generation method makes the first main road more consistent with the boundaries of administrative regions; on the other hand, the first main road is generated according to the target spline curve, and the target spline curve is the curve corresponding to the edge subdivision surface of the bounding box, which avoids the situation of directly generating the main road corresponding to the spline curve, and increases the rationality and accuracy of the first main road.
[0077] In an optional embodiment, Figure 9 The diagram illustrates the process of determining the edge subdivision surfaces corresponding to the bounding box from multiple subdivision surfaces in the method for generating virtual highways. Figure 9 As shown, the method includes at least the following steps: in step S910, a first closed region corresponding to each of the multiple subdivision surfaces is determined.
[0078] The subdivision surface is formed by dividing a closed region. Therefore, the first closed region is the closed region that was divided when the subdivision surface was formed.
[0079] For example, each subdivision facet has two numbers, one of which is X. X refers to the number of the first closed region corresponding to the subdivision facet. For example, X = 1 for all subdivision faces in closed region 1, that is, the first closed region corresponding to all subdivision faces in closed region 1 is closed region 1.
[0080] In step S920, the distance values between the multiple subdivision surfaces and each closed region are calculated. Based on the distance values, a second closed region corresponding to each of the multiple subdivision surfaces is determined within the closed region.
[0081] Since the bounding box does not have the same shape as the enclosed region, some subdivision surfaces obtained after dividing the bounding box may not belong to any of the enclosed regions. However, the edge subdivision surfaces are determined from these multiple subdivision surfaces to facilitate the generation of the first main road. Therefore, to ensure the generation of a more accurate first main road, it is necessary to first ensure that more accurate edge subdivision surfaces can be obtained. Based on this, it is necessary to delete the subdivision surfaces that do not belong to any of the enclosed regions from the multiple subdivision surfaces.
[0082] The deletion process is based on the distance between the subdivision facets and the closed region. Therefore, it is necessary to first calculate the distance values between multiple subdivision faces and the closed region. Specifically, it can be the shortest straight-line distance between the midpoint of multiple subdivision faces and the boundary of the closed region.
[0083] After calculating the distance values, it is necessary to determine which second closed region each of the multiple subdivisions belongs to based on the distance values.
[0084] For example, each subdivision has two indices, X and Y. X refers to the indices of the closed regions corresponding to the subdivision; for instance, X = 1 for all subdivisions in closed region 1. Y is the indices of the second closed regions corresponding to each subdivision. It's worth noting that if the shortest straight-line distance between the midpoint of a subdivision and the second closed region is D-1, then D-1 is the minimum value of the shortest straight-line distance between the midpoint of the subdivision and each closed region. For example, if 50 subdivisions corresponding to closed region 1 are closest to closed region 1, then Y = 1 for these 50 subdivisions, meaning the second closed region corresponding to these 50 subdivisions is closed region 1. If another 50 subdivisions corresponding to closed region 1 are closest to closed region 2, then the second closed region corresponding to these 50 subdivisions is closed region 2.
[0085] In step S930, if the first closed region corresponding to the same first subdivision surface is different from the second closed region, the first subdivision surface is deleted from the multiple subdivision surfaces to obtain the target subdivision surface; the first subdivision surface is one or more of the multiple subdivision surfaces.
[0086] Among them, for subdivision surfaces, some subdivision surfaces have X values equal to Y values, while others have Z values that are not equal to Y values. In this case, the subdivision surfaces with X values that are not equal to Y values are deleted, and only the subdivision surfaces with X values equal to Y values (i.e., the target subdivision surfaces) are kept.
[0087] For example, if there are 50 subdivisions that are closest to closed region 1, then the Y=1 of these 50 subdivisions, meaning that the second closed region corresponding to these 50 subdivisions is closed region 1. If there are also 50 subdivisions that are closest to closed region 2, then the second closed region corresponding to these 50 subdivisions is closed region 2.
[0088] The first subdivision surface whose X value is not equal to the Y value is removed from the above 100 subdivision surfaces to obtain the target subdivision surface.
[0089] In step S940, edge subdivision surfaces corresponding to the bounding box are determined in the target subdivision surface.
[0090] The target subdivision includes multiple subdivisions corresponding to different closed regions, and the edge subdivision is the subdivision at the edge of the multiple subdivisions corresponding to different closed regions.
[0091] For example, there are 50 target subdivision surfaces corresponding to closed region X-1, 20 target subdivision surfaces corresponding to closed region X-2, and 15 target subdivision surfaces corresponding to closed region X-3. Based on this, the edge subdivision surface corresponding to bounding box box-1 can be determined from the 50 target subdivision surfaces corresponding to closed region X-1, the edge subdivision surface corresponding to bounding box box-2 can be determined from the 20 target subdivision surfaces corresponding to closed region X-2, and the edge subdivision surface corresponding to bounding box box-3 can be determined from the 15 target subdivision surfaces corresponding to closed region X-3. Here, bounding box box-1 is the bounding box of closed region X-1, bounding box box-2 is the bounding box of closed region X-2, and bounding box box-3 is the bounding box of closed region X-3.
[0092] In this exemplary instance, the first subdivision surface is deleted from multiple subdivision surfaces to obtain the target subdivision surface, which helps to determine the accurate edge subdivision surface in the subsequent process and improves the accuracy of generating the first main road based on the edge subdivision surface.
[0093] In an optional embodiment, Figure 10 The diagram illustrates the process of generating target spline curves between closed regions based on edge subdivision surfaces in the virtual highway generation method. Figure 10 As shown, the method includes at least the following steps: in step S1010, the edge vertices of the edge subdivision surface are determined, and the first parallel curve between closed regions is generated based on the edge vertices.
[0094] An edge subdivision surface is a surface composed of four edges. An edge belonging to only one surface is called an edge edge, and the point connecting any two edge edges is called an edge vertex. Using edge vertices as control points, the first linear curve between closed regions can be generated.
[0095] For example, edge subdivision surfaces are determined among the 50 target subdivision surfaces corresponding to the closed region X-1. Based on the edge vertices of these edge subdivision surfaces, the first identical curve Y-1 can be generated. Correspondingly, the first identical curve Y-2 corresponding to the closed region X-2 can be generated, and the first identical curve Y-3 corresponding to the closed region X-3 can also be generated.
[0096] In step S1020, a first control point corresponding to the first line curve is determined, and a control angle corresponding to the first control point is determined.
[0097] The first control point is the control point on the first curve, i.e., the edge vertex. The control angle is the control angle corresponding to the first control point.
[0098] For example, if three consecutive first control points Y-1-A, Y-1-B and Y-1-C are arbitrarily selected on the first identical curve Y-1, then the angle between the straight line segment formed by points Y-1-A and Y-1-B and the straight line segment formed by points Y-1-B and Y-1-C is the control angle.
[0099] In step S1030, an angle threshold corresponding to the control angle is determined. If there is a first control angle in the control angle that is greater than the angle threshold, the second control point corresponding to the first control angle is removed from the first control point.
[0100] The angle threshold refers to the critical value used to limit the control angle. When there is a first control angle greater than the angle threshold, it proves that the first control point makes the shape of the first spline curve tortuous. In this case, the second control point corresponding to the first control angle is directly removed so that the target spline curve generated later is a smooth spline curve.
[0101] For example, the angle threshold is 180°. Furthermore, if the control angle is greater than 180°, the second control point Y-1-B corresponding to the first control angle is removed from the first control point, and the first control points Y-1-A and Y-1-C are connected by a straight line segment to obtain the target spline curve.
[0102] In step S1040, if there is a second control angle smaller than the angle threshold in the control angle, then a first control point is added to the first spline curve to obtain the target spline curve.
[0103] If there is a second control angle smaller than the angle threshold in the control angle, it proves that a first control point can be added to the first spline curve to make the obtained target spline curve smoother.
[0104] For example, if the control angle is less than 180 degrees, find the straight line segments between the first control points Y-1-A and Y-1-B, and between Y-1-B and Y-1-C, respectively, and determine the midpoints corresponding to these two line segments. Name these midpoints Y-1-AB and Y-1-BC. Based on this, determine the midpoint between Y-1-AB and Y-1-BC and name it Y-1-ABC. Move the first control point Y-1-B to point Y-1-ABC to obtain the target spline curve.
[0105] In this exemplary embodiment, if there is a first control angle greater than the angle threshold in the control angle, the second control point corresponding to the first control angle is removed from the first control point; if there is a second control angle less than the angle threshold in the control angle, the first control point is added to the first spline curve so that the obtained target spline curve is a smooth curve, which is closer to the real highway and increases the accuracy of the first main road generation.
[0106] In step S130, a second main road corresponding to the open curve is generated, and a secondary road for connecting the main road is generated based on the area orientation corresponding to the closed area; the main road includes the first main road and / or the second main road.
[0107] In the exemplary embodiments of this disclosure, the second main road refers to a main road generated based on an open curve. The region orientation corresponds to the closed region and can be the orientation of the longest boundary in the closed region; this exemplary embodiment does not impose any special limitations on this.
[0108] Secondary arterial roads can be arterial roads that connect to primary arterial roads, arterial roads that connect to secondary arterial roads, or arterial roads that connect primary arterial roads and secondary arterial roads. Furthermore, secondary arterial roads are generated based on regional orientation.
[0109] For example, an open curve is used as the centerline of the road to generate a second arterial road. The orientation of the longest boundary of the closed area is used as the area orientation, and spline curves Y-01 parallel to the longest boundary of the closed area and Y-02 perpendicular to the longest boundary of the closed area are generated respectively. Based on spline curves Y-01 and Y-02, secondary arterial roads are generated to connect the arterial roads.
[0110] In an optional embodiment, Figure 11The diagram illustrates the process of generating the second arterial road corresponding to the open curve in the method for generating virtual highways. Figure 11 As shown, the method includes at least the following steps: in step S1110, the starting point position corresponding to the open curve is determined, and the ending point position corresponding to the open curve is determined.
[0111] An open curve has two ends, and correspondingly, each end of the open curve has a vertex. The starting point position refers to the position of the vertex at one end of the open curve, and the ending point position refers to the position of the vertex at the other end of the open curve.
[0112] For example, there are 10 drawn open curves. For the first open curve, there is a starting point position A-01 and an ending point position A-02; for the second open curve, there is a starting point position B-01 and an ending point position B-02. Similarly, for the remaining eight open curves, there are corresponding starting point positions and ending point positions.
[0113] In step S1120, the open curves are merged based on the starting point and ending point positions to obtain the merged open curves.
[0114] Specifically, based on the starting and ending points, open curves with similar positions are merged to obtain the merged open curve.
[0115] For example, there are 10 drawn open curves. If the positional difference between the starting point of open curve 1 and the starting point of open curve 2 is less than the difference threshold, and the positional difference between the ending point of open curve 1 and the ending point of open curve 2 is also less than the difference threshold, then open curve 1 and open curve 2 are merged into a single spline curve.
[0116] In step S1130, trunk lines corresponding to the merged open curves are generated, and trunk line intersection detection is performed on the trunk lines to obtain the intersection detection results.
[0117] In this process, open curves are merged to obtain merged open curves, which are then used as the centerline of the road to generate arterial roads.
[0118] Since there may be intersections between arterial roads, it is necessary to perform arterial road intersection detection on the generated arterial roads to obtain the intersection detection results. The intersection detection results can then be used to determine the intersection status between the arterial roads.
[0119] For example, open curve 1 and open curve 2 are merged to obtain open curve 1-2. Then, interlacing detection is performed on open curve 1-2 and the remaining eight open curves to obtain the corresponding interlacing detection results.
[0120] In step S1140, based on the intersection detection results, the intersection type of the trunk road is determined, and according to the intersection type, the intersection between the trunk roads is realized to obtain the second trunk road.
[0121] Among them, the intersection type refers to the type of intersection situation corresponding to the arterial road. Specifically, the intersection type can include a first type and a second type. The first type refers to the intersection type corresponding to the intersection, and the second type refers to the type corresponding to the overpass.
[0122] Once the intersection type is determined, the intersection between arterial roads can be implemented according to the intersection type to obtain a second arterial road including intersections or a second arterial road including overpasses.
[0123] For example, based on the intersection detection results, it can be determined that the intersection type between arterial roads 1-2, 3 and 4 is the first type, the intersection type between arterial roads 5 and 6 is the second type, and there is no intersection between arterial roads 7 and 8. Therefore, it is determined that arterial roads 1-2, 3 and 4 intersect through overpasses, arterial roads 5 and 6 intersect through intersections, and there is no intersection between arterial roads 7 and 8.
[0124] In this exemplary embodiment, the arterial road is subjected to arterial road intersection detection to obtain the intersection detection result. Based on the intersection detection result, the intersection type of the arterial road is determined. This helps to automatically generate a second arterial road that is more in line with the real-world road structure based on the intersection type, thereby increasing the rationality of the second arterial road structure.
[0125] In an optional embodiment, Figure 12 The diagram illustrates the process of obtaining intersection detection results for arterial roads in the virtual highway generation method. Figure 12 As shown, the method includes at least the following steps: In step S1210, the edge grid surface corresponding to the main road is determined among multiple grid surfaces, and the distance between the edge grid surface and the merged open curve is calculated.
[0126] The main road is composed of multiple grid surfaces. Specifically, the grid surface can be a square surface or a rectangular surface. This exemplary embodiment does not make any special limitation in this regard.
[0127] Edge grid surfaces refer to the grid surfaces located at the edges of main roads. The distances between the edge grid surfaces and the merged open curves are calculated separately to determine whether there is any intersection between main roads.
[0128] For example, there are 9 main roads and 9 open curves. The edge grid surfaces corresponding to these 9 main roads are determined, and the distance between each edge grid surface and the above 9 open curves is calculated.
[0129] In step S1220, a distance threshold corresponding to the distance is obtained. If the distance is inconsistent with the distance threshold, the edge grid surface is determined to be an interlaced grid surface, and the trunk road containing the interlaced grid surface is an interlaced trunk road.
[0130] The distance threshold refers to the critical value used for distance judgment. The distance threshold is the vertical distance from the grid edge to the main curve. Typically, the distance threshold is half the width of the main curve. Therefore, when the distance between a certain edge grid face and the merged open curve is inconsistent with the distance threshold, it proves that the main curve may intersect with other main curves at the location of the edge grid face. The corresponding edge grid face at this distance is the intersecting grid face, and the main curve including this intersecting grid face is the intersecting main curve. Conversely, if the distance is consistent with the distance threshold, it proves that the main curve does not intersect with other main curves. If the distances between all edge grid faces of a main curve and all merged open curves are equal to the distance threshold, it proves that this main curve does not intersect with other main curves.
[0131] For example, there are 9 main roads (including main roads 1-2) and 9 open curves. The edge grid surfaces corresponding to these 9 main roads are determined, and the distance between each edge grid surface and the above 9 open curves is calculated.
[0132] The distance threshold is half the width of the main road. If the distance between the edge grid surfaces M-1, M-2, and M-3 of several roads 1-2 and the open curve 1 is inconsistent with the distance threshold, then the edge grid surfaces M-1, M-2, and M-3 are considered to be staggered grid surfaces. Furthermore, main roads 1-2 that contain staggered grid surfaces are considered staggered main roads.
[0133] Similarly, it can be determined whether the remaining arterial roads include staggered grid surfaces, and whether the remaining arterial roads are staggered arterial roads.
[0134] In this exemplary embodiment, by determining whether the distance is consistent with the distance threshold, the staggered grid surface and the staggered trunk road can be determined, thereby laying the foundation for the subsequent implementation of the staggered relationship between trunk roads.
[0135] In an optional embodiment, Figure 13 The diagram illustrates the process of determining the intersection type of arterial roads based on intersection detection results in the virtual highway generation method, as shown below. Figure 13 As shown, the method includes at least the following steps: in step S1310, the edges corresponding to the staggered mesh face are determined and the edges are converted into edge spline curves.
[0136] Each staggered grid surface has its corresponding edge. For example, the staggered grid surface can be a square surface. The edge corresponding to the staggered grid surface and located at the edge of the main road is the edge corresponding to the staggered grid surface. By taking the connection point of the edges of different staggered grid surfaces as control points, the initial edge spline curve can be obtained.
[0137] For an initial edge spline curve, there are two ends corresponding to the initial edge spline curve, and thus corresponding start and end point positions. The start and end point positions of different edge spline curves are determined, and the initial edge spline curves are merged based on the determination results to obtain the final edge spline curve.
[0138] For example, an interlaced mesh surface consists of individual square faces. The edges of the determined interlaced mesh surface are the edges of the squares located at the main road edges. An initial edge spline curve can be generated by using a point on the edge of the interlaced mesh surface as a control point, or by using the points at the junctions of the edges of different interlaced mesh surfaces as control points. After merging the initial edge spline curves, the final edge spline curve can be obtained.
[0139] In step S1320, the curve type of the edge spline curve is determined. If the curve type is closed, the intersection type of the main road is determined to be the first type.
[0140] An edge spline curve can be either a closed curve with its ends connected, or an open curve with its ends disconnected. The type of curve determines whether an edge spline curve is open or closed.
[0141] If the curve type is closed, then it is proven that the edge spline curve is a closed curve. In this case, it is proven that there is an intersection with the arterial road corresponding to the staggered grid, that is, the staggered type of the arterial road at this point is the first type corresponding to the intersection.
[0142] For example, if the curve type of the determined edge spline curve is closed, then it proves that the intersection type of the arterial road is the first type corresponding to the intersection.
[0143] In step S1330, if the curve type is open, then the intersection type of the trunk road is determined to be the second type.
[0144] If the curve type is open, it proves that the arterial road intersects but does not intersect at this point, thus determining that the arterial road's intersection type is the second type corresponding to the overpass.
[0145] For example, if the curve type of the edge spline curve is open, then the intersection type of the main road corresponding to the staggered grid surface is considered to be the second type corresponding to the overpass.
[0146] In this exemplary embodiment, the intersection type of the main road corresponding to the intersecting grid surface can be accurately determined according to the curve type to which the edge spline curve belongs, which helps to generate a second main road that is more in line with the real world.
[0147] In an optional embodiment, Figure 14 The diagram illustrates the process of generating a virtual highway by implementing the interlacing of arterial roads according to the interlacing type to obtain a second arterial road. Figure 14 As shown, the method includes at least the following steps: In step S1410, if the interlacing type is the first type, the interlaced closed region corresponding to the edge spline curve is determined.
[0148] If the interlacing type is the first type, it proves that the edge spline curve is a closed spline curve. Therefore, the triangulation algorithm can be used to determine that the region enclosed by the closed edge spline curve is the interlaced closed region.
[0149] For example, if the interlacing type is type 1, then the interlacing closed region bounded by the edge spline curve can be determined.
[0150] In step S1420, the staggered closed area is subdivided to obtain the intersections corresponding to the staggered closed area, so as to obtain the second main road containing the intersections.
[0151] The intersecting closed area is further subdivided to obtain intersections within the intersecting closed area, which in turn leads to a second main road containing the intersections. It is worth noting that these intersections are used to achieve the intersecting between main roads.
[0152] Specifically, the intersecting closed regions are subdivided to obtain the intersections corresponding to the intersecting closed regions. Based on this, surface subdivision algorithms can be used to make the angles of the intersections smoother. Specifically, surface subdivision algorithms include the Catmull-Clark subdivision surface algorithm and the Loop subdivision surface algorithm.
[0153] For example, by subdividing the intersecting closed area using the Catmull-Clark subdivision surface algorithm, the intersections corresponding to the intersecting closed areas can be obtained, thus realizing the intersecting between arterial roads.
[0154] In this exemplary embodiment, when the intersection type is the first type, it is proven that an intersection needs to be generated. Based on this, the intersection closed region corresponding to the edge spline curve is determined, and the intersection closed region is subdivided to generate the intersection.
[0155] In an optional embodiment, Figure 15The diagram illustrates the process of generating a second main road by intersecting arterial roads according to the intersection type in the method for generating virtual highways. Figure 15 As shown, the method includes at least the following steps: In step S1510, if the interlacing type is the second type, all interlaced mesh surfaces corresponding to the second type are marked.
[0156] If the intersection type is the second type, it proves that although the main roads intersect, they do not intersect, and an overpass needs to be built between the main roads.
[0157] At this time, the interlaced mesh surfaces corresponding to the second type are marked. The interlaced mesh surfaces corresponding to the second type can be marked with numbers or letters. This exemplary embodiment does not make any special limitations on this.
[0158] For example, if the interlacing type is the second type corresponding to the overpass, then all interlacing grid surfaces corresponding to the second type will be marked as Y.
[0159] In step S1520, a preset distance threshold is determined. Based on a marked interlaced grid surface, a target area corresponding to a marked interlaced grid surface is determined. The boundary of the target area is at a preset distance threshold from a marked interlaced grid surface.
[0160] The preset distance threshold refers to a critical value. The target area refers to a region defined based on a marked interlaced grid surface. For example, it could be a circular region with a radius of the preset distance threshold defined by using the midpoint of a marked interlaced grid surface as the center point.
[0161] In step S1530, the number of marked staggered grid surfaces belonging to the target area is determined, and based on the number, grade-separated interchanges corresponding to the staggered grid surfaces are generated to obtain a second main road containing the grade-separated interchanges.
[0162] Specifically, the number of all marked interlaced grid faces belonging to the target area is determined. For example, the target area is a circular area with a radius of a preset distance threshold, defined by the midpoint of a marked interlaced grid face. Based on this, the number of all interlaced grid faces marked as Y belonging to this circular area is determined; specifically, the determined number is 3.
[0163] Once the quantity is determined, interchanges corresponding to the staggered grid surfaces can be generated. The number of levels in an interchange is related to the number of marked staggered grid surfaces within the target area, thus allowing the generation of a second arterial road containing interchanges. For example, if the number of marked staggered grid surfaces belonging to the target area is determined to be 3, then based on this number, a second arterial road containing an interchange with a three-level structure can be generated.
[0164] In this exemplary embodiment, the number of marked interlaced grid surfaces belonging to the target area is determined, and an overpass is generated based on the determined number to ensure that an accurate second main road can be generated.
[0165] In an optional embodiment, Figure 16 The diagram illustrates the process of generating interchanges corresponding to staggered grid surfaces based on quantity in the virtual highway generation method, as shown below. Figure 16 As shown, the method includes at least the following steps: in step S1610, the intersecting trunks corresponding to the marked intersecting grid surfaces belonging to the target area are determined, and the drawing time of the intersecting trunks is determined.
[0166] Among them, the marked staggered grid surfaces within the target area may belong to different staggered roads. In this case, it is necessary to determine which staggered road the marked staggered grid surface within the target area corresponds to. After determining the staggered road, the drawing time of the staggered road can be determined.
[0167] For example, the intersecting trunks corresponding to the intersecting grid surfaces marked Y within the target area are identified as intersecting trunks Z1-2, Z1-3, and Z1-4. Based on this, the drawing time corresponding to intersecting trunk Z1-2 is determined to be 13:11, the drawing time corresponding to intersecting trunk Z1-3 is 13:12, and the drawing time corresponding to intersecting trunk Z1-4 is 13:13.
[0168] In step S1620, different height values are assigned to the intersecting roads based on the drawing time; the height value is the height between the intersecting road and the ground.
[0169] The height value refers to the distance between the intersecting roads and the ground. Generally, by comparing the drawing times of different intersecting roads, a time comparison result can be obtained. Often, the intersecting road drawn first is closest to the ground, and the intersecting road drawn last is farthest from the ground.
[0170] For example, the intersecting trunks corresponding to the intersecting grid surfaces marked Y within the target area are identified as intersecting trunks Z1-2, Z1-3, and Z1-4. Based on this, the drawing time corresponding to intersecting trunk Z1-2 is determined to be 13:11, the drawing time corresponding to intersecting trunk Z1-3 is 13:12, and the drawing time corresponding to intersecting trunk Z1-4 is 13:13.
[0171] Based on this, since the drawing time 13:11 is before the drawing time 13:12, and the drawing time 13:12 is before the drawing time 13:13, the height value assigned to the staggered road Z1-2 is 100, the height value assigned to the staggered road Z1-3 is 130, and the height value assigned to the staggered road Z1-4 is 160.
[0172] In step S1630, an interchange corresponding to the staggered grid surface is generated based on the height value corresponding to the staggered arterial road; the number of layers and the quantity of the interchange correspond to each other.
[0173] Among them, an overpass can be generated based on the intersecting arterial roads and the corresponding height values of the intersecting arterial roads, and the number of layers and the quantity of the overpass correspond to each other.
[0174] For example, since the drawing time 13:11 is before the drawing time 13:12, and the drawing time 13:12 is before the drawing time 13:13, the height value assigned to the staggered road Z1-2 is 100, the height value assigned to the staggered road Z1-3 is 130, and the height value assigned to the staggered road Z1-4 is 160. Based on these height values, a grade-separated interchange with a three-level structure is generated.
[0175] Figure 17 A schematic diagram of the second main road of a three-level grade-separated interchange in an embodiment of this disclosure is shown, such as... Figure 17 As shown, arterial road 1710 is an intersecting arterial road Z1-2, arterial road 1720 is an intersecting arterial road Z1-3, and arterial road 1730 is an intersecting arterial road Z1-4.
[0176] In this exemplary embodiment, different height values are assigned to intersecting roads based on the rendering time, and three-dimensional interchanges can be generated based on the height values. This not only ensures the correct generation of interchanges, but also ensures that the generated interchanges are three-dimensional, which is more in line with real-world roads that include interchanges.
[0177] In an optional embodiment, Figure 18 The diagram illustrates the process of generating secondary roads to connect main roads in a virtual highway generation method, such as... Figure 18 As shown, the method includes at least the following steps: in step S1810, the orientation of the region corresponding to the bounding box is determined, and multiple edges are generated based on the region orientation.
[0178] In this embodiment, the bounding box corresponds to the closed region. The orientation of the bounding box can be the orientation of the longest edge of the closed curve corresponding to the closed region, or it can be the orientation of any edge within the closed region. This exemplary embodiment does not impose any special limitations on this.
[0179] Based on the region orientation corresponding to the bounding box, multiple edges can be generated. These edges include those with the same direction as the region orientation, as well as those with an arbitrary angle between their direction and the region orientation.
[0180] For example, the direction of the region corresponding to the bounding box is determined to be the direction of the longest edge in the closed region. Based on this, multiple edges are generated, including edges that are parallel to the longest edge in the closed region and edges that are perpendicular to the longest edge in the closed region.
[0181] In step S1820, if there are target points on multiple edges that coincide with the first main road or the second main road, the target points are removed from the multiple edges to obtain multiple target edges.
[0182] Here, the target point refers to the point among multiple edges that coincides with the first main road or the second main road. For example, if edge 1-1 in the generated multiple edges passes through the first main road D-1 vertically, then there are multiple target points that coincide between edge 1-1 and the first main road. These multiple target points are removed to obtain multiple target edges.
[0183] In step S1830, multiple target edges are converted into multiple target curves. Based on the position of the first main road or the position of the second main road, the positions of the multiple target curves are adjusted to obtain the adjusted multiple target curves.
[0184] After removing the target point, multiple target edges are obtained. These multiple target edges are then converted into multiple target curves. However, the endpoints of these target curves may not necessarily connect with the first or second main road. Therefore, the positions of these multiple target curves can be adjusted to positions where they can connect with the first or second main road.
[0185] For example, multiple target edges can be converted into multiple target curves. If the endpoint of target curve Q-1 is not connected to either the first main road or the second main road, then the endpoint of target curve Q-1 can be adjusted to the edge of the first main road, thus obtaining multiple target curves after adjustment.
[0186] In step S1840, secondary arterial roads are generated to connect the main arterial roads based on the adjusted multiple target curves.
[0187] In this process, secondary arterial roads are generated using the adjusted target curves as road centerlines. Since the adjusted target curves either connect to the first arterial road or the second arterial road, secondary arterial roads can be obtained to connect the first arterial road and / or the second arterial road.
[0188] For example, Figure 19 This schematic diagram illustrates a secondary arterial road in this exemplary embodiment, as shown below. Figure 19 As shown, Figure 19 There are 5 closed zones. Road 1910 is the first main road between the closed zones, and Road 1920 is the second main road. Figure 19 Roads shaped like 1930 are secondary arterial roads used to connect the first arterial road and / or the second arterial road.
[0189] In this exemplary embodiment, multiple edges are generated based on the region orientation, and target points in the multiple edges are removed. In addition, the positions of multiple curves corresponding to the multiple target edges are adjusted to ensure that secondary roads that can be used to connect the main roads are obtained, thereby improving the rationality of the generated secondary roads.
[0190] In an optional embodiment, Figure 20 The diagram illustrates the process of adjusting the first main road in the method for generating virtual highways, as shown below. Figure 20 As shown, the method includes at least the following steps: In step S2010, the position of the control point corresponding to the closed curve is adjusted to obtain the target closed curve.
[0191] Since a closed curve is a spline curve, it contains multiple control points. By adjusting the positions of these control points, the shape of the closed curve can be adjusted to obtain the target closed curve.
[0192] For example, it is possible to Figure 3 Adjusting the control points on the closed curve in the diagram, for example, can... Figure 3 The uppermost closed curve in the middle is from Figure 3 The shape shown is adjusted to a square shape, thus obtaining the target closed curve.
[0193] In step S2020, the target closed region corresponding to the target closed curve is determined based on the target closed curve.
[0194] After obtaining the target closed curve, the target closed region corresponding to the target closed curve can be redefined. The process of redefined region is similar to that of obtaining the closed region based on the closed curve, and will not be described in detail here.
[0195] For example, after obtaining the target closed curve, the target closed region is obtained by the target closed curve.
[0196] In step S2030, the first main road is updated according to the area boundary corresponding to the target closed area.
[0197] After the target closed area is determined, according to steps S610, S620 and S630, a target first main road corresponding to the target closed area is generated, so as to update the first main road by using the target first main road.
[0198] For example, based on the target closed area, a brand new target first main road can be generated. At this time, the target first main road is used to update the first main road, which realizes the adjustment of the first main road.
[0199] In this exemplary embodiment, adjusting the position of the control point corresponding to the closed curve can achieve the adjustment of the first main road corresponding to the closed curve. It can also manually modify a specific road, improving the flexibility of virtual road adjustment.
[0200] In an optional embodiment, Figure 21 The diagram illustrates the process of adjusting the second arterial road in the method for generating virtual highways, as shown below. Figure 21 As shown, the method includes at least the following steps: In step S2110, the position of the control point corresponding to the open curve is adjusted to obtain the target open curve.
[0201] Open curves are a type of spline curve, and therefore have control points. By adjusting the positions of these control points, a target open curve with a different shape can be obtained compared to the original open curve.
[0202] For example, it is possible to... Figure 3 The positions of the control points on the open curve shown are adjusted to obtain the target open curve.
[0203] In step S2120, a target second main road corresponding to the target open curve is generated based on the target open curve, so as to update the second main road using the target second main road.
[0204] The target second trunk road is generated based on the target open curve. The specific generation process is similar to that of generating a second trunk road based on an open curve, and will not be repeated here. After generating the target second trunk road, it can be used to update the second trunk road.
[0205] For example, based on the target open curve, a target second main road is generated. Then, the second main road in the virtual road is updated to the target second main road to achieve the adjustment of the second main road.
[0206] In this exemplary embodiment, adjusting the position of the control point corresponding to the open curve can achieve the adjustment of the second main road, and manual modification can be performed on a local road, improving the flexibility of virtual road adjustment.
[0207] In an optional embodiment, the method further includes: generating identifiers corresponding to the multiple target curves based on the location information of control points corresponding to the multiple target curves, so as to use the identifiers to adjust the secondary roads corresponding to the multiple target curves.
[0208] Each target curve has multiple control points. The location information of the control points can be the location information of the first control point on the target curve, the location information of the last control point on the target curve, or the location information of any control point on the target curve.
[0209] Based on the location information of the control points, a unique identifier corresponding to the target curve can be generated. Specifically, the location information of the first control point on the target curve and the location information of the last control point on the target curve can be used to generate a hash value corresponding to the target curve.
[0210] Since secondary arterial roads are generated based on the target curve, there is a one-to-one correspondence between the identifiers and the secondary arterial roads. Therefore, by using the identifier that uniquely corresponds to the secondary arterial road, it can be determined which secondary arterial road needs to be adjusted.
[0211] For example, given 22 target curves, the location information of the control points corresponding to each of these 22 target curves is determined, and hash values corresponding to each of the 22 target curves are generated using the location information of the control points. When it is necessary to adjust the secondary arterial road G-1 corresponding to the first target curve, the hash value corresponding to secondary arterial road G-1 can be used to determine which secondary arterial road needs adjustment from the 22 secondary arterial roads, and thus, the position of the secondary arterial road can be adjusted.
[0212] In this exemplary embodiment, based on the location information of the control points of the target curve, an identifier corresponding to the target curve can be generated, which helps to make flexible adjustments to the secondary road corresponding to the target curve using the identifier in the future.
[0213] In the methods and apparatus provided in the exemplary embodiments of this disclosure, the first main road is generated based on a closed curve, the second main road is generated based on an open curve, and the secondary roads are generated based on the orientation of the closed area corresponding to the closed curve. On the one hand, this avoids dependence on external data and also avoids the situation where users manually control the road direction. Virtual highways can be generated through spline curves, thereby improving the generation efficiency of virtual highways. On the other hand, it avoids the situation where roads of equal width are directly generated based on spline curves. Different main roads are generated based on different spline curves, ensuring the accuracy and rationality of road generation.
[0214] The method for generating virtual highways in this embodiment of the present disclosure will be described in detail below with reference to an application scenario.
[0215] Draw as Figure 2 The closed curve shown in curve 210 and Figure 2 The open curve is shown in curve 220. The area enclosed by the closed curve is the closed region, which corresponds to an administrative region in the real world. Based on the boundaries of the closed regions, the first main road between the closed regions can be generated.
[0216] Using open curves as road centerlines can generate secondary arterial roads. It's worth noting that secondary arterial roads may intersect with other arterial roads; therefore, intersection detection is necessary to determine the intersection type based on the results. Different intersection types can be processed differently, for example, resulting in secondary arterial roads including intersections or grade-separated interchanges, thus improving the rationality of arterial road generation.
[0217] After generating the first and second main roads, to connect the first and / or second main roads, a bounding box corresponding to the enclosed area can be determined, and the area orientation corresponding to the bounding box can be determined. Based on this, multiple secondary roads are generated to connect the first and / or second main roads. The orientation of the multiple secondary roads may be consistent with or inconsistent with the area orientation.
[0218] In this application scenario, the first main road is generated based on a closed curve, the second main road is generated based on an open curve, and the secondary roads are generated based on the orientation of the closed areas corresponding to the closed curves. On the one hand, this avoids dependence on external data and also avoids situations where users manually control the road direction. Virtual highways can be generated using spline curves, thereby improving the generation efficiency of virtual highways. On the other hand, it avoids the situation of directly generating roads of equal width based on spline curves. Different main roads are generated based on different spline curves, ensuring the accuracy and rationality of road generation.
[0219] Furthermore, in an exemplary embodiment of this disclosure, an apparatus for generating a virtual highway is also provided. Figure 22 A schematic diagram of the virtual highway generation device is shown, such as... Figure 22 As shown, the virtual highway generation device 2200 may include: a drawing module 2210, a first generation module 2220, and a second generation module 2230. Wherein:
[0220] The drawing module 2210 is configured to draw spline curves, including closed curves connected end to end and open curves not connected end to end; the first generation module 2220 is configured to obtain closed regions based on the closed curves, and generate a first main road between the closed regions according to the region boundaries corresponding to the closed regions; the second generation module 2230 is configured to generate a second main road corresponding to the open curves, and generate a secondary road for connecting the main roads based on the region orientation corresponding to the closed regions; the main roads include the first main road and / or the second main road.
[0221] The specific details of the virtual highway generation device 2200 have been described in detail in the corresponding virtual highway generation method, so they will not be repeated here.
[0222] It should be noted that although several modules or units of the virtual highway generation apparatus 2200 are mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0223] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0224] The following reference Figure 23 To describe an electronic device 2300 according to such an embodiment of the present invention. Figure 23The electronic device 2300 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0225] like Figure 23 As shown, the electronic device 2300 is manifested in the form of a general-purpose computing device. The components of the electronic device 2300 may include, but are not limited to: at least one processing unit 2310, at least one storage unit 2320, a bus 2330 connecting different system components (including storage unit 2320 and processing unit 2310), and a display unit 2340.
[0226] The storage unit stores program code that can be executed by the processing unit 2310, causing the processing unit 2310 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention.
[0227] Storage unit 2320 may include readable media in the form of volatile storage units, such as random access memory (RAM) 2321 and / or cache memory 2322, and may further include read-only memory (ROM) 2323.
[0228] Storage unit 2320 may also include a program / utility 2324 having a set (at least one) of program modules 2325, such program modules 2325 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may contain the reality of the network environment.
[0229] Bus 2330 can represent one or more of several types of bus structures, including memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processing unit, or local bus using any of the multiple bus structures.
[0230] Electronic device 2300 can also communicate with one or more external devices 2370 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 2300, and / or with any device that enables electronic device 2300 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 2350. Furthermore, electronic device 2300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 2360. As shown, network adapter 2360 communicates with other modules of electronic device 2300 via bus 2330. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 2300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0231] Through the above description of the embodiments, those skilled in the art will readily understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of this disclosure. For example, processing unit 2310 can execute... Figure 1 Step S110: Draw spline curves, which include closed curves connected end to end and open curves not connected end to end; Step S120: Obtain closed regions based on closed curves, and generate first main roads between closed regions according to the region boundaries corresponding to the closed regions; Step S130: Generate second main roads corresponding to open curves, and generate secondary roads for connecting main roads based on the region orientation corresponding to closed regions; Main roads include first main roads and / or second main roads.
[0232] In an optional embodiment, based on the aforementioned scheme, generating a first main road between closed regions according to the region boundary corresponding to the closed region includes: determining a bounding box corresponding to each closed region, dividing the bounding box into multiple subdivision surfaces; determining edge subdivision surfaces corresponding to the bounding boxes in the multiple subdivision surfaces, generating target spline curves between closed regions based on the edge subdivision surfaces; and generating the first main road between closed regions based on the target spline curves.
[0233] In an optional embodiment, based on the aforementioned scheme, edge subdivision surfaces corresponding to the bounding box are determined from multiple subdivision surfaces, including: determining a first closed region corresponding to the multiple subdivision surfaces; calculating the distance values between the multiple subdivision surfaces and each closed region, and determining a second closed region corresponding to the multiple subdivision surfaces in the closed region based on the distance values; if the first closed region corresponding to the same first subdivision surface is different from the second closed region, the first subdivision surface is deleted from the multiple subdivision surfaces to obtain a target subdivision surface; the first subdivision surface is one or more of the multiple subdivision surfaces; and edge subdivision surfaces corresponding to the bounding box are determined from the target subdivision surfaces.
[0234] In an optional embodiment, based on the aforementioned scheme, generating a target spline curve between closed regions based on an edge subdivision surface includes: determining the edge vertices of the edge subdivision surface, generating a first spline curve between closed regions based on the edge vertices; determining a first control point corresponding to the first spline curve, and determining a control angle corresponding to the first control point; determining an angle threshold corresponding to the control angle; if there is a first control angle greater than the angle threshold among the control angles, then removing a second control point corresponding to the first control angle from the first control points; if there is a second control angle less than the angle threshold among the control angles, then adding a first control point to the first spline curve to obtain the target spline curve.
[0235] In an optional embodiment, based on the aforementioned scheme, generating a second main road corresponding to the open curve includes: determining the starting point position corresponding to the open curve, determining the ending point position corresponding to the open curve; merging the open curve based on the starting point position and the ending point position to obtain a merged open curve; generating a main road corresponding to the merged open curve, and performing main road intersection detection on the main road to obtain an intersection detection result; determining the intersection type of the main road based on the intersection detection result, and realizing the intersection between the main roads according to the intersection type to obtain the second main road.
[0236] In an optional embodiment, based on the aforementioned scheme, the trunk road is composed of multiple grid surfaces; trunk road intersection detection is performed on the trunk road to obtain the intersection detection result, including: determining the edge grid surface corresponding to the trunk road among the multiple grid surfaces, calculating the distance between the edge grid surface and the merged open curve; obtaining a distance threshold corresponding to the distance, and if the distance and the distance threshold are inconsistent, the edge grid surface is determined to be an intersecting grid surface, and the trunk road containing the intersecting grid surface is an intersecting trunk road.
[0237] In an optional embodiment, based on the aforementioned scheme and the crossover detection results, the crossover type of the trunk road is determined, including: determining the edge corresponding to the crossover mesh surface and converting the edge into an edge spline curve; determining the curve type of the edge spline curve; if the curve type is a closed type, the crossover type of the trunk road is determined to be a first type; if the curve type is an open type, the crossover type of the trunk road is determined to be a second type.
[0238] In an optional embodiment, based on the aforementioned scheme, the intersection between arterial roads is realized according to the intersection type to obtain a second arterial road, including: if the intersection type is the first type, determining the intersection closed area corresponding to the edge spline curve; subdividing the intersection closed area to obtain the intersection corresponding to the intersection closed area to obtain a second arterial road containing the intersection.
[0239] In an optional embodiment, based on the aforementioned scheme, the intersection of arterial roads is achieved according to the intersection type to obtain a second arterial road, including: if the intersection type is a second type, marking all intersection grid surfaces corresponding to the second type; determining a preset distance threshold, using a marked intersection grid surface as a reference, determining a target area corresponding to a marked intersection grid surface; the boundary of the target area is at a preset distance threshold from a marked intersection grid surface; determining the number of marked intersection grid surfaces belonging to the target area, and based on the number, generating an interchange corresponding to the intersection grid surface to obtain a second arterial road containing the interchange.
[0240] In an optional embodiment, based on the aforementioned scheme and based on the quantity, generating interchanges corresponding to the staggered grid surfaces includes: determining the staggered arterial roads corresponding to the marked staggered grid surfaces belonging to the target area, and determining the drawing time of the staggered arterial roads; assigning different height values to the staggered arterial roads based on the drawing time; the height value is the height between the staggered arterial road and the ground; generating interchanges corresponding to the staggered grid surfaces based on the height values corresponding to the staggered arterial roads; the number of layers of the interchanges corresponds to the quantity.
[0241] In an optional embodiment, based on the aforementioned scheme, secondary arterial roads for connecting main roads are generated based on the region orientation corresponding to the enclosed region, including: determining the region orientation corresponding to the bounding box; generating multiple edges based on the region orientation; if there are target points on the multiple edges that coincide with the first or second main road, removing the target points from the multiple edges to obtain multiple target edges; converting the multiple target edges into multiple target curves; adjusting the positions of the multiple target curves according to the arterial position of the first or second main road to obtain adjusted multiple target curves; and generating secondary arterial roads for connecting main roads based on the adjusted multiple target curves.
[0242] In an optional embodiment, based on the foregoing scheme, the method further includes: adjusting the position of the control point corresponding to the closed curve to obtain the target closed curve; determining the target closed area corresponding to the target closed curve based on the target closed curve; and updating the first main road according to the area boundary corresponding to the target closed area.
[0243] In an optional embodiment, based on the foregoing scheme, the method further includes: adjusting the position of the control point corresponding to the open curve to obtain the target open curve; generating a target second main road corresponding to the target open curve based on the target open curve, so as to update the second main road using the target second main road.
[0244] In an optional embodiment, based on the foregoing scheme, the method further includes: generating identifiers corresponding to the multiple target curves based on the location information of the control points corresponding to the multiple target curves, so as to use the identifiers to adjust the secondary roads corresponding to the multiple target curves.
[0245] In an optional embodiment, based on the aforementioned scheme, obtaining a closed region based on a closed curve includes: determining multiple vertices on the closed curve, generating multiple non-overlapping triangles based on the multiple vertices, and forming a closed region corresponding to the closed curve from the multiple triangles.
[0246] In one embodiment of the electronic device provided in this disclosure, the first main road is generated based on a closed curve, the second main road is generated based on an open curve, and the secondary roads are generated based on the orientation of the closed area corresponding to the closed curve. On the one hand, this avoids dependence on external data and also avoids the situation where users manually control the road direction. Virtual highways can be generated through spline curves, thereby improving the generation efficiency of virtual highways. On the other hand, it avoids the situation where roads of equal width are directly generated based on spline curves. Different main roads are generated based on different spline curves, ensuring the accuracy and rationality of road generation.
[0247] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the invention, for example:
[0248] In one exemplary embodiment of this disclosure, a computer-readable signal medium is provided, which can draw spline curves, including closed curves connected end to end and open curves not connected end to end; a closed region is obtained based on the closed curves, and a first main road between the closed regions is generated according to the region boundary corresponding to the closed region; a second main road corresponding to the open curve is generated, and a secondary road for connecting the main road is generated based on the region orientation corresponding to the closed region; the main road includes the first main road and / or the second main road.
[0249] In an optional embodiment, based on the aforementioned scheme, generating a first main road between closed regions according to the region boundary corresponding to the closed region includes: determining a bounding box corresponding to each closed region, dividing the bounding box into multiple subdivision surfaces; determining edge subdivision surfaces corresponding to the bounding boxes in the multiple subdivision surfaces, generating target spline curves between closed regions based on the edge subdivision surfaces; and generating the first main road between closed regions based on the target spline curves.
[0250] In an optional embodiment, based on the aforementioned scheme, edge subdivision surfaces corresponding to the bounding box are determined from multiple subdivision surfaces, including: determining a first closed region corresponding to the multiple subdivision surfaces; calculating the distance values between the multiple subdivision surfaces and each closed region, and determining a second closed region corresponding to the multiple subdivision surfaces in the closed region based on the distance values; if the first closed region corresponding to the same first subdivision surface is different from the second closed region, the first subdivision surface is deleted from the multiple subdivision surfaces to obtain a target subdivision surface; the first subdivision surface is one or more of the multiple subdivision surfaces; and edge subdivision surfaces corresponding to the bounding box are determined from the target subdivision surfaces.
[0251] In an optional embodiment, based on the aforementioned scheme, generating a target spline curve between closed regions based on an edge subdivision surface includes: determining the edge vertices of the edge subdivision surface, generating a first spline curve between closed regions based on the edge vertices; determining a first control point corresponding to the first spline curve, and determining a control angle corresponding to the first control point; determining an angle threshold corresponding to the control angle; if there is a first control angle greater than the angle threshold among the control angles, then removing a second control point corresponding to the first control angle from the first control points; if there is a second control angle less than the angle threshold among the control angles, then adding a first control point to the first spline curve to obtain the target spline curve.
[0252] In an optional embodiment, based on the aforementioned scheme, generating a second main road corresponding to the open curve includes: determining the starting point position corresponding to the open curve, determining the ending point position corresponding to the open curve; merging the open curve based on the starting point position and the ending point position to obtain a merged open curve; generating a main road corresponding to the merged open curve, and performing main road intersection detection on the main road to obtain an intersection detection result; determining the intersection type of the main road based on the intersection detection result, and realizing the intersection between the main roads according to the intersection type to obtain the second main road.
[0253] In an optional embodiment, based on the aforementioned scheme, the trunk road is composed of multiple grid surfaces; trunk road intersection detection is performed on the trunk road to obtain the intersection detection result, including: determining the edge grid surface corresponding to the trunk road among the multiple grid surfaces, calculating the distance between the edge grid surface and the merged open curve; obtaining a distance threshold corresponding to the distance, and if the distance and the distance threshold are inconsistent, the edge grid surface is determined to be an intersecting grid surface, and the trunk road containing the intersecting grid surface is an intersecting trunk road.
[0254] In an optional embodiment, based on the aforementioned scheme and the crossover detection results, the crossover type of the trunk road is determined, including: determining the edge corresponding to the crossover mesh surface and converting the edge into an edge spline curve; determining the curve type of the edge spline curve; if the curve type is a closed type, the crossover type of the trunk road is determined to be a first type; if the curve type is an open type, the crossover type of the trunk road is determined to be a second type.
[0255] In an optional embodiment, based on the aforementioned scheme, the intersection between arterial roads is realized according to the intersection type to obtain a second arterial road, including: if the intersection type is the first type, determining the intersection closed area corresponding to the edge spline curve; subdividing the intersection closed area to obtain the intersection corresponding to the intersection closed area to obtain a second arterial road containing the intersection.
[0256] In an optional embodiment, based on the aforementioned scheme, the intersection of arterial roads is achieved according to the intersection type to obtain a second arterial road, including: if the intersection type is a second type, marking all intersection grid surfaces corresponding to the second type; determining a preset distance threshold, using a marked intersection grid surface as a reference, determining a target area corresponding to a marked intersection grid surface; the boundary of the target area is at a preset distance threshold from a marked intersection grid surface; determining the number of marked intersection grid surfaces belonging to the target area, and based on the number, generating an interchange corresponding to the intersection grid surface to obtain a second arterial road containing the interchange.
[0257] In an optional embodiment, based on the aforementioned scheme and based on the quantity, generating interchanges corresponding to the staggered grid surfaces includes: determining the staggered arterial roads corresponding to the marked staggered grid surfaces belonging to the target area, and determining the drawing time of the staggered arterial roads; assigning different height values to the staggered arterial roads based on the drawing time; the height value is the height between the staggered arterial road and the ground; generating interchanges corresponding to the staggered grid surfaces based on the height values corresponding to the staggered arterial roads; the number of layers of the interchanges corresponds to the quantity.
[0258] In an optional embodiment, based on the aforementioned scheme, secondary arterial roads for connecting main roads are generated based on the region orientation corresponding to the enclosed region, including: determining the region orientation corresponding to the bounding box; generating multiple edges based on the region orientation; if there are target points on the multiple edges that coincide with the first or second main road, removing the target points from the multiple edges to obtain multiple target edges; converting the multiple target edges into multiple target curves; adjusting the positions of the multiple target curves according to the arterial position of the first or second main road to obtain adjusted multiple target curves; and generating secondary arterial roads for connecting main roads based on the adjusted multiple target curves.
[0259] In an optional embodiment, based on the foregoing scheme, the method further includes: adjusting the position of the control point corresponding to the closed curve to obtain the target closed curve; determining the target closed area corresponding to the target closed curve based on the target closed curve; and updating the first main road according to the area boundary corresponding to the target closed area.
[0260] In an optional embodiment, based on the foregoing scheme, the method further includes: adjusting the position of the control point corresponding to the open curve to obtain the target open curve; generating a target second main road corresponding to the target open curve based on the target open curve, so as to update the second main road using the target second main road.
[0261] In an optional embodiment, based on the foregoing scheme, the method further includes: generating identifiers corresponding to the multiple target curves based on the location information of the control points corresponding to the multiple target curves, so as to use the identifiers to adjust the secondary roads corresponding to the multiple target curves.
[0262] In an optional embodiment, based on the aforementioned scheme, obtaining a closed region based on a closed curve includes: determining multiple vertices on the closed curve, generating multiple non-overlapping triangles based on the multiple vertices, and forming a closed region corresponding to the closed curve from the multiple triangles.
[0263] In one embodiment of the computer-readable signal medium provided in this disclosure, the first main road is generated based on a closed curve, the second main road is generated based on an open curve, and the secondary roads are generated based on the orientation of the closed area corresponding to the closed curve. On the one hand, this avoids dependence on external data and also avoids the situation where users manually control the road direction. Virtual highways can be generated through spline curves, thereby improving the generation efficiency of virtual highways. On the other hand, it avoids the situation of directly generating roads of equal width based on spline curves. Different main roads are generated based on different spline curves, ensuring the accuracy and rationality of road generation.
[0264] refer to Figure 24 As shown, a program product 2400 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0265] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0266] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0267] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0268] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0269] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A method for generating a virtual highway, characterized in that, The method includes: Draw spline curves, which include closed curves that are connected end to end and open curves that are not connected end to end; Based on the closed curve, a closed region is obtained, and a bounding box corresponding to each closed region is determined. The bounding box is divided into multiple subdivision surfaces. Among the multiple subdivision surfaces, an edge subdivision surface corresponding to each bounding box is determined. A target spline curve between the closed regions is generated based on the edge subdivision surface. Based on the target spline curve, a first main road between the closed regions is generated. The starting point and ending point of the open curve are determined. Based on the starting and ending points, the open curves are merged to obtain a merged open curve. A trunk road corresponding to the merged open curve is generated, and trunk road intersection detection is performed to obtain an intersection detection result. Based on the intersection detection result, the intersection type of the trunk road is determined. According to the intersection type, the trunk roads are intersected to obtain a second main road. Based on the orientation of the area corresponding to the closed area, a secondary trunk road is generated to connect the main roads. The main roads include a first main road and / or the second main road.
2. The method for generating virtual highways according to claim 1, characterized in that, Determining the edge subdivision surfaces corresponding to the bounding box from among the plurality of subdivision surfaces includes: Determine the first closed region corresponding to the plurality of subdivisions; Calculate the distance values between each of the plurality of subdivision surfaces and each closed region, and determine the second closed region corresponding to each of the plurality of subdivision surfaces in the closed region based on the distance values; If the first closed region corresponding to the same first subdivision surface is different from the second closed region, then the first subdivision surface is deleted from the plurality of subdivision surfaces to obtain the target subdivision surface; the first subdivision surface is one or more of the plurality of subdivision surfaces; In the target subdivision surface, the edge subdivision surfaces corresponding to the bounding box are determined respectively.
3. The method for generating virtual highways according to claim 1, characterized in that, The step of generating the target spline curve between the closed regions based on the edge subdivision surface includes: Determine the edge vertices of the edge subdivision surface, and generate the first identical curve between the closed regions based on the edge vertices; Determine the first control point corresponding to the first spline curve, and determine the control angle corresponding to the first control point; Determine the angle threshold corresponding to the control angle. If there is a first control angle in the control angle that is greater than the angle threshold, then remove the second control point corresponding to the first control angle from the first control point. If there is a second control angle smaller than the angle threshold in the control angle, then the first control point is added to the first spline curve to obtain the target spline curve.
4. The method for generating virtual highways according to claim 1, characterized in that, The main road is composed of multiple grid surfaces; The process of performing trunk road intersection detection on the trunk road to obtain the intersection detection result includes: Among the plurality of grid surfaces, the edge grid surface corresponding to the main road is determined, and the distance between the edge grid surface and the merged open curve is calculated; Obtain a distance threshold corresponding to the distance. If the distance is inconsistent with the distance threshold, determine that the edge grid surface is an interlaced grid surface and the trunk road containing the interlaced grid surface is an interlaced trunk road.
5. The method for generating virtual highways according to claim 4, characterized in that, Determining the intersection type of the arterial road based on the intersection detection results includes: Identify the edges corresponding to the interlaced mesh faces and convert the edges into edge spline curves; Determine the curve type of the edge spline curve; if the curve type is closed, then determine the intersection type of the main road as the first type. If the curve type is open, then the intersection type of the main road is determined to be the second type.
6. The method for generating virtual highways according to claim 5, characterized in that, The step of implementing the interlacing between the arterial roads according to the interlacing type to obtain a second arterial road includes: If the interlacing type is the first type, determine the interlaced closed region corresponding to the edge spline curve; The staggered closed area is further subdivided to obtain the intersections corresponding to the staggered closed area, so as to obtain the second main road including the intersections.
7. The method for generating virtual highways according to claim 5, characterized in that, The step of implementing the interlacing between the arterial roads according to the interlacing type to obtain a second arterial road includes: If the interlacing type is the second type, mark all the interlaced mesh surfaces corresponding to the second type; A preset distance threshold is determined, and a target region corresponding to the marked interlaced grid surface is determined based on a marked interlaced grid surface; the boundary of the target region is at a distance of the preset distance threshold from the marked interlaced grid surface. The number of marked staggered grid surfaces belonging to the target area is determined, and based on the number, an interchange corresponding to the staggered grid surfaces is generated to obtain a second main road including the interchange.
8. The method for generating virtual highways according to claim 7, characterized in that, The step of generating the overpass corresponding to the staggered grid surface based on the quantity includes: Identify the intersecting trunks corresponding to the marked intersecting grid surfaces within the target area, and determine the drawing time of the intersecting trunks; Based on the drawing time, different height values are assigned to the intersecting roads; the height value is the height between the intersecting road and the ground. Based on the height value corresponding to the intersecting arterial roads, an interchange corresponding to the intersecting grid surface is generated; the number of layers of the interchange corresponds to the quantity.
9. The method for generating virtual highways according to claim 1, characterized in that, The step of generating secondary arterial roads for connecting the main arterial roads based on the orientation of the area corresponding to the closed area includes: Determine the region orientation corresponding to the bounding box, and generate multiple edges based on the region orientation; If there is a target point on the multiple edges that coincides with the first main road or the second main road, then remove the target point from the multiple edges to obtain multiple target edges; The multiple target edges are converted into multiple target curves. Based on the position of the first main road or the position of the second main road, the positions of the multiple target curves are adjusted to obtain the adjusted multiple target curves. Based on the adjusted target curves, secondary arterial roads are generated to connect the main arterial roads.
10. The method for generating virtual highways according to claim 1, characterized in that, The method further includes: The positions of the control points corresponding to the closed curve are adjusted to obtain the target closed curve; Based on the target closure curve, determine the target closure region corresponding to the target closure curve; The first main road is updated based on the area boundary corresponding to the target closed area.
11. The method for generating virtual highways according to claim 1, characterized in that, The method further includes: Adjust the positions of the control points corresponding to the open curve to obtain the target open curve; Based on the target open curve, a target second main road corresponding to the target open curve is generated, so as to update the second main road using the target second main road.
12. The method for generating virtual highways according to claim 11, characterized in that, The method further includes: Based on the location information of the control points corresponding to the multiple target curves, identifiers corresponding to the multiple target curves are generated, and the secondary arterial roads corresponding to the multiple target curves are adjusted using the identifiers.
13. The method for generating virtual highways according to claim 1, characterized in that, The process of obtaining the closed region based on the closed curve includes: Multiple vertices are identified on the closed curve, and multiple non-overlapping triangles are generated based on these vertices; The plurality of triangles form a closed region corresponding to the closed curve.
14. A device for generating virtual highways, characterized in that, include: The drawing module is configured to draw spline curves, which include closed curves that are connected end to end and open curves that are not connected end to end. The first generation module is configured to obtain a closed region based on the closed curve, determine a bounding box corresponding to each closed region, divide the bounding box into multiple subdivision surfaces, determine an edge subdivision surface corresponding to each bounding box from the multiple subdivision surfaces, generate a target spline curve between the closed regions based on the edge subdivision surfaces, and generate a first main road between the closed regions based on the target spline curve. The second generation module is configured to determine the starting point position corresponding to the open curve, determine the ending point position corresponding to the open curve; merge the open curve based on the starting point position and the ending point position to obtain the merged open curve; generate the trunk road corresponding to the merged open curve, and perform trunk road intersection detection on the trunk road to obtain the intersection detection result; Based on the intersection detection results, the intersection type of the main road is determined, and the intersection between the main roads is realized according to the intersection type to obtain the second main road. Based on the area orientation corresponding to the closed area, a secondary road for connecting the main road is generated; the main road includes the first main road and / or the second main road.
15. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the method for generating a virtual highway according to any one of claims 1-13 by executing the executable instructions.
16. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the method for generating virtual highways according to any one of claims 1-13.