Method, system and medium for analyzing merging of planar elements by utilizing buffer area
The buffer analysis method quickly merges the surface elements, which solves the problems of high complexity of surface elements merge and unsatisfactory merger in the existing technology, and realizes efficient model lightweighting in the field of surface elements merge and graphic design.
Patent Information
- Application Number
- CN202411046365.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-06
AI Technical Summary
Before merging, the existing polygon feature merging algorithm needs to perform a delaunay triangle networking on the vertex data of all polygon features, resulting in high time and space complexity, and the method of judging the minimum distance between polygon features is not ideal.
By designing a method to analyze the merger of surface-shaped elements using buffers, it includes setting the edge-shaped elements simplifying threshold and angle-shaped threshold range, deleting redundant points, constructing edge-line buffers, judging adjacent edges, calculating merged points, and Construct merge polygons to achieve rapid merger of polygon-like elements.
It realizes rapid calculation of merge points and construction of merged polygons, while maintaining the outline characteristics of the original surface-shaped elements, improving the efficiency and accuracy of surface-shaped elements merging.
Smart Images

Figure CN119091003A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of cartographic synthesis and graphic design, and in particular to a method, system and medium for merging planar elements by using a buffer zone analysis. Background Art
[0002] Cartographic generalization is not only one of the core theories and methods of cartography, but also has always been a focus of cartographers. The merging of surface elements is an important link and key part of cartographic generalization. The merging of surface elements has been widely studied in computational geometry, because the surface elements have complex shapes, and the merging involves the analysis and processing of point-line relationships, point-surface relationships, line-line relationships, line-surface relationships, and surface-surface relationships.
[0003] There are many existing algorithms for merging face elements, among which the more representative method is to use Delaunay triangulation for merging. The definition of Delaunay triangulation is a collection of a series of connected but non-overlapping triangles, and the circumscribed circles of these triangles do not contain any other points in the face domain. Since such algorithms need to perform Delaunay triangulation on the vertex data of all face elements before merging, their time and space complexity are high. At the same time, it is necessary to determine whether to merge face elements before merging. The existing common judgment method uses the acquisition of the proximity relationship between face elements as an important basis for the merging process. The proximity relationship between face elements is determined by the minimum distance between face targets. However, the unreasonable definition of the minimum distance between face elements leads to unsatisfactory results of the algorithm in practical applications. Summary of the invention
[0004] The purpose of the present invention is to solve the technical problems of quickly calculating merging points and constructing merging surfaces while maintaining the contour features of the original surface elements by designing a method, system and medium for merging surface elements using a buffer zone analysis.
[0005] The present invention provides a method for merging planar elements by using a buffer zone analysis, comprising the following steps:
[0006] According to the characteristics of the surface element, set the surface element edge simplification threshold and the angle threshold range formed by the two edges;
[0007] According to the threshold value of simplifying the edge of the surface element, the redundant points of the surface element are deleted;
[0008] Construct buffers for the edges of area features;
[0009] Calculate and determine whether there are adjacent edges between the two face elements according to the buffer of the edge line; if there are adjacent edges, obtain the adjacent edges and proceed to the next step; if not, the two face elements are not merged and the process ends;
[0010] Determine the angle between adjacent edges, and calculate the merging point of the two planar elements according to the threshold range of the angle between the two edge lines and the adjacent edges of the two planar elements obtained;
[0011] Construct a merged surface based on the merged points of the two surface elements to complete the merging of the two surface elements.
[0012] Preferably, the process of deleting redundant points of planar elements according to the planar element edge simplification threshold comprises the following steps:
[0013] Set the threshold for simplifying the edge of surface features to D;
[0014] The vertex data P1, P2, ..., P n ;
[0015] Get a vertex P i Two adjacent vertices of
[0016] Take vertex P i As the middle point, calculate point P i The distance d between the two adjacent points.
[0017] If d>D, then keep vertex P i , otherwise, delete point P i ;
[0018] Repeat the above steps until all points have been judged, and the remaining points form a surface merged element.
[0019] Preferably, the buffer zone for constructing the edge line of the planar element specifically comprises the following steps:
[0020] According to the surface feature point data after removing redundant points, obtain the edges l of the two surface features A and B Ai (i=1,2,…,n A ) and l Bj (j=1, 2, ..., n B )(where n A , n B are the number of edges of the surface elements A and B respectively);
[0021] Construct all edges l of the surface element A Ai (i=1,2,…,n A ) has a buffer range of d A The buffer area P Ai (i=1,2,…,n A );
[0022] Construct all edges l of the surface element B Bj (j=1, 2, ..., n B) has a buffer range of d B The buffer area P Bj (j=1, 2, ..., n B ).
[0023] Preferably, the step of calculating and judging whether two planar elements have adjacent edges and obtaining adjacent edges based on the buffer zone of the edge line specifically includes the following steps:
[0024] Select a certain edge buffer P of the surface element A Ai , if P Ai and the buffer zones of the edges of the surface element B Then Ai and l Bj For the adjacent edges of elements A and B, add them to the adjacent edge set NE;
[0025] Repeat the above steps to continue to determine other edge buffers of the surface element A until all edges of the surface element A are determined;
[0026] If the number of adjacent edge sets NE is greater than 2, obtain the face ownership of each adjacent edge in NE, and obtain two adjacent edge sets NEA and NEB according to the ownership;
[0027] Calculate the sum of the endpoint distances between the adjacent edges contained in the set NEA and the adjacent edges contained in NEB, as shown in the following formula:
[0028]
[0029] The smallest d sum The two adjacent edges corresponding to the value are the adjacent edges of the surface elements A and B. NEA and l NEB .
[0030] Preferably, the step of determining the angles of adjacent sides and calculating the merging point of two planar elements specifically includes the following steps:
[0031] Determine the angle between adjacent sides;
[0032] If the adjacent edges l of the surface elements A and B NEA and l NEB The angles between the short side and its two adjacent sides l1 and l2 are greater than or equal to the threshold, and the angles between the extension lines of the two adjacent sides l1 and l2 of the short side and the adjacent side l NEA and l NEB The intersection of the long sides of the surface elements A and B; if the adjacent sides l NEA and l NEB The angles between the short side and its two adjacent sides l1 and l2 are both less than the threshold value, and the angle between the short side and its two adjacent sides l1 and l2 is less than the threshold value. NEA and l NEB Draw a perpendicular line through the two vertices of the short side and find the intersection of the perpendicular line with the long side;
[0033] If the adjacent edges l of the surface elements A and B NEA and l NEB The angle between the short side and its two adjacent sides l1 and l2 is greater than or equal to the threshold, and the other is less than the threshold. Get the adjacent side l NEA and l NEB Draw a perpendicular line to the short side through the vertex where the angle between the two adjacent sides of the short side and the adjacent side whose angle is less than the lower limit of the threshold range intersects the short side, and find the intersection point of the perpendicular line with the long side. At the same time, find the intersection point of the extension line of the other adjacent side of the short side and the long side.
[0034] For the above three situations, if both intersection points are on the long side, then the two intersection points are the two merging points P1 and P2 of the surface elements A and B; if one intersection point is on the extended line of the long side, then the intersection point of the reverse extended line of the adjacent side of the long side and the short side is taken as the merging point. At this time, the two merging points P1 and P2 of the surface elements A and B are respectively on the adjacent side l NEA and l NEB superior.
[0035] Preferably, the step of constructing a merged surface according to the merged points of the two planar elements to merge the two planar elements specifically includes the following steps:
[0036] When constructing the merged surface of two planar elements, the adjacent edges l NEA and l NEB The vertices of are taken as the first and last vertices of the corresponding surface element data, and the vertices constituting the surface element are adjusted in ascending or descending order to finally complete the merger of the two surface elements.
[0037] Preferably, the step of constructing a merged surface according to the merged points of the two planar elements to merge the two planar elements specifically includes the following steps:
[0038] Determine the ownership of the two merge points;
[0039] If the two merged points are both on the adjacent edges of the surface elements A and B NEA and l NEB On the long side of the face, add the merge point calculated from the adjacent side where the last vertex is located at the end of the vertex list of the face element B, and calculate the longest side l among the adjacent sides of the face NEA The distance between the two vertices A1 and A2 and the merged points P1 and P2; if the two merged points are on the adjacent edges of the surface elements A and B respectively NEA and l NEB First, determine the adjacent edge l of the face NEB Zhong and l NEA Intersecting adjacent edges, get the adjacent edge and the shorter edge l of the adjacent edge NEB The intersection point is used as the last vertex in the vertex list of the surface element B, and the adjacent edge l NEBAnother point in the image is used as the first vertex to reconstruct the vertex list of the surface element and calculate the longest side l among the adjacent sides of the surface. NEA The distance between the two vertices A1 and A2 and the merged points P1 and P2;
[0040] For the above two situations respectively, if Then add point A2 to the vertex list of surface element B as the last vertex of the merged surface; if Then add point A1 to the vertex list of surface element B as the last vertex of the merged face; determine whether the last vertex of the vertex list after the added point is the first or last vertex of the vertex list of surface element A; if it is the first vertex of surface element A, then append the vertices in the vertex list of surface element A in sequence; if it is the last vertex of surface element A, then append the vertices in the vertex list of surface element A in reverse order.
[0041] The present invention also provides a system for merging planar elements by using a buffer zone analysis, comprising a threshold range setting module, a redundant point deletion module, a buffer zone construction module, an adjacent edge judgment module, a merging point calculation module, and a merging surface construction module;
[0042] The threshold range setting module is used to set the threshold for simplifying the edge of the surface element and the threshold range of the angle formed by the two edges according to the characteristics of the surface element;
[0043] The redundant point deletion module is used to delete redundant points of planar elements according to the planar element edge simplification threshold;
[0044] The buffer construction module is used to construct a buffer for the edge lines of the surface elements;
[0045] The adjacent edge determination module is used to calculate and determine whether there are adjacent edges between two planar elements according to the buffer of the edge line; if there are adjacent edges, the adjacent edges are obtained and the next step is entered; if not, the two planar elements are not merged and the process ends;
[0046] The calculation merging point module is used to determine the angle between adjacent edges, and calculate the merging point between two planar elements according to the threshold range of the angle between the two edges and the acquired adjacent edges of the two planar elements;
[0047] The module for constructing a merged surface is used to construct a merged surface according to the merged points of two planar elements, so as to complete the merging of the two planar elements.
[0048] Preferably, the adjacent edge determination module includes determining and obtaining adjacent edge units, specifically for:
[0049] Select a certain edge buffer P of the surface element A Ai , if P Ai and the buffer zones of the edges of the surface element B Then Aiand l Bj For the adjacent edges of elements A and B, add them to the adjacent edge set NE;
[0050] Repeat the above steps to continue to determine other edge buffers of the surface element A until all edges of the surface element A are determined;
[0051] If the number of adjacent edge sets NE is greater than 2, obtain the face ownership of each adjacent edge in NE, and obtain two adjacent edge sets NEA and NEB according to the ownership;
[0052] Calculate the sum of the endpoint distances between the adjacent edges contained in the set NEA and the adjacent edges contained in NEB, as shown in the following formula:
[0053]
[0054] The smallest d sum The two adjacent edges corresponding to the value are the adjacent edges of the surface elements A and B. NEA and l NEB .
[0055] The present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the method for merging planar elements using buffer analysis are implemented.
[0056] The beneficial effects of the present invention are:
[0057] The method, system and medium for merging planar elements by using buffer zone analysis of the present invention provide a general and operable algorithm for merging and simplifying planar elements in the field of cartographic synthesis and lightweighting of models in the field of graphic design, thereby realizing fast and effective merging and simplifying planar elements. The technical problem of being able to quickly calculate merging points and construct merging surfaces while maintaining the contour features of the original planar elements can be solved.
[0058] The advantages of this algorithm include:
[0059] 1. By calculating the size of the chamfer composed of adjacent vertices in the surface feature data and setting the corresponding threshold, the redundant data of the surface feature is effectively removed.
[0060] 2. The traditional minimum distance calculation between planar elements is converted into the judgment problem of whether the buffer zones of line elements have intersections. On the one hand, it avoids the irrationality of the existing method for solving the minimum distance between planar elements; on the other hand, it can effectively judge whether to merge planar elements; at the same time, it is convenient and fast to locate the adjacent edges of the planar elements to be merged.
[0061] 3. A new surface construction rule for merging surface elements is designed, which is composed of the pre-processed surface element vertices and the obtained surface element merging points, and can realize the rapid merging of surface elements. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 It is the overall flow chart of the present invention;
[0063] Figure 2a It is a schematic diagram of a situation in which the angle between the adjacent edges of a surface element and its adjacent edges is greater than or equal to a threshold value;
[0064] Figure 2b It is a schematic diagram showing that the angle between the adjacent edges of a surface element and its adjacent edges is less than a threshold value;
[0065] Figure 3a It is a schematic diagram that the angles between adjacent edges and their adjacent edges are all greater than or equal to the threshold value;
[0066] Figure 3b It is a schematic diagram that the angles between adjacent edges and their adjacent edges are all smaller than the threshold value;
[0067] Figure 3c A schematic diagram showing that one angle between an adjacent side and its adjacent side is greater than or equal to a threshold value and the other is less than the threshold value;
[0068] Figure 4a This is a schematic diagram of the situation where the merged points of two planar elements are both on the middle and long sides of the adjacent sides;
[0069] Figure 4b This is a schematic diagram of the attribution of the merged points of two polygonal elements on two adjacent edges. DETAILED DESCRIPTION
[0070] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. It should also be understood that when used in the present application specification and the attached claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. It should also be understood that the term "and / or" used in the present application specification and the attached claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0071] As used in the specification of this application and the appended claims, the term "if" may be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is detected" may be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [the described condition or event] is detected" or "in response to detecting [the described condition or event]" depending on the context. In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0072] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. "Multiple" means "two or more".
[0073] The present invention relates to the field of cartographic synthesis and graphic design technology, and is applicable to the merging processing of plane graphics, and specifically relates to a method, system and medium for analyzing the merging of surface elements using a buffer zone. The method of the present invention comprises the following steps: according to the characteristics of the surface elements, setting the surface element edge simplification threshold and the threshold range of the angle between the two edges; according to the surface element edge simplification threshold, using D o The uglas-Peukcer algorithm performs redundant point deletion processing on the surface elements; constructs a buffer zone of the edge lines of two surface elements; determines whether the two surface elements have adjacent edges according to the buffer zone calculation of the edge lines, and obtains the adjacent edges; determines the angle between the adjacent edges, and calculates the merging points according to the threshold range of the angle between the two edge lines and the obtained adjacent edges of the two surface elements; and constructs a merged surface according to the merging points of the two surface elements. The present invention solves the problems that most of the existing surface element merging algorithms need to perform Delaunay triangulation on the vertex data of all surface elements before merging, resulting in high time and space complexity, and the problem that the effect of judging the neighboring relationship by the minimum distance between surface elements is not ideal in practical applications. The invention has the advantages of high calculation and judgment efficiency and good merging effect.
[0074] The present invention provides a general and operable algorithm for merging and simplifying surface elements in the field of cartographic synthesis and lightweighting of models in the field of graphic design by using a surface element merging algorithm based on buffer zone analysis, thereby realizing fast and effective merging and simplifying surface elements. The new surface construction rule for merging surface elements, which is composed of the pre-processed surface element vertices and the obtained surface element merging points, can realize fast merging of surface elements. At the same time, the present invention converts the minimum distance calculation into a judgment problem of whether the buffer zones of line elements have intersections, so that the judgment of whether surface elements need to be merged is more accurate.
[0075] The Douglas-Peuker algorithm is an algorithm for thinning curves or trajectories. It is used to compress a large number of redundant graphic data points to extract necessary data points. The basic idea is to set a distance threshold to filter the points on the curve to reduce the number of data points while maintaining the overall shape of the curve.
[0076] Example:
[0077] Figure 1 The overall flow chart of a method for merging planar elements using a buffer zone analysis provided by a preferred embodiment of the present application is shown. For ease of explanation, only the part related to the present embodiment is shown, which is described in detail as follows:
[0078] A method for merging planar elements by using a buffer zone analysis of the present invention comprises the following steps:
[0079] Step 1: According to the characteristics of the surface element, set the surface element edge simplification threshold and the angle threshold range formed by the two edges; Step 2: According to the surface element edge simplification threshold, use the Douglas-Peukcer algorithm to delete redundant points on the surface element edge;
[0080] Step 3: Construct a buffer zone for the edge of the surface element;
[0081] Step 4: Calculate and determine whether there are adjacent edges between the two face elements based on the buffer of the edge line; if so, obtain the adjacent edges and proceed to the next step; if not, the two face elements are not merged and the process ends;
[0082] Step 5: Determine the angle between adjacent edges, and calculate the merging point of the two planar elements according to the threshold range of the angle between the two edge lines and the adjacent edges of the two planar elements obtained;
[0083] Step 6: Construct a merged surface based on the merged points of the two surface elements to complete the merging of the two surface elements.
[0084] In the above embodiment, step 2 performs redundant point deletion processing on each edge of the planar element according to the planar element edge simplification threshold, and specifically comprises the following steps:
[0085] A1. Set the threshold for simplifying the edge of surface elements to D;
[0086] A2. Store the vertex data P1, P2, ..., P2 of the surface elements in sequence. n ;
[0087] A3. Get a vertex P i Two adjacent vertices of
[0088] A4. Take vertex P i As the middle point, calculate point P i The distance d between the two adjacent points.
[0089] A5. If d>D, keep vertex P i , otherwise, delete point P i ;
[0090] A6. Repeat steps A3-A5 until all points have been judged, and the remaining points form a surface merge element.
[0091] In the above embodiment, step 3 constructs the buffer zone of the two-face element edge lines, which specifically includes the following steps:
[0092] B1. Obtain the edges of the surface elements A and B based on the surface element point data after removing redundant points. Ai (i=1,2,…,n A ) and l Bj (j=1,2,…,n B )(where n A , n B are the number of edges of the surface elements A and B respectively);
[0093] B2. Construct all edges l of the surface element A Ai (i=1,2,…,n A ) has a buffer range of d A (According to the original map scale and the target scale, set the buffer area P such as 0.5mm, 1mm, 1.5mm, 2mm, etc. according to the provisions of the corresponding cartographic comprehensive specifications) Ai (i=1,2,…,n A );
[0094] B3. Similarly, construct all the edges l of the surface element B Bj (j=1,2,…,n B ) has a buffer range of d B The buffer area P Bj (j=1,2,…,n B ).
[0095] In step 4, it is determined whether there are adjacent edges between the two planar elements according to the buffer calculation of the edge line, and if so, the adjacent edges are obtained, which specifically includes the following steps:
[0096] C1. Select a certain edge buffer P of the surface element A. Ai , if P Ai and the buffer zones of the edges of the surface element B Then Ai and l Bj For the adjacent edges of elements A and B, add them to the adjacent edge set NE;
[0097] C2. Repeat step C1 to continue determining other edge buffers of the surface element A until all edges of the surface element A are determined;
[0098] C3. If the number of adjacent edges in the adjacent edge set NE is greater than 2, obtain the face ownership of each adjacent edge in the adjacent edge set NE, and obtain the adjacent edge sets NEA and NEB of elements A and B respectively according to the ownership;
[0099] C4. Calculate the sum of the endpoint distances between the adjacent edges included in the adjacent edge set NEA and the adjacent edges included in NEB, as shown in the following formula:
[0100]
[0101] The smallest d sum The two adjacent edges corresponding to the value are the adjacent edges of the surface elements A and B. NEA and l NEB .
[0102] In step 5, the angle between two straight lines is determined. The angle between two straight lines refers to the angle between the two straight lines that is less than or equal to 90°. The threshold of the angle is generally 75°, so the threshold range of the angle between the two side lines is (0°, 75°) and [75°, 90°].
[0103] According to the threshold range of the angle between the two edges and the adjacent edges of the two planar elements, the merging point of the two planar elements is calculated, which specifically includes the following steps:
[0104] D1. Determine the adjacent edge angle, where the adjacent edge angle is compared with the threshold. Figure 2a-2b As shown;
[0105] Figure 2a The angle between the adjacent edge of the surface element and its adjacent edge is greater than or equal to the threshold value. The two merged points P1 and P2 are located on the adjacent edges of the surface elements A and B, respectively. NEA and l NEB superior.
[0106] Figure 2bThe angle between the adjacent edges of the surface element and its adjacent edge is less than the threshold value, and the two merge points P1 and P2 are both on the adjacent edges of the surface elements A and B. NEA and l NEB On the long side of the .
[0107] D2. The angle between the adjacent sides of the planar elements A and B exists as follows Figure 3a-3c As shown; if the angle between adjacent sides is Figure 3a As shown, the adjacent edges l of the surface elements A and B NEA and l NEB The short side (in this embodiment, l NEB ) and its two adjacent sides l1 and l2 are both greater than or equal to the threshold, then find the angle between the reverse extension line of the two adjacent sides l1 and l2 of the short side and the adjacent side l NEA and l NEB The longer side (in this embodiment, l NEA ); if both intersection points are on the long side l NEA On, such as Figure 3a As shown on the left, the two intersection points are the two merging points P1 and P2 of the surface elements A and B; if one of the two intersection points is on the long side l NEA on the upper side, and the other on the long side l NEA On the extension line, take the longer side l NEA The reverse extension line of the adjacent side and the short side l NEB The intersection of the two points is taken as the merging point. At this time, the two merging points P1 and P2 of the surface elements A and B are respectively on the adjacent edges l NEA and l NEB On, such as Figure 3a Shown on the right.
[0108] D3. If the angle between adjacent sides is Figure 3b As shown, the adjacent edges l of the surface elements A and B NEA and l NEB The short side (in this embodiment, l NEB ) and its two adjacent edges l1 and l2 have an angle less than the threshold, that is, the angle is greater than or equal to the threshold, then the adjacent edge l NEA and l NEB Draw perpendicular lines from the two vertices of the short side and find the intersection of the perpendicular line and the long side. If both intersection points are on the long side l NEA On, such as Figure 3b As shown on the left, the two intersection points are the two merging points P1 and P2 of the surface elements A and B; if one of the two intersection points is on the long side l NEA on the upper side, and the other on the long side l NEA On the extension line, take the longer side l NEA The reverse extension line of the adjacent side and the short side l NEB The intersection of the two points is taken as the merging point. At this time, the two merging points P1 and P2 of the surface elements A and B are respectively on the adjacent edges l NEA and lNEB On, such as Figure 3b Shown on the right.
[0109] D4. If the angle between adjacent sides is the angle between adjacent sides is Figure 3c As shown, the adjacent edges l of the surface elements A and B NEA and l NEB If the angle between the short side and its two adjacent sides l1 and l2 is greater than or equal to the threshold and one is less than the threshold, then the adjacent side l is obtained. NEA and l NEB The short side (in this embodiment, l NEB ) of the two adjacent sides whose angle is less than the lower limit of the threshold range, the vertex where the adjacent side intersects with the short side, draw a perpendicular line to the short side through the vertex, and find its intersection with the long side (in this embodiment, l NEA ), and at the same time, find the intersection point of the extension line of the other adjacent side of the short side and the long side; if both intersection points are on the long side l NEA On, such as Figure 3c As shown on the left, the two intersection points are the two merging points P1 and P2 of the surface elements A and B; if one of the two intersection points is on the long side l NEA on the upper side, and the other on the long side l NEA On the extension line, take the longer side l NEA The reverse extension line of the adjacent side and the short side l NEB The intersection of the two points is taken as the merging point. At this time, the two merging points P1 and P2 of the surface elements A and B are respectively on the adjacent edges l NEA and l NEB On, such as Figure 3c Shown on the right.
[0110] In step 6, a merged surface is constructed according to the merged points of the two planar elements to complete the merging of the two planar elements, which specifically includes the following steps:
[0111] When constructing the merged surface of two planar elements, the adjacent edges l NEA and l NEB The vertices of are taken as the first and last vertices of the corresponding surface element data, and the vertices constituting the surface element are adjusted in ascending or descending order to finally complete the merger of the two surface elements.
[0112] E1. Determine the ownership of the two merged points. In the process of constructing the merged surface, Figure 4a , 4b Two situations are shown;
[0113] E2. If the ownership of the two merged points is as follows Figure 4a As shown, the two merged points P1 and P2 are both on the adjacent edges of the surface elements A and B. NEA and l NEB The longer side (in this embodiment, l NEA), then add the merge point P2 calculated from the adjacent edge where the last vertex is located to the end of the vertex list of the surface element B, and calculate the adjacent edge l NEA The distance between the two vertices A1 and A2 and the merged points P1 and P2; if Then add point A2 to the vertex list of surface element B as the last vertex of the merged surface; if Then add point A1 to the vertex list of surface element B as the last vertex of the merged surface.
[0114] Determine whether the last vertex of the vertex list after the added point is the first or last vertex of the vertex list of surface element A; if it is the first vertex of surface element A, then append the vertices in the vertex list of surface element A in sequence; if it is the last vertex of surface element A, then append the vertices in the vertex list of surface element A in reverse order.
[0115] E3. If the ownership of the two merged points is as follows Figure 4b As shown, the two merged points P1 and P2 are respectively on the adjacent edges of the surface elements A and B. NEA and l NEB On the top, first determine the adjacent edge l of the face NEB Zhong and l NEA The intersecting adjacent edge, get the adjacent edge and the adjacent edge l NEB The intersection point is used as the last vertex in the vertex list of the surface element B. NEB Another point in the image is used as the first vertex, the vertex list of the surface element is reconstructed, and the adjacent edges l of the surface are calculated. NEA The distance between the two vertices A1 and A2 and the merged points P1 and P2; if Then add point A2 to the vertex list of surface element B as the last vertex of the merged surface; if Then add point A1 to the vertex list of surface element B as the last vertex of the merged surface.
[0116] Similarly, determine whether the last vertex of the vertex list after the added point is the first or last vertex of the vertex list of surface element A; if it is the first vertex of surface element A, then append the vertices in the vertex list of surface element A in sequence; if it is the last vertex of surface element A, then append the vertices in the vertex list of surface element A in reverse order.
[0117] The present invention also provides a system for merging planar elements by using a buffer zone analysis, comprising a threshold range setting module, a redundant point deletion module, a buffer zone construction module, an adjacent edge judgment module, a merging point calculation module, and a merging surface construction module;
[0118] The threshold range setting module is used to set the threshold for simplifying the edge of the surface element and the threshold range of the angle formed by the two edges according to the characteristics of the surface element;
[0119] The redundant point deletion module is used to delete redundant points of planar elements according to the planar element edge simplification threshold;
[0120] The buffer construction module is used to construct a buffer for the edge lines of the surface elements;
[0121] The adjacent edge determination module is used to calculate and determine whether there are adjacent edges between two planar elements according to the buffer of the edge line; if there are adjacent edges, the adjacent edges are obtained and the next step is entered; if not, the two planar elements are not merged and the process ends;
[0122] The calculation merging point module is used to determine the angle between adjacent edges, and calculate the merging point between two planar elements according to the threshold range of the angle between the two edges and the acquired adjacent edges of the two planar elements;
[0123] The module for constructing a merged surface is used to construct a merged surface according to the merged points of two planar elements, so as to complete the merging of the two planar elements.
[0124] The adjacent edge determination module includes adjacent edge determination and acquisition units, which are specifically used for:
[0125] Select a certain edge buffer P of the surface element A Ai , if P Ai and the buffer zones of the edges of the surface element B Then Ai and l Bj For the adjacent edges of elements A and B, add them to the adjacent edge set NE;
[0126] Repeat the above steps to continue to determine other edge buffers of the surface element A until all edges of the surface element A are determined;
[0127] If the number of adjacent edge sets NE is greater than 2, obtain the face ownership of each adjacent edge in NE, and obtain two adjacent edge sets NEA and NEB according to the ownership;
[0128] Calculate the sum of the endpoint distances between the adjacent edges contained in the set NEA and the adjacent edges contained in NEB, as shown in the following formula:
[0129]
[0130] The smallest d sum The two adjacent edges corresponding to the value are the adjacent edges of the surface elements A and B. NEA and l NEB .
[0131] The present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the method for merging planar elements using buffer analysis are implemented.
[0132] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] It should also be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.
[0134] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
[0135] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.
[0136] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including" is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".
[0137] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for merging planar elements using buffer analysis, characterized in that: The steps include: According to the characteristics of the surface element, set the surface element edge simplification threshold and the angle threshold range formed by the two edges; According to the threshold value of simplifying the edge of the surface element, the redundant points of the surface element are deleted; Construct buffers for the edges of area features; Calculate and determine whether there are adjacent edges between the two face elements according to the buffer of the edge line; if there are adjacent edges, obtain the adjacent edges and proceed to the next step; if not, the two face elements are not merged and the process ends; Determine the angle between adjacent edges, and calculate the merging point of the two planar elements according to the threshold range of the angle between the two edge lines and the adjacent edges of the two planar elements obtained; Construct a merged surface based on the merged points of the two surface elements to complete the merging of the two surface elements.
2. The method for merging planar elements using buffer zone analysis according to claim 1, characterized in that: The method of performing the process of deleting redundant points of the planar element according to the planar element edge simplification threshold specifically comprises the following steps: Set the threshold for simplifying the edge of surface features to D; The vertex data P1, P2, ..., P n ; Get a vertex P i Two adjacent vertices of Take vertex P i As the middle point, calculate point P i The distance d between the two adjacent points. If d>D, keep vertex P i , otherwise, delete point P i ; Repeat the above steps until all points have been judged, and the remaining points form a surface merged element.
3. The method for merging planar elements using buffer zone analysis according to claim 2, characterized in that: The step of constructing a buffer zone for the edge line of a planar element specifically comprises the following steps: According to the surface feature point data after removing redundant points, obtain the edges l of the two surface features A and B Ai (i=1,2,…,n A ) and l Bj (j=1,2,…,n B )(where n A , n B are the number of edges of the surface elements A and B respectively); Construct all edges l of the surface element A Ai (i=1,2,…,n A ) has a buffer range of d A The buffer area P Ai (i=1,2,…,n A ); Construct all edges l of the surface element B Bj (j=1,2,…,n B ) has a buffer range of d B The buffer area P Bj (j=1,2,…,n B ).
4. The method for merging planar elements using buffer zone analysis according to claim 3, characterized in that: The method of calculating and judging whether two planar elements have adjacent edges based on the buffer zone of the edge line and obtaining the adjacent edges specifically includes the following steps: Select a certain edge buffer P of the surface element A Ai , if P Ai and the buffer zones of the edges of the surface element B Then Ai and l Bj For the adjacent edges of elements A and B, add them to the adjacent edge set NE; Repeat the above steps to continue to determine other edge buffers of the surface element A until all edges of the surface element A are determined; If the number of adjacent edge sets NE is greater than 2, obtain the face ownership of each adjacent edge in NE, and obtain two adjacent edge sets NEA and NEB according to the ownership; Calculate the sum of the endpoint distances between the adjacent edges contained in the set NEA and the adjacent edges contained in NEB, as shown in the following formula: The smallest d sum The two adjacent edges corresponding to the value are the adjacent edges of the surface elements A and B. NEA and l NEB .
5. The method for merging planar elements using buffer zone analysis according to claim 4, characterized in that: The method of determining the angles of adjacent sides and calculating the merging point of two planar elements specifically includes the following steps: Determine the angle between adjacent sides; If the adjacent edges l of the surface elements A and B NEA and l NEB The angles between the short side and its two adjacent sides l1 and l2 are greater than or equal to the threshold, and the angles between the extension lines of the two adjacent sides l1 and l2 of the short side and the adjacent side l NEA and l NEB The intersection of the long sides of ; If the adjacent edges l of the surface elements A and B NEA and l NEB The angles between the short side and its two adjacent sides l1 and l2 are both less than the threshold value, and the angle between the short side and its two adjacent sides l1 and l2 is less than the threshold value. NEA and l NEB Draw a perpendicular line through the two vertices of the short side and find the intersection of the perpendicular line with the long side; If the adjacent edges l of the surface elements A and B NEA and l NEB The angle between the short side and its two adjacent sides l1 and l2 is greater than or equal to the threshold, and the other is less than the threshold. Get the adjacent side l NEA and l NEB Draw a perpendicular line to the short side through the vertex where the angle between the two adjacent sides of the short side and the adjacent side whose angle is less than the lower limit of the threshold range intersects the short side, and find the intersection point of the perpendicular line with the long side. At the same time, find the intersection point of the extension line of the other adjacent side of the short side and the long side. For the above three situations, if both intersection points are on the long side, then the two intersection points are the two merging points P1 and P2 of the surface elements A and B; if one intersection point is on the extended line of the long side, then the intersection point of the reverse extended line of the adjacent side of the long side and the short side is taken as the merging point. At this time, the two merging points P1 and P2 of the surface elements A and B are respectively on the adjacent side l NEA and l NEB superior.
6. The method for merging planar elements using buffer zone analysis according to claim 5, characterized in that: The step of constructing a merged surface according to the merged points of the two planar elements to merge the two planar elements specifically includes the following steps: When constructing the merged surface of two planar elements, the adjacent edges l NEA and l NEB The vertices of are taken as the first and last vertices of the corresponding surface element data, and the vertices constituting the surface element are adjusted in ascending or descending order to finally complete the merger of the two surface elements.
7. The method for merging planar elements using buffer zone analysis according to claim 6, characterized in that: The step of constructing a merged surface according to the merged points of the two planar elements to merge the two planar elements specifically includes the following steps: Determine the ownership of the two merge points; If the two merged points are both on the adjacent edges of the surface elements A and B NEA and l NEB On the long side of the face, add the merge point calculated from the adjacent side where the last vertex is located at the end of the vertex list of the face element B, and calculate the longest side l among the adjacent sides of the face NEA The distance between the two vertices A1 and A2 and the merged points P1 and P2; if the two merged points are on the adjacent edges of the surface elements A and B respectively NEA and l NEB First, determine the adjacent edge l of the face NEB Zhong and l NEA Intersecting adjacent edges, get the adjacent edge and the shorter edge l of the adjacent edge NEB The intersection point is used as the last vertex in the vertex list of the surface element B, and the adjacent edge l NEB Another point in the image is used as the first vertex to reconstruct the vertex list of the surface element and calculate the longest side l among the adjacent sides of the surface. NEA The distance between the two vertices A1 and A2 and the merged points P1 and P2; For the above two situations respectively, if Then add point A2 to the vertex list of surface element B as the last vertex of the merged surface; if Then add point A1 to the vertex list of the surface element B as the last vertex of the merged surface; determine whether the last vertex of the vertex list after the added point is the first or last vertex of the vertex list of the surface element A; if it is the first vertex of the surface element A, then sequentially add the vertices in the vertex list of the surface element A; If it is the last vertex of surface element A, then the vertices in the vertex list of surface element A are appended in reverse order.
8. A system for merging planar elements using buffer analysis, characterized in that: It includes a threshold range setting module, a redundant point deletion module, a buffer construction module, an adjacent edge judgment module, a merging point calculation module, and a merging surface construction module; The threshold range setting module is used to set the threshold for simplifying the edge of the surface element and the threshold range of the angle formed by the two edges according to the characteristics of the surface element; The redundant point deletion module is used to delete redundant points of planar elements according to the planar element edge simplification threshold; The buffer construction module is used to construct a buffer for the edge lines of the surface elements; The adjacent edge determination module is used to calculate and determine whether there are adjacent edges between two planar elements according to the buffer of the edge line; if there are adjacent edges, the adjacent edges are obtained and the next step is entered; if not, the two planar elements are not merged and the process ends; The calculation merging point module is used to determine the angle between adjacent edges, and calculate the merging point between two planar elements according to the threshold range of the angle between the two edges and the acquired adjacent edges of the two planar elements; The module for constructing a merged surface is used to construct a merged surface according to the merged points of two planar elements, so as to complete the merging of the two planar elements.
9. The system for merging planar elements using buffer zone analysis according to claim 8, characterized in that: The adjacent edge determination module includes adjacent edge determination and acquisition units, which are specifically used for: Select a certain edge buffer P of the surface element A Ai , if P Ai and the buffer zones of the edges of the surface element B Then Ai and l Bj For the adjacent edges of elements A and B, add them to the adjacent edge set NE; Repeat the above steps to continue to determine other edge buffers of the surface element A until all edges of the surface element A are determined; If the number of adjacent edge sets NE is greater than 2, obtain the face ownership of each adjacent edge in NE, and obtain two adjacent edge sets NEA and NEB according to the ownership; Calculate the sum of the endpoint distances between the adjacent edges contained in the set NEA and the adjacent edges contained in NEB, as shown in the following formula: The smallest d sum The two adjacent edges corresponding to the value are the adjacent edges of the surface elements A and B. NEA and l NEB .
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is executed by a processor, the steps in the method for merging planar elements using buffer analysis according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for simplifying numerical map settlement place polygon by utilizing parametric design model
CN101930483A
