Methods, apparatus, equipment, storage media, and program products for drawing spatial lines

By converting the three-dimensional coordinates of the endpoints into mesh-encoded information and utilizing the mesh partitioning information of the spherical space to segment and render sub-segments, the accuracy and efficiency issues of spatial line drawing in spherical grid space are solved, achieving high-quality spatial line drawing.

CN115115799BActive Publication Date: 2026-03-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-19
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In spherical grid space, existing technologies struggle to accurately and quickly draw spatial lines, affecting the representation of solid elements.

Method used

By converting the three-dimensional coordinates of the endpoints of the line to be drawn into mesh-encoded information, and using the mesh partitioning information of the spherical space, sub-line segments are divided and rendered. A planar line drawing algorithm is used to draw the spatial line, and the drawing error is controlled within one mesh.

Benefits of technology

It improves the efficiency and quality of drawing spatial lines and reduces drawing errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115115799B_ABST
    Figure CN115115799B_ABST
Patent Text Reader

Abstract

This disclosure discloses a method, apparatus, device, storage medium, and program product for drawing spatial lines, relating to the field of computer technology, and particularly to the field of intelligent transportation. The specific implementation scheme is as follows: based on the three-dimensional coordinates of the endpoints of the line to be drawn and the mesh partitioning information of the spherical space, the mesh encoding information of the endpoints is determined; based on the mesh encoding information of the endpoints, a spatial line including the endpoints is drawn in the spherical space. The technical solution of this disclosure improves the efficiency and quality of spatial line drawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to intelligent transportation technology, specifically to a method, apparatus, device, storage medium, and program product for drawing spatial lines. Background Technology

[0002] Discrete Global Grid System (DGGS) breaks through the limitations of planar grids in representing geospatial information. It uses specific methods to recursively subdivide the curved surface of the Earth to form a multi-resolution grid hierarchy.

[0003] In vector data models, spatial entities on a sphere can be abstracted into three categories: points, lines, and surfaces. Among these, the geometric representation of line elements is the foundation of surface elements. Therefore, accurately and quickly drawing spatial lines in a spherical grid space is crucial for representing entity elements. Summary of the Invention

[0004] This disclosure provides a method, apparatus, device, storage medium, and program product for drawing spatial lines.

[0005] According to one aspect of this disclosure, a method for drawing spatial lines is provided, the method comprising:

[0006] Based on the three-dimensional coordinates of the endpoints in the line to be drawn and the mesh partitioning information of the spherical space, the mesh encoding information of the endpoints is determined;

[0007] Based on the grid encoding information of the endpoints, draw a spatial line including the endpoints in the spherical space.

[0008] According to another aspect of this disclosure, a spatial line drawing apparatus is provided, the apparatus comprising:

[0009] The encoding information determination module is used to determine the mesh encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the mesh partitioning information of the spherical space.

[0010] The spatial line drawing module is used to draw spatial lines including the endpoints in spherical space according to the grid encoding information of the endpoints.

[0011] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0012] At least one processor; and

[0013] A memory communicatively connected to the at least one processor; wherein,

[0014] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in any one of the embodiments of this disclosure.

[0015] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method described in any one of the embodiments of this disclosure.

[0016] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in any one of the embodiments of this disclosure.

[0017] The technology disclosed herein improves the efficiency and quality of spatial line drawing.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0019] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0020] Figure 1 This is a schematic diagram of a method for drawing spatial lines according to an embodiment of the present disclosure;

[0021] Figure 2a This is a schematic diagram of another method for drawing spatial lines according to an embodiment of the present disclosure;

[0022] Figure 2b This is a schematic diagram of a sub-segment spanning a rhombus block according to an embodiment of the present disclosure;

[0023] Figure 2c This is a schematic diagram of sub-segment segmentation according to an embodiment of the present disclosure;

[0024] Figure 3a This is a schematic diagram of another method for drawing spatial lines according to an embodiment of the present disclosure;

[0025] Figure 3b This is a schematic diagram of the activation of a rhombus mesh according to an embodiment of the present disclosure;

[0026] Figure 3c This is a rendering diagram of a sub-line segment according to an embodiment of the present disclosure;

[0027] Figure 4 This is a schematic diagram of a spatial line drawing apparatus according to an embodiment of the present disclosure;

[0028] Figure 5 This is a block diagram of an electronic device used to implement the spatial line drawing method of the embodiments of this disclosure. Detailed Implementation

[0029] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0030] Figure 1 This is a schematic diagram of a spatial line drawing method according to an embodiment of the present disclosure. The technical solution of the present disclosure is applicable to the case of drawing spatial lines based on converting the three-dimensional coordinates of the endpoints of the line to be drawn into mesh-coded information. The method can be executed by a spatial line drawing device, which can be implemented by software and / or hardware, and can generally be integrated into an electronic device, such as a terminal device. The method of the present disclosure specifically includes the following:

[0031] S110. Determine the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid subdivision information of the spherical space.

[0032] Among them, the three-dimensional coordinates are the coordinates of at least two known endpoints of the line to be drawn in the sphere. For example, the three-dimensional coordinates can be represented by geographic coordinates (latitude and longitude). For example, the three-dimensional coordinates of the endpoints are 29 degrees north latitude and 113 degrees east longitude. In addition, the three-dimensional coordinates can also be determined in a spherical coordinate system. Specifically, in the spherical coordinate system, the coordinates of a point on the sphere can be formed by the three elements of azimuth, elevation and distance.

[0033] Mesh partitioning of spherical space is similar to rasterization of a plane. It involves recursively partitioning the curved surface of a sphere using specific methods to create a seamless, non-overlapping, uniformly shaped, and nested multi-resolution mesh hierarchy. This mesh can replace traditional geographic coordinates for various calculations or rendering operations on spherical entities. For example, the spherical space can be partitioned into multiple equally sized rhombuses that cover the entire sphere. Each rhombus can then be further subdivided into multiple rhombus meshes to locate and render endpoints of lines to be drawn. Higher mesh partitioning levels result in smaller meshes, more accurate positioning, and lower rendering errors. The accuracy of endpoint positioning and rendering can be controlled by adjusting the mesh partitioning level.

[0034] In this embodiment of the disclosure, spatial lines are drawn based on at least two known endpoints of the line to be drawn. When the number of known endpoints is greater than two, the line to be drawn can be divided into combinations of at least two sub-segments by two adjacent endpoints. The two adjacent endpoints are the two ends of a sub-segment. During the drawing process, spatial lines can be drawn in units of sub-segments. After obtaining the three-dimensional coordinates of each endpoint in the line to be drawn, the three-dimensional coordinates of each endpoint can be converted into grid-coded information based on the grid partitioning information of the spherical space. Specifically, the grid-coded information corresponding to the grid where the endpoint is located can be used to replace the three-dimensional coordinates to represent the position information of the endpoint in the spherical space.

[0035] For example, after dividing the spherical space into multiple rhombuses of equal size, and further dividing each rhombus into multiple rhombus grids, the position of the endpoint is represented by the number of the rhombus in which the endpoint is located, and the position of the rhombus grid in which the endpoint is located within the rhombus. For example, if the rhombus in which the current endpoint is located is number 7, and the rhombus grid in which the endpoint is located is in the 3rd row and 2nd column of the rhombus in which the endpoint is located, the grid code information corresponding to the endpoint is (7, 3, 2).

[0036] S120. Draw a spatial line including the endpoints in the spherical space based on the grid encoding information of the endpoints.

[0037] In this embodiment of the disclosure, after determining the grid encoding information of each endpoint in the line to be drawn, a spatial line including the endpoints is drawn in the spherical space in units of sub-line segments according to the grid encoding information of each endpoint. Specifically, line segments composed of two adjacent endpoints are drawn in sequence, and finally a spatial line composed of at least one sub-line segment is obtained.

[0038] For example, the grid encoding information corresponding to the k endpoints contained in the line to be drawn is obtained, namely {code0, code1, code2, code3, ..., code...} k In this line, each pair of adjacent endpoints forms a sub-segment, and these sub-segments together constitute the line to be drawn. During the drawing process, the line to be drawn can be first divided into multiple sub-segments: {code0, code1}, {code1, code2}, ..., {code0, code1}. k-1 code k} Draw a spatial line in the spherical space that includes all the endpoints mentioned above, using sub-segments as units.

[0039] Optionally, after dividing the spherical space into multiple rhombus blocks, the surface of each rhombus block can be approximated as a plane. Then, when drawing line segments located within the rhombus blocks, the line drawing method used in planes can be used to draw spatial lines.

[0040] The technical solution of this disclosure determines the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid partitioning information of the spherical space. Then, based on the grid encoding information of the endpoints, a spatial line including the endpoints is drawn in the spherical space. By converting the three-dimensional coordinates of the endpoints into grid encoding information through the grid partitioning information of the spherical space, the spatial line can be drawn based on the grid encoding information. By controlling the grid partitioning information, the drawing error of the spatial line can be controlled within one grid, thereby improving the drawing quality of the spatial line. Furthermore, the spatial line is rendered in units of grids, thereby improving the drawing efficiency of the spatial line.

[0041] Figure 2a This is a schematic diagram of a method for drawing spatial lines according to an embodiment of this disclosure. Based on the above embodiment, it further refines the method by providing specific steps for drawing spatial lines including endpoints in spherical space according to the grid encoding information of the endpoints. The following is in conjunction with... Figure 2a The present disclosure provides a method for drawing spatial lines, which includes the following:

[0042] S210. Determine the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid subdivision information of the spherical space.

[0043] Optionally, the meshing information of the spherical space is obtained by the following processing: the spherical space is pre-divided into at least two rhomboid blocks; and the rhomboid blocks are pre-divided into at least two rhomboid meshes arranged in rows and columns;

[0044] The grid encoding information of the endpoint includes the block number of the rhombus block in which the endpoint is located, as well as the row number and column number of the rhombus grid in the rhombus block.

[0045] In this optional embodiment, a method for obtaining mesh partitioning information of spherical space is provided. Specifically, the spherical space is pre-divided into at least two rhombus blocks of equal size. In order to achieve a more accurate expression of endpoint positions, each rhombus block is further divided into at least two rhombus meshes arranged in rows and columns. A unique rhombus mesh can be determined based on the row and column of the rhombus mesh in the rhombus block.

[0046] Based on the mesh partitioning information of the spherical space described above, the position of each endpoint in the spherical space can be represented by the set of the rhombus block number d containing the endpoint, and the row number i and column number j of the rhombus grid within the block. Furthermore, the error range of the endpoint position can be controlled by adjusting the rhombus grid partitioning level. A higher partitioning level results in smaller rhombus grid areas, more accurate endpoint positioning, and consequently, smaller drawing errors for spatial lines. Therefore, controlling the rhombus grid partitioning level can control the drawing errors of spatial lines and improve their drawing quality.

[0047] For example, the spherical space is divided into 10 rhombus-shaped blocks numbered from 0 to 9. Each rhombus-shaped block is then divided into a 15*15 rhombus grid. The rhombus-shaped block containing the current endpoint is numbered 2, and the endpoint is located in the 2nd row and 2nd column of the rhombus-shaped block numbered 2. The grid code information corresponding to this endpoint is (2, 2, 2). Furthermore, for ease of calculation, the elements contained in the grid code information can also be described using a binary representation.

[0048] S220. Construct sub-segments based on adjacent endpoints and obtain the grid encoding information of the endpoints in the sub-segments.

[0049] In this embodiment of the disclosure, before drawing the spatial line, the spatial line is divided into at least one sub-segment based on the adjacent endpoints, and then the grid encoding information of the endpoints in the sub-segment is obtained. In the subsequent drawing process, the spatial line can be drawn in units of sub-segments.

[0050] For example, based on the obtained grid encoding information of each endpoint, {code0, code1, code2, code3}, multiple sub-segments are constructed and the grid encoding information of the endpoints in each sub-segment is obtained as {code0, code1}, {code1, code2}, {code2, code3}, respectively. Subsequently, spatial lines can be drawn in units of sub-segments.

[0051] S230. Based on the grid encoding information of the endpoints in the sub-segment, determine whether the endpoints in the sub-segment are in the same rhombus block.

[0052] In this embodiment of the disclosure, before drawing the sub-line segment, the grid encoding information of the endpoints in the sub-line segment is used to determine whether the endpoints in the sub-line segment are in the same rhombus block. The sphere in a rhombus block can be regarded as a plane. If the two endpoints in the sub-line segment are in the same rhombus block, the method of drawing line segments in a plane can be introduced to draw the spherical line segment, thereby improving the efficiency and quality of spatial line drawing.

[0053] For example, the grid coding information of the endpoints in the obtained sub-segment is {code0, code1}. The number of the rhombus block where the endpoint is located can be obtained from the grid coding information of the two endpoints. If the corresponding numbers are the same, it means that the endpoints in the sub-segment are in the same rhombus block; otherwise, they are in different rhombus blocks.

[0054] S240. If the endpoints of any sub-segment are located in different rhombus blocks, divide the sub-segment into at least two sub-segments located in the same rhombus block.

[0055] In this embodiment of the disclosure, if the two endpoints of a sub-line segment are located in different rhombus blocks, and a line drawing algorithm in a plane cannot be introduced to draw the sub-line segment, then it is necessary to divide the sub-line segment into at least two sub-line segments whose two endpoints are located in the same rhombus block.

[0056] For example, such as Figure 2b As shown in the diagram, the two endpoints of sub-segment L are located within different rhombus blocks, meaning sub-segment L crosses the edges of the rhombus blocks. Therefore, this sub-segment is further divided into the following sections: Figure 2c The two sub-segments L0 and L1 shown are located within the same rhombus block. At this time, the two endpoints of all the sub-segments that make up the line to be drawn are located within the same rhombus block.

[0057] S250. Draw sub-line segments in the same rhombus block in spherical space to obtain space lines.

[0058] In this embodiment of the disclosure, after dividing the line to be drawn into multiple sub-segments with their two endpoints located in the same rhombus block, the sub-segments located in the same rhombus block can be drawn sequentially in the spherical space, and finally the space line is composed of multiple sub-segments.

[0059] For example, such as Figure 2c As shown, by introducing a line drawing algorithm in a plane, sub-segments with two endpoints in the same rhombus are regarded as sub-segments in the plane. Then, by using the line drawing algorithm in a plane, sub-segments L0 and L1 in the same rhombus are drawn sequentially in the spherical space, and finally, a spatial line composed of all sub-segments is obtained. By introducing a line drawing algorithm in a plane, the drawing efficiency of spatial lines can be improved.

[0060] The technical solution of this disclosure embodiment determines the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid partitioning information of the spherical space. Sub-segments are constructed based on adjacent endpoints, and the grid encoding information of the endpoints in the sub-segments is obtained. Then, based on the grid encoding information of the endpoints in the sub-segments, it is determined whether the endpoints in the sub-segments are in the same rhombus block. If the endpoints in any sub-segment are in different rhombus blocks, the sub-segment is divided into at least two sub-segments in the same rhombus block. Finally, the sub-segments in the same rhombus block are drawn in the spherical space to obtain a spatial line. After dividing the line to be drawn into multiple sub-segments, a planar line drawing algorithm is introduced to draw each sub-segment, thereby improving the drawing efficiency of the spatial line and reducing the drawing error.

[0061] Figure 3aThis is a schematic diagram of a method for drawing spatial lines according to an embodiment of this disclosure. Based on the above embodiment, it further refines the method by providing specific steps for dividing a sub-segment into at least two sub-segments located in the same rhombus block when the endpoints of any sub-segment are located in different rhombus blocks, and specific steps for drawing sub-segments located in the same rhombus block in spherical space to obtain a spatial line. The following is a combination of... Figure 3a The present disclosure provides a method for drawing spatial lines, which includes the following:

[0062] S310. Determine the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid subdivision information of the spherical space.

[0063] Optionally, the mesh partitioning information of the spherical space is obtained by the following processing: the spherical space is pre-divided into at least two rhomboid blocks; and the rhomboid blocks are pre-divided into at least two rhomboid meshes arranged in rows and columns;

[0064] The grid encoding information of the endpoint includes the block number of the rhombus block in which the endpoint is located, as well as the row number and column number of the rhombus grid in the rhombus block.

[0065] S320. Construct sub-segments based on adjacent endpoints and obtain the grid encoding information of the endpoints in the sub-segments.

[0066] S330. Based on the grid encoding information of the endpoints in the sub-segment, determine whether the endpoints in the sub-segment are in the same rhombus block.

[0067] S340. If the endpoints of any sub-segment are located in different rhombus blocks, add at least one endpoint at at least one intersection point between the sub-segment and the edge of the rhombus block.

[0068] In this embodiment of the disclosure, when the endpoints of any sub-segment lie in different rhombus blocks, the intersection points of the sub-segment and the edges of the rhombus blocks are first obtained. There may be one or more intersection points, depending on the number of rhombus blocks the sub-segment crosses. Finally, the rhombus grid containing at least one intersection point is added to the sub-segment as a new endpoint. For example, when a sub-segment crosses two rhombus blocks, the intersection point with the edges of the rhombus blocks is first obtained, and this intersection point is also used as an endpoint of the sub-segment.

[0069] S350. Based on the addition of at least one endpoint, divide the sub-segment into at least two sub-segments located in the same rhombus block.

[0070] In this embodiment of the disclosure, after adding at least one endpoint to a sub-segment, the current sub-segment is divided into multiple sub-segments based on the added endpoint. The two endpoints of each sub-segment are located within the same rhombus block. For example, adding an endpoint at the intersection of the current sub-segment and the edge of the rhombus block divides the current sub-segment into two sub-segments based on that endpoint, with both endpoints of these two sub-segments located within the same rhombus block. Based on this, a planar line drawing algorithm can be introduced to improve the efficiency and quality of spatial line drawing.

[0071] S360. Establish a two-dimensional coordinate system on the rhombus block where the endpoints of the sub-segment are located, with the two adjacent edges of the rhombus block as coordinate axes.

[0072] In this embodiment of the disclosure, in order to draw each sub-segment whose endpoints are in the same rhombus block, a two-dimensional coordinate system is established on the rhombus block where the endpoints of the sub-segments are located, with the two adjacent edges of the rhombus block as coordinate axes, so as to draw each sub-segment using a line drawing algorithm in a plane.

[0073] For example, such as Figure 3b As shown, a two-dimensional coordinate system is established with the two sides of the rhombus block containing the sub-segment as coordinate axes. The two coordinate axes of the two-dimensional coordinate system are the J-axis and the I-axis, which facilitates the subsequent determination of other intermediate points in the sub-segment except for the endpoints based on this two-dimensional coordinate system.

[0074] S370. Based on the endpoints of the sub-segment, step along any coordinate axis direction according to a set step size to complete at least one intermediate point of the sub-segment, thus obtaining the completed sub-segment.

[0075] In this embodiment, the rhombus block containing the sub-segment is considered as a plane. Based on the two endpoints of the sub-segment, the sub-segment is completed by stepping along any coordinate axis with a set step size, obtaining at least one intermediate point of the sub-segment endpoint. For example, in the two-dimensional coordinate system described in S360, the sub-segment can be represented as I = kJ + b. Multiple intermediate points in the sub-segment, excluding the two endpoints, can be obtained by stepping along the J-axis with a step size of 1, resulting in the completed sub-segment l.

[0076] S380. Render the diamond-shaped mesh through which the completed sub-segment passes to obtain the space line.

[0077] In this embodiment of the disclosure, after obtaining the completed sub-line segment, the rhombic mesh traversed by the sub-line segment is rendered to obtain a spatial line. For example, as shown... Figure 3b As shown, all the rhombus grids traversed by the sub-line segment are activated to complete the rendering of the sub-line segment, thus forming a spatial line composed of at least one sub-line segment contained in the line segment to be drawn. For another example, the rhombus grids on the two nearest sides of the completed sub-line segment along the I-axis direction can be activated first, namely (d, j, ... ) and (d, j, Then, the activated rhombus mesh is rendered, where (d, j, ... () represents the diamond-shaped grid located above the sub-segment along the I-axis direction, (d, j, The symbol () represents a rhombus-shaped grid located below the sub-segments along the I-axis. By treating the sphere within a rhombus as a plane and performing completion and rendering of each sub-segment, the drawing error of spatial lines can be controlled within a rhombus grid, thus reducing the drawing error of spatial lines.

[0078] Optionally, the rhombus mesh traversed by the completed sub-segment is rendered, including:

[0079] The rhombus mesh is rendered based on the distance between its center point and the completed sub-segments.

[0080] The closer the distance, the darker the color of the corresponding diamond-shaped mesh.

[0081] In this optional embodiment, such as Figure 3c As shown, the distance between the center point of each rhombus grid passed through by the sub-line segment and the completed sub-line segment is calculated. The rhombus grid is then colored with grayscale according to the distance. Specifically, according to the preset weight, the rhombus grid that is closer to the sub-line segment has a higher grayscale value, which avoids obvious jagged edges on the drawn spatial lines and improves the quality of the drawn spatial lines.

[0082] The technical solution of this disclosure embodiment determines the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid partitioning information of the spherical space. Sub-segments are constructed based on adjacent endpoints, and the grid encoding information of the endpoints in the sub-segments is obtained. Then, based on the grid encoding information of the endpoints in the sub-segments, it is determined whether the endpoints in the sub-segments are in the same rhombus block. When the endpoints in any sub-segment are in different rhombus blocks, at least one endpoint is added at at least one intersection point of the sub-segment and the edge of the rhombus block. Based on the added at least one endpoint, the sub-segment is divided into at least two sub-segments in the same rhombus block. A two-dimensional coordinate system is established on the rhombus block where the endpoints of the sub-segments are located, with the two adjacent edges of the rhombus block as coordinate axes. Finally, based on the endpoints of the sub-segments, at least one intermediate point of the sub-segment is completed by stepping in any coordinate axis direction according to a set step size to obtain the completed sub-segment. The rhombus grid through which the completed sub-segment passes is rendered to obtain a spatial line, thereby improving the drawing efficiency and quality of the spatial line.

[0083] Figure 4 This is a schematic diagram of the structure of a spatial line drawing device according to an embodiment of the present disclosure. The spatial line drawing device 400 includes: an encoding information determination module 410 and a spatial line drawing module 420.

[0084] The encoding information determination module 410 is used to determine the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid partitioning information of the spherical space.

[0085] The spatial line drawing module 420 is used to draw spatial lines including the endpoints in spherical space based on the grid encoding information of the endpoints.

[0086] The technical solution of this disclosure determines the grid encoding information of the endpoints based on the three-dimensional coordinates of the endpoints in the line to be drawn and the grid partitioning information of the spherical space. Then, based on the grid encoding information of the endpoints, a spatial line including the endpoints is drawn in the spherical space. By converting the three-dimensional coordinates of the endpoints into grid encoding information through the grid partitioning information of the spherical space, the spatial line can be drawn based on the grid encoding information. By controlling the grid partitioning information, the drawing error of the spatial line can be controlled within one grid, thereby improving the drawing quality of the spatial line. Furthermore, the spatial line is rendered in units of grids, thereby improving the drawing efficiency of the spatial line.

[0087] Optionally, the meshing information of the spherical space is obtained by the following processing: the spherical space is pre-divided into at least two rhomboid blocks; and the rhomboid blocks are pre-divided into at least two rhomboid meshes arranged in rows and columns;

[0088] The grid encoding information of the endpoint includes the block number of the rhombus block in which the endpoint is located, as well as the row number and column number of the rhombus grid in the rhombus block.

[0089] Optional, the space line drawing module 420 includes:

[0090] The encoding information acquisition unit is used to construct sub-segments based on adjacent endpoints and acquire the grid encoding information of the endpoints in the sub-segments;

[0091] The position determination unit is used to determine whether the endpoints of the sub-segment are in the same rhombus block based on the grid encoding information of the endpoints in the sub-segment;

[0092] A sub-segment segmentation unit is used to divide a sub-segment into at least two sub-segments that are in the same diamond block when the endpoints of any sub-segment are in different diamond blocks.

[0093] The spatial line drawing unit is used to draw sub-line segments located in the same rhombus block in spherical space to obtain spatial lines.

[0094] Optional, sub-segment division units include:

[0095] An endpoint addition sub-unit is used to add at least one endpoint at at least one intersection point of the sub-segment and the edge of the rhombus block, provided that the endpoints in any sub-segment are located in different rhombus blocks.

[0096] A sub-segment dividing sub-unit is used to divide a sub-segment into at least two sub-segments in the same rhombus block based on at least one additional endpoint.

[0097] Optional, space line drawing units include:

[0098] The coordinate system establishes a sub-unit, which is used to establish a two-dimensional coordinate system on the rhombus block where the endpoints of the sub-segment are located, with the two adjacent edges of the rhombus block as coordinate axes;

[0099] The sub-segment completion sub-unit is used to complete at least one intermediate point of the sub-segment by stepping in any coordinate axis direction according to a set step size based on the endpoints of the sub-segment, so as to obtain the completed sub-segment.

[0100] The space line drawing sub-unit is used to render the diamond-shaped mesh that the completed sub-line segment passes through, thus obtaining the space line.

[0101] Optional, space line drawing sub-unit, specifically used for:

[0102] The rhombus mesh is rendered based on the distance between its center point and the completed sub-segments.

[0103] The closer the distance, the darker the color of the corresponding diamond-shaped mesh.

[0104] The spatial line drawing apparatus provided in this disclosure can execute the spatial line drawing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the method.

[0105] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0106] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0107] like Figure 5As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0108] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0109] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the method of drawing space lines. For example, in some embodiments, the method of drawing space lines may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method of drawing space lines described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method of drawing space lines by any other suitable means (e.g., by means of firmware).

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

[0111] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0112] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, 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 of the foregoing.

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

[0114] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0115] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0116] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0117] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for drawing a spatial line, applied to the field of intelligent transportation, comprising: determining grid coding information of end points in a line to be drawn according to three-dimensional coordinates of the end points and mesh partition information of a spherical space; the grid coding information is used to express geographical space information; the three-dimensional coordinates are expressed in geographical coordinates; the mesh partition information of the spherical space is obtained by pre-dividing the spherical space into at least two rhombus blocks and pre-dividing the rhombus blocks into at least two rhombus meshes arranged in rows and columns; constructing a sub-line segment according to adjacent end points and obtaining grid coding information of end points in the sub-line segment; the grid coding information of the end points includes block numbers of rhombus blocks where the end points are located; determining whether the end points in the sub-line segment are in the same rhombus block according to the grid coding information of the end points; in the case that the end points in any sub-line segment are in different rhombus blocks, dividing the sub-line segment into at least two sub-line segments in the same rhombus block; drawing the sub-line segment in the same rhombus block in the spherical space by a line drawing algorithm in a plane to obtain the spatial line; in the case that the end points in any sub-line segment are in different rhombus blocks, adding at least one end point at at least one intersection point between the sub-line segment and an edge line of the rhombus block; dividing the sub-line segment into at least two sub-line segments in the same rhombus block according to the at least one added end point. the grid coding information of the end points includes block numbers of rhombus blocks where the end points are located, and row numbers and column numbers of rhombus meshes where the end points are located in the rhombus blocks.

2. The method of claim 1, wherein, drawing the sub-line segment in the same rhombus block in the spherical space to obtain the spatial line, comprising:

3. The method of claim 1, wherein, establishing a two-dimensional coordinate system with two adjacent edge lines of the rhombus block as coordinate axes on the rhombus block where the end points of the sub-line segment are located; completing at least one intermediate point of the sub-line segment by stepping in any coordinate axis direction according to a set step length based on the end points of the sub-line segment to obtain a completed sub-line segment; rendering the rhombus meshes passed through by the completed sub-line segment to obtain the spatial line. rendering the rhombus meshes passed through by the completed sub-line segment, comprising:

4. The method of claim 3, wherein, rendering the rhombus meshes according to distances between center points of the rhombus meshes and the completed sub-line segment; the closer the distance, the darker the rendering color of the corresponding rhombus mesh. 5.A device for drawing a spatial line, applied to the field of intelligent transportation, comprising: a coding information determination module configured to determine grid coding information of end points in a line to be drawn according to three-dimensional coordinates of the end points and mesh partition information of a spherical space; the grid coding information is used to express geographical space information; the three-dimensional coordinates are expressed in geographical coordinates; the mesh partition information of the spherical space is obtained by pre-dividing the spherical space into at least two rhombus blocks. ​ The coding information acquisition module is configured to construct a sub-line segment according to adjacent endpoints, and acquire grid coding information of the endpoints in the sub-line segment; the grid coding information of the endpoints comprises a block number of a rhombus block in which the endpoints are located; The position determination module is configured to determine whether the endpoints in the sub-line segment are in the same rhombus block according to the grid coding information of the endpoints in the sub-line segment; The sub-line segment segmentation module is configured to segment the sub-line segment into at least two sub-line segments in the same rhombus block in the case that the endpoints in any sub-line segment are in different rhombus blocks. The space line drawing module is configured to draw the sub-line segments in the same rhombus block in a spherical space through a line drawing algorithm in a plane to obtain the space line. The sub-line segment segmentation module comprises: The endpoint adding subunit is configured to add at least one endpoint at at least one intersection point between the sub-line segment and an edge line of the rhombus block in the case that the endpoints in any sub-line segment are in different rhombus blocks. The sub-line segment segmentation subunit is configured to segment the sub-line segment into at least two sub-line segments in the same rhombus block according to the at least one added endpoint.

6. The apparatus of claim 5, wherein, The grid coding information of the endpoints comprises a block number of a rhombus block in which the endpoints are located, and a row number and a column number of a rhombus grid in which the endpoints are located in the rhombus block.

7. The apparatus of claim 5, wherein, The space line drawing module comprises: The coordinate system establishment subunit is configured to establish a two-dimensional coordinate system with two adjacent edge lines of the rhombus block as coordinate axes on the rhombus block in which the endpoints of the sub-line segment are located; The sub-line segment completion subunit is configured to complete at least one intermediate point of the sub-line segment by stepping in a set step length in any coordinate axis direction based on the endpoints of the sub-line segment to obtain a completed sub-line segment; The space line drawing subunit is configured to render a rhombus grid through which the completed sub-line segment passes to obtain the space line.

8. The apparatus of claim 7, wherein, The space line drawing subunit is specifically configured to: render the rhombus grid according to a distance between a center point of the rhombus grid and the completed sub-line segment; the closer the distance, the darker the rendering color of the corresponding rhombus grid. 9.An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4. The computer instructions are used to enable the computer to perform the method of any one of claims 1-4.

10. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, 11.A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-4. ​

Citation Information

Patent Citations

  • Vector data drawing method on full-sphere hexagon discrete grid

    CN102096946A

  • SRG (sphere rhombus grid) subdivision code and geographic coordinate converting algorithm

    CN102567439A

  • Path planning method and device on road-network-free topographic condition

    CN107144288A