A vector graphics drawing method, device, computer equipment and storage medium
Through the vector graphics drawing method based on grid structure, the problems of missing attributes of vector graphics connection points in mesh structure in computer drawing are solved, and better display effects are achieved.
Patent Information
- Application Number
- CN202110384281.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-09
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-04-09
AI Technical Summary
In computer drawing, the prior art when drawing vector graphics of mesh structures, the properties at the connection points are easily lost or the effects are incorrect.
Using a vector graphic drawing method based on grid structure, by initializing the access status of connection points and connection edges, building a connection edge index, traversing the connection edges to obtain the drawing link index, and drawing the path according to the index to ensure the lines at the connection points Draw the effect.
A reasonable drawing path output is realized, the display effect of vector graphics is improved, and the problems of attribute loss and effect errors at connection points are solved.
Smart Images

Figure CN113052943B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer graphics, and in particular to a vector graphics drawing method, device, computer equipment and storage medium. Background Art
[0002] At present, in the field of computer graphics, there are mainly the following composition methods: vector graphics drawn using mathematical methods. For this composition method, the composition depends on whether the graphic path is closed. Especially when drawing vector graphics with a mesh structure, for non-closed paths, the attributes at the connection points will be lost. For closed paths, when one connection point corresponds to multiple connection edges, the correct drawing effect cannot be guaranteed. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a vector graphics drawing method, device, computer equipment and storage medium, aiming to solve the problem of connection attribute loss or effect error at the connection points of vector graphics when drawing vector graphics with a mesh structure in the prior art.
[0004] In a first aspect, an embodiment of the present invention provides a vector graphics drawing method based on a grid structure, comprising:
[0005] Initialize the access status of all connection points and connection edges of the vector grid structure;
[0006] Constructing a connection edge index for each of the connection points;
[0007] Traversing all the connection edges in the connection edge indexes and obtaining a drawing link index;
[0008] A path is drawn according to the drawing link index to obtain a vector graphic.
[0009] In a second aspect, an embodiment of the present invention provides a vector shape drawing device based on a grid structure, comprising:
[0010] An initialization unit, used to initialize the access status of all connection points and connection edges of the vector grid structure;
[0011] A construction unit, used to construct a connection edge index for each of the connection points;
[0012] An acquisition unit, used for traversing all the connection edges in the connection edge index and obtaining a drawing link index;
[0013] A drawing unit is used to draw a path according to the drawing link index to obtain a vector graphic.
[0014] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the vector shape drawing method based on the grid structure described in the first aspect above is implemented.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the vector shape drawing method based on the grid structure described in the first aspect above.
[0016] The embodiment of the present invention discloses a method, device, computer equipment and storage medium for drawing vector graphics. The method includes initializing the access status of all connection points and connection edges of a vector grid structure; constructing a connection edge index for each of the connection points; traversing all the connection edges in the connection edge indexes and obtaining a drawing link index; and performing path drawing according to the drawing link index to obtain a vector graphics. The embodiment of the present invention realizes reasonable drawing path output by constructing a drawing path of a vector grid structure, and has the advantage of improving the display effect of vector graphics. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0018] Figure 1 A schematic diagram of a flow chart of a method for drawing vector graphics based on a grid structure provided by an embodiment of the present invention;
[0019] Figure 2 A schematic diagram of a sub-process of a vector graphics drawing method based on a grid structure provided by an embodiment of the present invention;
[0020] Figure 3 A schematic diagram of another sub-process of the vector graphics drawing method based on the grid structure provided by an embodiment of the present invention;
[0021] Figure 4 A schematic diagram of another sub-process of the vector graphics drawing method based on the grid structure provided by an embodiment of the present invention;
[0022] Figure 5 A schematic diagram of another sub-process of the vector graphics drawing method based on the grid structure provided by an embodiment of the present invention;
[0023] Figure 6An example diagram of line drawing at a connection point provided by an embodiment of the present invention;
[0024] Figure 7 Another example diagram of line drawing at a connection point provided by an embodiment of the present invention;
[0025] Figure 8 An example diagram of line drawing at a connection point provided by the prior art;
[0026] Fig. 9 The embodiment of the present invention provides for improving Figure 8 A comparison of the lines drawn at the connection points of
[0027] Fig.10 A schematic block diagram of a vector shape drawing device based on a grid structure provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present invention.
[0029] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0030] It should also be understood that the terms used in the description of the embodiment of the present invention are only for the purpose of describing a specific embodiment and are not intended to limit the embodiment of the present invention. As used in the description of the embodiment of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms of "a", "an" and "the" are intended to include plural forms.
[0031] It should be further understood that the term “and / or” used in the description of the embodiments of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0032] See also Figure 1 , Figure 1 A schematic flow chart of a method for drawing a vector shape based on a grid structure provided in an embodiment of the present invention.
[0033] like Figure 1As shown, the method includes steps S101 to S104.
[0034] S101. Initialize the access status of all connection points and connection edges of the vector grid structure.
[0035] In this embodiment, the vector grid structure is a data structure of a vector drawing, which is composed of connection points, connection edges and areas. The connection points describe the position coordinates and some other attributes of the points. The connection edge structure describes which two connection points the connection edge connects and that the connection edge is mathematically the two entry and exit control points of a Bezier curve. The area specifies which connection edges are connected to form a closed link. Each connection point can be connected to other points through any number of connection edges to form an undirected mesh structure.
[0036] Initialize the access status of all connection points and connection edges in the vector grid structure. The access status includes the visited status and the unvisited status. All connection points and connection edges are initialized to the unvisited status. The purpose is to facilitate marking the positions that have been drawn during the process of drawing the link.
[0037] S102: construct a connection edge index for each connection point, so as to sort out all connection edges for convenience of subsequent selection and drawing.
[0038] Specifically, step S102 includes:
[0039] For each connection point, obtain the connection edges connected to each connection point, collect all the connection edges connected to all connection points, and build a connection edge index.
[0040] In this embodiment, the number of connection edges connected to each connection point may be one or more, and two connection points may be connected to the same connection edge. Therefore, after collecting all the connection edges connected to all the connection points, the duplicate connection edges are filtered out and only one of them is retained. Then, a connection edge index is constructed for all the filtered connection edges.
[0041] S103, traversing all the connection edge indexes and obtaining drawing link indexes, so as to perform drawing according to the drawing links.
[0042] Specifically, Figure 2 As shown, step S103 includes:
[0043] S201, selecting a current connection edge, and accessing connection points and connection edges along the directions of both ends of the current connection edge until the construction of drawing links in the directions of both ends of the current connection edge is completed;
[0044] S202, merging the drawing links at both ends of the current connection edge, and ending the drawing link of the current connection edge;
[0045] S203 , continue to select the next connection edge, and construct the drawing link of the next connection edge, until the drawing links of all connection edges are completed, and obtain the drawing link index according to the drawing links of all connection edges.
[0046] In the process of drawing a graph, this embodiment first randomly selects a connection edge from the connection edge index as the current connection edge, and then starts drawing along the two ends of the current connection edge. During the drawing process, it continuously moves toward other connection points and connection edges until the construction of the drawing links in the two ends of the current connection edge is completed; then the drawing links in the two ends are merged to form a complete and coherent drawing link; then a connection edge with an access status of unvisited is randomly selected from the connection edge index as the next connection edge, and starts drawing along the two ends of the next connection edge in the same drawing method until the next complete and coherent drawing link is obtained. Then continue to select and draw the drawing links of all the remaining connection edges in the same way until the drawing links of all the connection edges in the connection edge index are completed, and finally obtain the drawing link index according to the drawing links of all the connection edges.
[0047] In one embodiment, if Figure 3 As shown, step S201 includes:
[0048] S301, selecting a current connection edge, and constructing a drawing link based on the current connection edge;
[0049] S302: Visit the connection points at both ends of the current connection edge. If the connection point at either end is in a visited state or the number of connection edges connected to the connection point at either end is 1, then end the drawing link in the current direction.
[0050] In this embodiment, a connection edge is randomly selected from the connection edge index as the current connection edge, and a drawing link is constructed based on the current connection edge, and then the drawing of the drawing link is continued.
[0051] Specifically, drawing is performed from both ends of the current connection edge. For any end direction, the connection point will be visited first when drawing. The access status of the connection point and the number of connection edges connected to the connection point need to be determined. If the connection point is in the visited state, it means that the connection point has been drawn by other drawing links, and further drawing will result in overlapping effects; if the number of connection edges connected to the connection point is 1, it means that the connection point is only connected to the current connection edge, and it is the end of drawing. In any of the above two situations, the drawing in the current direction can be ended.
[0052] In one embodiment, if Figure 4 As shown, step S201 also includes:
[0053] S401, visit the connection points at both ends of the current connection edge along the direction of both ends. If the connection point at either end is in an unvisited state and the number of connection edges connected to the connection point at either end is 2, mark the connection point as a visited state and move forward to the non-current connection edge connected to the connection point;
[0054] S402, determine the access status of the non-current connection edge. If the non-current connection edge is in the visited state, end the drawing link in the current direction. If the non-current connection edge is in the unvisited state, mark it as the visited state and add it to the drawing link, and then continue to move to the next connection point until the drawing link in the current direction is ended.
[0055] In this embodiment, a connection edge is randomly selected from the connection edge index as the current connection edge, and a drawing link is constructed based on the current connection edge, and then the drawing of the drawing link is continued.
[0056] Specifically, draw from both ends of the current connection edge. For any end direction, the connection point will be visited first when drawing. The access status of the connection point and the number of connection edges connected to the connection point need to be judged. If the connection point is not visited, it means that the connection point has not been drawn. You can move forward to the connection point and mark the connection point as visited to prevent duplication in subsequent drawing; secondly, if the number of connection edges connected to the connection point is 2 (that is, one edge is the current connection edge and the other edge is the non-current connection edge), you can continue to move forward to the non-current connection edge.
[0057] Then determine the access status of the non-current connection edge. If it is in the visited state, it means that it has been drawn by other drawing links, and the construction of the drawing link in the current direction can be terminated. If it is in the unvisited state, it means that it has not been drawn, and the non-current connection edge can be marked as visited and added to the currently drawn drawing link, and continue to move forward to the next connection point until the construction of the drawing link in the current direction is terminated.
[0058] In one embodiment, if Figure 5 As shown, step S201 also includes:
[0059] S501, visiting the connection points at both ends of the current connection edge along the direction of both ends, if the connection point at any end is in an unvisited state and the number of connection edges connected to the connection point is greater than 2, then obtaining the two connection edges with the largest angle among the connection edges connected to the connection point;
[0060] S502, determining whether one of the two connection edges is the current connection edge, if not, terminating the drawing link in the current direction; if yes, proceeding to the non-current connection edge among the two connection edges;
[0061] S503: Determine the access status of the non-current connection edge. If the non-current connection edge is in the visited state, end the drawing link in the current direction. If the non-current connection edge is in the unvisited state, mark it as the visited state and add it to the drawing link, and then continue to move to the next connection point until the drawing link in the current direction is ended.
[0062] In this embodiment, a connection edge is randomly selected from the connection edge index as the current connection edge, and a drawing link is constructed based on the current connection edge, and then the drawing of the drawing link is continued.
[0063] Specifically, draw from both ends of the current connection edge. For any end direction, the connection point will be visited first when drawing. The access status of the connection point and the number of connection edges connected to the connection point need to be determined. If the connection point is in an unvisited state, it means that the connection point has not been drawn. You can move forward to the connection point and mark the connection point as visited to prevent duplication in subsequent drawing; secondly, if the number of connection edges connected to the connection point is greater than 2, you can obtain the connection point. The two connecting edges with the largest angle (less than or equal to 180°) among the connecting edges connected by the point; then compare the indexes of these two connecting edges with the index of the current connecting edge. If the indexes of these two connecting edges are not the same as the current connecting edge, then there is no current connecting edge among these two connecting edges, and the construction of the drawing link in the current direction can be ended; if the index of one of the two connecting edges is the same as the index of the current connecting edge, then one of the two connecting edges is the current connecting edge, and the connection point can be marked as visited and move forward to the non-current connecting edge of the two connecting edges.
[0064] Determine the access status of the non-current connection edge. If it is in the visited state, it means that it has been drawn by other drawing links, and the construction of the drawing link in the current direction can be terminated; if it is in the unvisited state, it means that it has not been drawn, and the non-current connection edge can be marked as visited and added to the currently drawn drawing link, and continue to move forward to the next connection point until the construction of the drawing link in the current direction is terminated.
[0065] Further, such as Figure 6 and Figure 7 As shown, the key to this embodiment is to ensure the line drawing effect at the connection point. For a single connection point, it is necessary to find the path drawing order passing through the connection point. For example, if there are three connection edges a, b, and c with the same line width passing through a single connection point, it is necessary to obtain the two connection edges with the largest angle among the connection edges connected to the connection point, and then continue to determine whether one of them is the current connection edge. If one of them is the current connection edge, move forward to the non-current connection edge, so that the line drawing effect at the connection point will be better. The principle is as follows:
[0066] Assuming the angle between a and b is the largest, there will be only two situations:
[0067] The first case: the angle between a and b is acute. Since the line widths are the same, the circle in the figure represents the trajectory circle formed by the line c rotating around the connection point. The circle is tangent to the outer contours of a and b. Since the angle between a and b is the largest, the line contour vertex of c at the connection will not exceed the contour range of a and b.
[0068] The first case: the angle between a and b is obtuse. Since the line widths are the same, the circle in the figure represents the trajectory circle formed by the line c rotating around the connection point. The circle is tangent to the outer contours of a and b. Since the angle between a and b is the largest, the line contour vertex of c at the connection will not exceed the contour range of a and b, and the intersection of the outer contours of a and b must be within the contour range of c.
[0069] By selecting the two connecting edges with the largest angle to form a continuous drawing order, the drawing effect at the connection point can be guaranteed.
[0070] For further information, please refer to Figure 8 and Fig. 9 The effect comparison, Figure 8 The drawing order is {a->c},{b}; Fig. 9 The drawing order is {a->b},{c}; it can be seen that selecting the two connecting edges with the largest angle to form a continuous drawing order can ensure the line drawing effect at the connecting point.
[0071] S104: Draw a path according to the drawn link index to obtain a vector graphic.
[0072] Specifically, step S104 includes:
[0073] A path is drawn for each drawing link in the drawing link index to form a plurality of vector lines, and a vector graphic is constructed according to all the vector lines.
[0074] In this embodiment, after traversing all the connection edges and obtaining the drawing link index, a path is drawn for each drawing link and a corresponding vector line is obtained. By combining all the vector lines of all the drawing links, a vector graphic can be constructed.
[0075] The embodiment of the present invention further provides a vector shape drawing device based on a grid structure, and the vector shape drawing device based on a grid structure is used to execute any embodiment of the above-mentioned vector shape drawing method based on a grid structure. Fig.10 , Fig.10 It is a schematic block diagram of a vector shape drawing device based on a grid structure provided by an embodiment of the present invention.
[0076] like Fig.10 As shown, the vector shape drawing device 1000 based on the grid structure includes: an initialization unit 1001, a construction unit 1002, an acquisition unit 1003 and a drawing unit 1004.
[0077] Initialization unit 1001, used to initialize the access status of all connection points and connection edges of the vector grid structure;
[0078] A construction unit 1002 is used to construct a connection edge index for each connection point;
[0079] An acquisition unit 1003 is used to traverse the connection edges in all the connection edge indexes and obtain a drawing link index;
[0080] The drawing unit 1004 is used to draw a path according to the drawing link index to obtain a vector graphic.
[0081] In one embodiment, the construction unit 1002 includes:
[0082] The connection edge index building unit is used to obtain the connection edges connected to each connection point for each connection point, collect all the connection edges connected to all the connection points, and build a connection edge index.
[0083] In one embodiment, the acquisition unit 1003 includes:
[0084] A first selection unit is used to select the current connection edge, and access the connection points and the connection edges along the two end directions of the current connection edge until the construction of the drawing links in the two end directions of the current connection edge is completed;
[0085] A merging unit, used to merge the drawing links at both ends of the current connection edge and end the drawing link of the current connection edge;
[0086] The second selection unit is used to continue selecting the next connection edge and constructing the drawing link of the next connection edge until the drawing links of all connection edges are completed, and obtain the drawing link index according to the drawing links of all connection edges.
[0087] In one embodiment, the first selection unit includes:
[0088] The current construction unit is used to select the current connection edge and construct a drawing link based on the current connection edge;
[0089] The current drawing unit is used to visit the connection points at both ends of the current connection edge along the two ends of the current connection edge. If the connection point at either end is in the visited state or the number of connection edges connected to the connection point at either end is 1, the drawing link in the current direction is terminated.
[0090] In one embodiment, the first selection unit further includes:
[0091] A first forward unit is used to visit the connection points at both ends of the current connection edge along the direction of both ends. If the connection point at either end is in an unvisited state and the number of connection edges connected to the connection point at either end is 2, the connection point is marked as a visited state and the connection point is forwarded to the non-current connection edge connected to the connection point.
[0092] The first judgment unit is used to judge the access status of the non-current connection edge. If the non-current connection edge is in the visited state, the drawing link in the current direction is terminated. If the non-current connection edge is in the unvisited state, it is marked as the visited state and added to the drawing link, and then continues to move to the next connection point until the drawing link in the current direction is terminated.
[0093] In one embodiment, the first selection unit further includes:
[0094] A second judgment unit is used to visit the connection points at both ends of the current connection edge along the two end directions, and if the connection point at any end is in an unvisited state and the number of connection edges connected to the connection point is greater than 2, then obtain the two connection edges with the largest angle among the connection edges connected to the connection point;
[0095] A third judgment unit is used to judge whether one of the two connection edges is the current connection edge, and if not, end the drawing link in the current direction; if yes, proceed to the non-current connection edge of the two connection edges;
[0096] The fourth judgment unit is used to judge the access status of the non-current connection edge. If the non-current connection edge is in the visited state, the drawing link in the current direction is terminated. If the non-current connection edge is in the unvisited state, it is marked as the visited state and added to the drawing link, and then continues to move to the next connection point until the drawing link in the current direction is terminated.
[0097] In one embodiment, the drawing unit 1004 further includes:
[0098] The path drawing unit is used to draw a path for each drawing link in the drawing link index to form a plurality of vector lines, and construct a vector graphic based on all the vector lines.
[0099] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned vector graphics drawing method based on a grid structure is implemented.
[0100] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned vector graphics drawing method based on a grid structure is implemented.
[0101] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0102] The above is only a specific implementation of the embodiment of the present invention, but the protection scope of the embodiment of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the embodiment of the present invention, and these modifications or replacements should be included in the protection scope of the embodiment of the present invention. Therefore, the protection scope of the embodiment of the present invention shall be based on the protection scope of the claims.
Claims
1. A vector graphics drawing method based on a grid structure, characterized in that: include: Initialize the access status of all connection points and connection edges of the vector grid structure; Constructing a connection edge index for each of the connection points; Traversing all the connection edges in the connection edge indexes and obtaining a drawing link index; Drawing a path according to the drawing link index to obtain a vector graphic; The traversing of all the connection edges in the connection edge index and obtaining the drawing link index includes: selecting the current connection edge, accessing the connection points and the connection edges along the two end directions of the current connection edge, until the construction of the drawing links in the two end directions of the current connection edge is completed; merging the drawing links in the two end directions of the current connection edge, and ending the drawing link of the current connection edge; continuing to select the next connection edge, and constructing the drawing link of the next connection edge, until the drawing links of all the connection edges are completed, and obtaining the drawing link index according to the drawing links of all the connection edges; Among them, the selecting of the current connection edge and visiting the connection points and connection edges along the two end directions of the current connection edge until the construction of the drawing link in the two end directions is completed include: visiting the connection points at both ends along the two end directions of the current connection edge, if the connection point at any end is in an unvisited state and the number of connection edges connected to the connection point is greater than 2, then obtaining the two connection edges with the largest angle among the connection edges connected to the connection point; judging whether one of the two connection edges is the current connection edge, if not, terminating the drawing link in the current direction; if so, moving forward to the non-current connection edge among the two connection edges; judging the access status of the non-current connection edge, if the non-current connection edge is in an accessed state, terminating the drawing link in the current direction, if the non-current connection edge is in an unvisited state, marking it as a visited state and adding it to the drawing link, and then moving forward to the next connection point until the drawing link in the current direction is terminated.
2. The method for drawing vector graphics based on a grid structure according to claim 1, characterized in that: The step of constructing a connection edge index for each connection point includes: For each of the connection points, the connection edges connected to each of the connection points are obtained, all the connection edges connected to all the connection points are collected, and a connection edge index is constructed.
3. The method for drawing vector graphics based on a grid structure according to claim 1, characterized in that: The selecting the current connection edge and accessing the connection points and the connection edges along the two end directions of the current connection edge until the construction of the drawing links in the two end directions is completed includes: Selecting the current connection edge, and constructing a drawing link based on the current connection edge; The connection points at both ends are visited along the direction of both ends of the current connection edge. If the connection point at either end is in a visited state or the number of connection edges connected to the connection point at either end is 1, the drawing link in the current direction is terminated.
4. The method for drawing vector graphics based on a grid structure according to claim 1, characterized in that: The selecting the current connection edge and accessing the connection points and the connection edges along the two end directions of the current connection edge until the drawing links in the two end directions are completed also includes: Visit the connection points at both ends of the current connection edge along the two ends of the current connection edge. If the connection point at either end is in an unvisited state and the number of connection edges connected to the connection point at either end is 2, mark the connection point as visited and move forward to the non-current connection edge connected to the connection point. Determine the access status of the non-current connection edge. If the non-current connection edge is in the visited state, end the drawing link in the current direction. If the non-current connection edge is in the unvisited state, mark it as the visited state and add it to the drawing link, and then continue to move to the next connection point until the drawing link in the current direction is ended.
5. The method for drawing vector graphics based on a grid structure according to claim 1, characterized in that: The step of drawing a path according to the drawing link index to obtain a vector graphic includes: Path drawing is performed on each drawing link in the drawing link index to form a plurality of vector lines, and a vector graphic is constructed according to all the vector lines.
6. A vector shape drawing device based on a grid structure, characterized in that: include: An initialization unit, used to initialize the access status of all connection points and connection edges of the vector grid structure; A construction unit, used to construct a connection edge index for each of the connection points; An acquisition unit, used for traversing all the connection edges in the connection edge index and obtaining a drawing link index; A drawing unit, used for drawing a path according to the drawing link index to obtain a vector graphic; The acquisition unit is used to select the current connection edge, access the connection points and the connection edges along the two end directions of the current connection edge, until the construction of the drawing links in the two end directions of the current connection edge is completed; merge the drawing links in the two end directions of the current connection edge, and end the drawing link of the current connection edge; continue to select the next connection edge, and construct the drawing link of the next connection edge, until the drawing links of all the connection edges are completed, and obtain the drawing link index according to the drawing links of all the connection edges; Among them, the selecting of the current connection edge and visiting the connection points and connection edges along the two end directions of the current connection edge until the construction of the drawing link in the two end directions is completed include: visiting the connection points at both ends along the two end directions of the current connection edge, if the connection point at any end is in an unvisited state and the number of connection edges connected to the connection point is greater than 2, then obtaining the two connection edges with the largest angle among the connection edges connected to the connection point; judging whether one of the two connection edges is the current connection edge, if not, terminating the drawing link in the current direction; if so, moving forward to the non-current connection edge among the two connection edges; judging the access status of the non-current connection edge, if the non-current connection edge is in an accessed state, terminating the drawing link in the current direction, if the non-current connection edge is in an unvisited state, marking it as a visited state and adding it to the drawing link, and then moving forward to the next connection point until the drawing link in the current direction is terminated.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the vector graphics drawing method based on the grid structure as claimed in any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to execute the vector graphics drawing method based on a grid structure according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for rapidly generating vector diagram
CN102054280A
Method for realizing local layout and integral layout of graphs by automatic layering technology
CN104778335A
Spatial topology processing method for two-dimensional vector polygon self-intersection
CN107562779A
A flow direction feature-oriented ocean current vector field visualization method based on angle tracking
CN109559369A
Planar vector diagram generation method and system based on GPX data
CN111524203A
