Search

CN-115578443-B - Method for extracting center line of building or road plan based on polygonal straight framework

CN115578443BCN 115578443 BCN115578443 BCN 115578443BCN-115578443-B

Abstract

The invention relates to a method for extracting a central line of a building or road plan based on a polygonal straight framework. The method solves the problem of insufficient extraction precision of the central line of the building in the prior art. The method comprises the steps of S1, inputting building plan data, S2, conducting polygon straight skeleton processing on the building plan data, S3, conducting center line segment screening on the polygon straight skeletons, S4, traversing the screened polygon straight skeletons, replacing each discarded polygon straight skeleton side through a folding line, and connecting the center line segments of all the polygon straight skeletons 1 into a complete polygon straight skeleton diagram. The invention has the advantages of ensuring higher precision and more beautiful appearance of the extracted central line of the building, and effectively improving the running efficiency and the stability of the running result.

Inventors

  • WU JIAXIN
  • Zheng youyi
  • DONG SHICHONG
  • TAN LIZHENG
  • ZHANG HAO

Assignees

  • 上海天华建筑设计有限公司
  • 浙江大学

Dates

Publication Date
20260505
Application Date
20221012

Claims (1)

  1. 1. The method for extracting the central line of the building or road plan based on the polygonal straight framework is characterized by comprising the following steps of: S1, inputting building plan data; in step S1, input building plan data are represented by simple polygons with holes, and for an arc wall surface, a broken line is obtained by sampling on the arc, and an orthogonal broken line or a smooth broken line selected when a central line is connected is controlled through a switch option; S2, carrying out polygonal straight skeleton (1) processing on the building plan data; In step S2, the straight polygonal skeleton (1) continuously translates the straight lines of each side inwards at the same speed along the normal direction, when the non-adjacent contour sides (11) collide, the connection sequence of the two polygonal contour sides (11) is changed and skeleton vertexes (14) are generated, until all the contour sides (11) are extruded to be 0 in length, and the motion trail of the endpoints of all the sides obtained in the process is the straight polygonal skeleton (1); Wherein the circumferential side of the simple polygon is a contour side (11); the top vertices of the simple polygon are contour vertices (12); The edge formed by the edge and the angular bisector of the edge of the simple polygon is a framework edge (13); The point formed by intersecting the skeleton edges (13) is a skeleton vertex (14); the angular bisectors of two adjacent contour vertexes (12) are contour bisectors (15); The line which is located in the simple polygon and is formed by the points used for connecting the contour bisectors (15) is an internal bisector (16); the internal bisector (16) and the contour bisector (15) form the skeleton edge (13); S3, screening the central line segments of the polygonal straight framework (1); S4, traversing the screened polygonal straight frameworks (1), replacing each discarded framework edge (13) through a folding line, and connecting the central line segments of all the polygonal straight frameworks (1) into a complete polygonal straight framework (1) graph; In the step S3, in the process of screening the central line segment, the polygonal straight skeleton (1) is screened according to the relation of two contour edges (11) of each line segment generated in the polygonal straight skeleton (1), and the method comprises the following detailed steps: S31, defining the direction of the contour edge (11) as a counterclockwise direction surrounding the inner area of the polygon; S32, defining an included angle between the direction of the next contour edge (11) along the direction and the direction of the current contour edge (11) as an included angle of a contour vertex (12); S33, judging concave points and convex points and reserving skeleton edges (13) meeting the conditions as central line segments; if the next contour edge (11) turns leftwards, the angle is positive, and the vertex is the salient point; The concave point judging condition is that if the next contour edge (11) turns right, the angle is negative, and the vertex is concave point; The included angle of two corresponding contour edges (11) of the skeleton edge (13) meeting the reservation condition is positive and is larger than 90 degrees; In step S4, a vector list is maintained for each skeleton vertex (14) to indicate the direction of all the centerlines that have been connected to the skeleton vertex (14) at the current time, enumerating all the skeleton vertices (14) in the order of formation, enumerating the discarded skeleton edges (13) of each skeleton vertex (14) that is not on the contour edge (11), and replacing the discarded skeleton edges (13); If the input options are selected to not require orthogonal folding lines, the original skeleton edge (13) is still used for connection, otherwise, the connection mode is determined according to vector lists of two endpoints of the skeleton edge (13); If the vector list of the target points of the skeleton side (13) is empty, calculating and scoring each direction v in the vector list of the starting point and the direction vector base_v of the skeleton side (13), and selecting the direction with the largest score for connection; The calculation method for calculating the scores comprises the following steps: If v is parallel or orthogonal to base_v, the score is 1, the original skeleton edge (13) is directly selected for connection, if the absolute value of the included angle of the two contour edges (11) is not more than 90 degrees, the cosine value of the included angle of the two contour edges (11) is c, max (1-c 2, c 2/2) is taken as the score, if the value of 1-c 2 is large, the two contour edges (11) are biased to be orthogonal, and the perpendicular foot from v to the target point is directly prolonged; If the value of c 2/2 is large, the two contour sides (11) are biased to be in the same direction, and the original skeleton sides (13) are directly selected for connection at the moment, if the absolute value of the included angle of the two contour sides (11) exceeds 90 degrees, the score is c and c is less than 0, and the original skeleton sides (13) are directly adopted for connection; If the vector list of the target point of the skeleton edge (13) is not empty, calculating scores for all combinations v0 and v1 of vector lists of the two end points and base_v respectively, and selecting the direction with the largest score for connection, wherein the calculating method of the scores is that the cosine of an included angle between the vector v0 and the base_v is c0, the sine of an included angle between the vector v0 and the base_v is s0, the cosine of an included angle between the vector v1 and the base_v is c1, the sine of an included angle between the vector v1 and the base_v is s1, and if c0 or c1 is close to 1, the score is 4, and the original skeleton edge (13) is directly selected for connection; if an included angle with the absolute value larger than or equal to 90 degrees exists in the two, the perpendicular lines of the corresponding vectors can be used for replacing the corresponding vectors, so that both c0 and c1 are ensured to be larger than 0, but the corresponding score is halved; If the signs of s0 and s1 are opposite, the midpoint of the original skeleton edge (13) can be directly taken as a point where the perpendicular line with smaller cosine value intersects with the extension line of the other edge, and the square of the cosine value of the included angle is marked as v1 and v 0; if the symbols of s0 and s1 are the same, the included angle between v0 and v1 is determined, if the included angle between the absolute values exceeds 120 degrees, the absolute values of the two are remembered to be divided into ((2c0≡2-1) ≡2+ (2c1≡2-1) ≡2)/2, the two points are correspondingly connected by directly using the original skeleton edge (13), otherwise, the two points are directly connected by intersecting the extension line of v0 and v1 at one point, the corresponding score is 2sin≡2 (angle (v 0, v 1)), and after the replacement of the current skeleton edge (13) is completed, the vector lists of the two points are updated.

Description

Method for extracting center line of building or road plan based on polygonal straight framework Technical Field The invention relates to the technical field of building design, in particular to a method for extracting a central line of a building or road plan based on a polygonal straight framework. Background As shown in fig. 1 and 2, the method for automatically generating indoor map space data of a building plan in the prior art mainly focuses on extracting a canonical representation of a wall body according to a complex building plan, wherein in order to restore connectivity of a wall body with a column, the general trend of a wall body polygon is extracted. Because the technology is only oriented to the wall body conforming to the unified specification of building construction drawing, the technology only considers the wall section formed by two parallel line sections or concentric circular arcs with opposite edge line center positions as a basic unit, and uses bisectors of two side end lines to connect parts between adjacent wall sections, the method only can process the parts of the polygon, wherein the parts of the polygon, which are parallel to the two side line sections and exist the same edge line, is difficult to process the polygon, the width of which is gradually changed and exists different edge lines, and for the case that the connecting line between the center line endpoints of the adjacent wall segments is exactly perpendicular to the wall segments, the connecting line supplemented by the method is collinear with the connecting line of the center line endpoints of the adjacent wall segments, and when the thickness ratio of the adjacent wall segments exceeds 2, the connected center line is coincident with the edge of the wall, such as the DE segment in fig. 3, so that the center line obtained by the method is not suitable for the tasks of electric equipment arrangement, lighting circuit wiring and the like, the center line extraction precision of the building is insufficient, and the operation result and the operation efficiency are affected. Disclosure of Invention The invention aims to solve the problems and provide a method for extracting the center line of a building or a road plan based on a polygonal straight skeleton, which has high extraction precision of the center line of the building. In order to achieve the aim, the invention adopts the following technical scheme that the method for extracting the central line of the building or road plan based on the polygonal straight framework comprises the following steps: S1, inputting building plan data; S2, performing polygonal straight skeleton processing on the building plan data; s3, screening the central line segments of the polygonal straight skeleton; And S4, traversing the screened polygonal straight frameworks, replacing the edges of each discarded polygonal straight framework by fold lines, and connecting the central line segments of all the polygonal straight frameworks 1 into a complete polygonal straight framework graph. The method is characterized in that the polygonal straight skeleton processing is carried out on the plan view data of the building, the side walls are extruded inwards at the same speed to obtain the straight skeleton which is the track of the intersection point of the wall line segments, and then the track line segments are screened and trimmed according to the shape distribution characteristics of the walls on the two sides of the track, so that the central line which has attractive turning points and meets the requirements of building design is obtained, the trend of the plan view can be effectively reflected, the points on the central line can cover the whole polygon with the minimum radius, the central line extraction precision and efficiency are improved, and the method is suitable for the central line extraction of common orthogonal buildings, and can provide support for the central line extraction of the area containing the arc wall surfaces by setting whether orthogonal turning is favored when the track segments are screened. In the method for extracting the center line of the building or the road plan based on the polygonal straight skeleton, in the step S1, the input building plan data is represented by a simple polygon with holes, and for the arc wall surface, the arc wall surface is sampled to obtain a broken line, and the orthogonal broken line or the smooth broken line selected when the center line is connected is controlled through a switch option. Thus, better effect can be achieved on the plan view of a large number of long and narrow areas surrounded by parallel wall surfaces. In the method for extracting the center line of the building or the road plan based on the polygonal straight skeleton, in the step S2, the straight line of each side is continuously translated inwards at the same speed along the normal direction, when the non-adjacent contour sides collide, the connection sequence o