Room data generation method, device, equipment and medium based on building vector diagram

By generating room polygons based on a building vector diagram and using wall linear data and the rolling ball method to construct contour lines, the problems of labor consumption and large errors in traditional methods are solved, and the generated room polygons are more in line with actual needs.

CN115482310BActive Publication Date: 2025-09-16GUANGZHOU MASHI INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211178786.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2025-09-16
Estimated Expiration
2042-09-27

AI Technical Summary

Technical Problem

Traditional 3D map room generation methods consume a lot of manpower and are easily affected by corners such as columns. It is difficult to generate seamless structural data, and the door information parsing is complex, making it difficult to meet actual needs.

Method used

By obtaining building vector diagram data, using wall linear data and preset parameters to generate door data, constructing a line data set, obtaining closed contour lines based on the rolling ball method, determining the vertices of valid edges, and generating room polygons, it avoids parsing precise door information.

Benefits of technology

It reduces manual intervention, improves generation efficiency, reduces errors, and generates room polygons that are more in line with actual needs and are less affected by columns and corners.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115482310B_ABST
    Figure CN115482310B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment, and medium for generating room data based on a building vector map. The method comprises acquiring building vector map data and obtaining wall linear data based on the building vector map data; generating door data based on the wall linear data, a preset wall thickness parameter, and a maximum door length; and constructing a line data set based on the door data and the wall linear data; decomposing the line data set into discrete line segments, sampling the discrete line segments to obtain a discrete point set; obtaining multiple closed contours based on a rolling ball method based on a preset circle diameter and the discrete point set; determining the vertices of the closed contours based on valid edges in the closed contours; wherein a valid edge is an edge in each closed contour whose side length is greater than the circle diameter; and restoring all vertices to obtain a room polygon. This method can generate room data from wall linear data without having to parse precise door information to fill in wall gaps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of building vector diagrams, and in particular to a method, device, equipment and medium for generating room data based on a building vector diagram. Background Art

[0002] At present, traditional 3D map rooms are generally manually drawn polygonal rooms and converted into 3D stereo data. This wastes a lot of manpower costs and takes a long time to draw maps. Because it is manually drawn, it is prone to errors. A method of identifying rooms with walls provides an idea for restoring rooms through wall data. However, this method requires parsing accurate door, column, and window information to fill the wall gaps and obtain closed room polygon data. Generally, doors are arc-shaped data and need to be parsed into walls that match the surrounding environment to fill the wall data gaps. Some areas without doors will be merged into other rooms or corridors. However, the room generation process is easily affected by corners such as columns, making it difficult to obtain seamless structural data, which does not meet actual needs. Summary of the Invention

[0003] The present invention provides a method, device, equipment and medium for generating room data based on a building vector diagram, so as to realize generating room data through wall linear data without parsing precise door information to fill wall intervals.

[0004] In a first aspect, in order to solve the above technical problems, the present invention provides a method for generating room data based on a building vector diagram, comprising:

[0005] Acquire building vector graphics data, and obtain wall linear data based on the building vector graphics data;

[0006] Generate door data according to the wall linear data, a preset wall thickness parameter and a maximum door length, and construct a line data set according to the door data and the wall linear data;

[0007] Decomposing the line data set into discrete line segments, and performing point sampling on the discrete line segments to obtain a discrete point set;

[0008] According to the preset circle diameter and the discrete point set, a plurality of closed contour lines are obtained based on the rolling ball method;

[0009] Determining the vertices of the closed contour according to the valid sides in the closed contour; wherein the valid sides are sides in each of the closed contours whose side length is greater than the diameter of the circle;

[0010] Restoration is performed based on all the vertices to obtain the room polygon.

[0011] Preferably, generating door data according to the wall linear data, a preset wall thickness parameter and the maximum door length, and constructing a line data set according to the door data and the wall linear data includes:

[0012] Traversing all edges of the wall linear data, converting each edge of the wall linear data into a discrete two-point line segment, and storing the segment segments into a line segment group;

[0013] Traversing the line segment group, selecting an input line segment within a preset thickness range from the line segment group and searching with the input line segment as the center to obtain all output line segments whose distance from the input line segment is within a preset gate width;

[0014] A target line segment that satisfies a parallel overlapping projection condition with the input line segment and whose distance is less than the maximum length of the door is selected from all the output line segments, door data is generated according to the input line segment and the target line segment, and a line data set is constructed according to the door data and the wall linear data.

[0015] Preferably, decomposing the line data set into discrete line segments and performing point sampling on the discrete line segments to obtain a discrete point set comprises:

[0016] Splitting the line data set into a line segment set consisting of two discrete points;

[0017] uniformly sampling each line segment in the line segment set according to a preset sampling density to obtain point data;

[0018] A discrete point set is constructed based on all the point data and the first and last two points of each line segment.

[0019] Preferably, determining the vertices of the closed contour line according to the valid edges in the closed contour line comprises:

[0020] When the number of valid edges in any of the closed contour lines is greater than 3, the closed contour line is determined to be a valid polygon;

[0021] Extending every two adjacent valid sides of the valid polygon to obtain valid side extension lines;

[0022] The intersection point of two adjacent extension lines of the effective edges is determined as the vertex of the closed contour line.

[0023] Preferably, the method further comprises:

[0024] When any two room polygons overlap, the polygons of the two room polygons that overlap with the wall or door data are deleted.

[0025] In a second aspect, the present invention provides a room data generation device based on a building vector diagram, comprising:

[0026] A data acquisition module is used to acquire building vector diagram data and obtain wall linear data based on the building vector diagram data;

[0027] a line set generating module, configured to generate door data according to the wall linear data, a preset wall thickness parameter and a maximum door length, and to construct a line data set according to the door data and the wall linear data;

[0028] a vertex sampling module, configured to decompose the line data set into discrete line segments, and perform point sampling on the discrete line segments to obtain a discrete point set;

[0029] A contour generation module, configured to obtain a plurality of closed contour lines based on a rolling ball method according to a preset circle diameter and the discrete point set;

[0030] a vertex determination module, configured to determine the vertices of the closed contour according to the valid edges in the closed contour; wherein the valid edges are edges in each of the closed contours whose side length is greater than the diameter of the circle;

[0031] The room generation module is used to restore all the vertices to obtain room polygons.

[0032] Preferably, the line set generation module includes:

[0033] a line segment generating unit, configured to traverse all edges of the wall linear data, convert each edge of the wall linear data into a discrete two-point line segment, and store the segment into a line segment group;

[0034] a traversal search unit, configured to traverse the line segment group, select an input line segment within a preset thickness range from the line segment group, and search with the input line segment as the center to obtain all output line segments whose distance from the input line segment is within a preset gate width;

[0035] A line set generation unit is configured to select a target line segment from all the output line segments, which satisfies a parallel overlapping projection condition with the input line segment and whose distance is less than the maximum length of the door, generate door data based on the input line segment and the target line segment, and construct a line data set based on the door data and the wall linear data.

[0036] Preferably, the vertex sampling module includes:

[0037] An array splitting unit, configured to split the line data set into a line segment set consisting of two discrete points;

[0038] a point sampling unit, configured to uniformly sample each line segment in the line segment set according to a preset sampling density to obtain point data;

[0039] The set construction unit constructs a discrete point set according to all the point data and the first and last points of each line segment.

[0040] In a third aspect, the present invention also provides a terminal device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for generating room data based on a building vector diagram as described above is implemented.

[0041] In a fourth aspect, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned room data generation methods based on building vector diagrams.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] The present invention provides a room data generation method based on a building vector map. The method obtains building vector map data and obtains wall linear data based on the building vector map data. Based on the wall linear data, preset wall thickness parameters, and maximum door length, the method optimizes efficiency by using short edges combined with spatial data index Rtree to generate a polygon array of door data. Combined with the original wall linear data, a line data set containing the door data is constructed. The line data set is decomposed into discrete line segments, and the discrete line segments are sampled to obtain a discrete point set. Based on a preset circle diameter and the discrete point set, multiple closed contours are obtained based on a rolling ball method. The vertices of the closed contours are determined based on valid edges in the closed contours. The valid edges are edges in each closed contour whose side length is greater than the circle diameter. The room polygons are restored based on all the vertices. The present invention uses alphaShape (rolling ball method) to construct the closed contour of the room and restores the room polygons using contour scatter points. The entire process does not require accurate door information to fill the wall gaps, is less affected by columns and corners, and is more in line with actual needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 This is a flow chart of a method for generating room data based on a building vector diagram provided by the first embodiment of the present invention;

[0045] Figure 2 It is a schematic diagram of parallel overlapping projection;

[0046] Figure 3It is a schematic diagram of the wall linear data;

[0047] Figure 4 It is a schematic diagram of the line data set after the gate data is generated;

[0048] Figure 5 is a schematic diagram of a set of discrete points;

[0049] Figure 6 It is a schematic diagram of the generated closed contour line and its edge point data;

[0050] Figure 7 It is the overall schematic diagram of the room polygon;

[0051] Figure 8 It is a structural diagram of a room data generating device based on a building vector diagram provided by a second embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0053] Reference Figure 1 The first embodiment of the present invention provides a method for generating room data based on a building vector diagram, comprising the following steps:

[0054] S11, acquiring building vector diagram data, and obtaining wall linear data according to the building vector diagram data;

[0055] S12, generating door data according to the wall linear data, a preset wall thickness parameter and a maximum door length, and constructing a line data set according to the door data and the wall linear data;

[0056] S13, decomposing the line data set into discrete line segments, and performing point sampling on the discrete line segments to obtain a discrete point set;

[0057] S14, obtaining a plurality of closed contour lines based on a rolling ball method according to a preset circle diameter and the discrete point set;

[0058] S15, determining the vertices of the closed contour according to the valid edges in the closed contour; wherein the valid edges are edges in each closed contour whose side length is greater than the diameter of the circle;

[0059] S16, performing restoration based on all the vertices to obtain a room polygon.

[0060] In step S11, building vector graphics data is acquired, and wall linear data is obtained based on the building vector graphics data. The wall linear data includes wall polygons or wall polygon edges.

[0061] It should be noted that this invention generates room data from walls. After acquiring architectural vector map data (such as CAD data), the wall data layer generally directly generates wall line data. Some CAD models also contain pre-drawn wall polygons, in which case the edge data of these polygons needs to be parsed. In rare cases, the architectural vector map lacks wall data, requiring manual drawing of wall edge data.

[0062] In step S12, door data is generated according to the wall linear data, the preset wall thickness parameter and the maximum door length, and a line data set is constructed according to the door data and the wall linear data, including:

[0063] Traversing all edges of the wall linear data, converting each edge of the wall linear data into a discrete two-point line segment, and storing the segment segments into a line segment group;

[0064] Traversing the line segment group, selecting an input line segment within a preset thickness range from the line segment group and searching with the input line segment as the center to obtain all output line segments whose distance from the input line segment is within a preset gate width;

[0065] A target line segment that satisfies a parallel overlapping projection condition with the input line segment and whose distance is less than the maximum length of the door is selected from all the output line segments, door data is generated according to the input line segment and the target line segment, and a line data set is constructed according to the door data and the wall linear data.

[0066] In practical applications, a maximum door length of 0.5 to 5 meters can meet the indoor conditions of most CAD drawings. Depending on the scenario, the maximum door length parameter can be 0 to 20 meters.

[0067] The process of determining the parallel overlapping projection condition includes:

[0068] When line segment A is parallel to line segment B and the distance between line segment A and line segment B is within the preset wall thickness parameter, and line segment A' obtained by projecting line segment A onto the straight line where line segment B is located intersects and overlaps with line segment B, it is determined that line segment A and line segment B meet the parallel overlapping projection condition.

[0069] Suppose there are two lines AB. If they meet the following conditions, they are defined as parallel overlapping projections:

[0070] 1) A is parallel to B;

[0071] 2) A', obtained by projecting A onto the line where B is located (two vertices are projected vertically), intersects and overlaps with B;

[0072] 3) The distance between AB is within the wall thickness parameters;

[0073] like Figure 2 As shown, assuming that ac is parallel to dg and hj, we will not discuss the thickness parameter for now. ac and dg have parallel overlapping projections because the projection of ac on dg is df, which intersects dg. ac and eg have parallel overlapping projections because the projection of ac on the line dg on which eg lies is df, which intersects eg. Similarly, ac and hj have parallel overlapping projections. ab and fg have non-parallel overlapping projections because the projection of ab on the line dg on which eg lies is de, which does not intersect fg. Similarly, ab and ij have non-parallel overlapping projections, and ac and fg have non-parallel overlapping projections because the projection of ac on the line dg on which eg lies is df, which intersects fg but does not overlap. Similarly, ac and ij have non-parallel overlapping projections.

[0074] Then the thickness parameter needs to be considered. Assuming that the distance be between ac and dg is ε, and the distance eh between hj and dg is ε, and assuming that the preset wall thickness parameter is 1 / 2ε to 3 / 2ε, it is considered that the distance 2ε from ac to hj does not meet the thickness parameter, then the above ac and hj are not parallel overlapping projections.

[0075] In specific applications, the thickness range of 0.05 to 0.4 meters can meet the indoor conditions of most CAD drawings. Depending on the scenario, the wall thickness parameter is defined as 0.01 to 10 meters.

[0076] Reference Figure 3 、 Figure 4 In step S12, after generating the door data, we first traverse all edges of the wall linear data to find any edges smaller than the wall thickness. We then search the R-tree to see if this edge can overlap with a nearby parallel edge whose projection is smaller than the door width to form a wall. If the generated portion is already inside the wall, it doesn't matter, as this step primarily serves to close the area. Using the R-tree in this process can reduce the amount of searching and save time.

[0077] In step S13, the line data set is decomposed into discrete line segments, and point sampling is performed on the discrete line segments to obtain a discrete point set, including:

[0078] Splitting the line data set into a line segment set consisting of two discrete points;

[0079] uniformly sampling each line segment in the line segment set according to a preset sampling density to obtain point data;

[0080] A discrete point set is constructed based on all the point data and the first and last two points of each line segment.

[0081] The sampling density can be directly used as the wall thickness. In the specific implementation, the polygon is first decomposed into discrete lines, and then each line is sampled with points. The fixed width between each point plus the first and last two points of each line segment are put into a set to obtain a discrete point set, such as Figure 5 shown.

[0082] In step S14, a plurality of closed contour lines are obtained based on a rolling ball method according to the preset circle diameter and the discrete point set.

[0083] It should be noted that the purpose of this step is to determine the general shape of each room. AlphaShape (rolling ball method) can be used to restore the outline. Specifically, a set of discrete points is input, and the diameter of the circle controlling the alpha parameter is larger than the distance between the discrete points. The alpha value with a radius equal to the sampling distance can be directly used to obtain multiple closed curves, and then multiple closed contour lines of the room are formed through the closed curves. Figure 6 As shown in the figure, the polygon and its edge point data generated by calling AlphaShape. Since AlphaShape cannot restore the specific angle information, the right angles around the polygon need to be further restored.

[0084] In step S15, determining the vertices of the closed contour line according to the valid edges in the closed contour line includes:

[0085] When the number of valid edges in any of the closed contour lines is greater than 3, the closed contour line is determined to be a valid polygon;

[0086] Extending every two adjacent valid sides of the valid polygon to obtain valid side extension lines;

[0087] The intersection point of two adjacent extension lines of the effective edges is determined as the vertex of the closed contour line.

[0088] The effective side is a side of each closed contour line whose side length is greater than the diameter of the circle.

[0089] It's important to note that after obtaining the general shape of the room, since the alpha shape is composed of scattered points, many scattered points may appear on the same straight line and corner information may be ignored. Therefore, it's necessary to first restore the edges larger than the diameter of the alpha circle, which are called valid edges. When the number of valid edges is greater than three, the polygon is considered valid. Between every two adjacent valid edges, find the point where their extensions intersect. The intersection of these extensions is the vertex of the polygon. Once all vertices are found, the room polygon can be restored.

[0090] Furthermore, the room size and number of edges can be controlled to ensure room validity. In special cases, such as when two adjacent valid edges are parallel or their intersection is very far away, the two edges are considered to be non-adjacent edges of the actual room, and a perpendicular line is drawn to restore the other valid edge between them.

[0091] In step S16, all the vertices are restored to obtain the room polygon. This step can realize polygon restoration simplification, and the final generated room polygon is as follows Figure 7 shown.

[0092] Furthermore, when any two room polygons overlap, any overlapping polygons with wall or door data are deleted. It should be noted that because the desired rooms are independent and non-overlapping, AlphaShape may generate overlapping data structures. For example, the map's outline generally also generates room areas. Therefore, when room polygons overlap, an overlap check is performed on the resulting room data. Generally, the smaller polygon room area is retained, and the larger room is used as the partial or overall outline.

[0093] The present invention provides a method for generating room data based on a building vector map. The method obtains building vector map data and obtains wall linear data based on the building vector map data. A line data set containing door data is generated based on the wall linear data, a preset wall thickness parameter, and a maximum door length. The short edge combined with the spatial data index Rtree can be used for efficiency optimization to construct a line data set containing door data. The line data set is decomposed into discrete line segments, and the discrete line segments are sampled to obtain a discrete point set. Based on a preset circle diameter and the discrete point set, multiple closed contours are obtained using a rolling ball method. The vertices of the closed contours are determined based on valid edges in the closed contours, wherein the valid edges are edges in each closed contour whose side length is greater than the circle diameter. The room polygon is obtained by restoring all the vertices. The present invention uses an alpha shape (rolling ball method) to construct the closed contour of the room, construct a line data set containing door data, and restore the room polygon using contour scatter points. The entire process does not require accurate door information to fill wall gaps, is less affected by columns and corners, and is more in line with actual needs.

[0094] Reference Figure 8 The second embodiment of the present invention provides a room data generation device based on a building vector diagram, comprising:

[0095] A data acquisition module is used to acquire building vector diagram data and obtain wall linear data based on the building vector diagram data;

[0096] a line set generating module, configured to generate door data according to the wall linear data, a preset wall thickness parameter and a maximum door length, and to construct a line data set according to the door data and the wall linear data;

[0097] a vertex sampling module, configured to decompose the line data set into discrete line segments, and perform point sampling on the discrete line segments to obtain a discrete point set;

[0098] A contour generation module, configured to obtain a plurality of closed contour lines based on a rolling ball method according to a preset circle diameter and the discrete point set;

[0099] a vertex determination module, configured to determine the vertices of the closed contour according to the valid edges in the closed contour; wherein the valid edges are edges in each of the closed contours whose side length is greater than the diameter of the circle;

[0100] The room generation module is used to restore all the vertices to obtain room polygons.

[0101] Preferably, the line set generation module includes:

[0102] a line segment generating unit, configured to traverse all edges of the wall linear data, convert each edge of the wall linear data into a discrete two-point line segment, and store the segment into a line segment group;

[0103] a traversal search unit, configured to traverse the line segment group, select an input line segment within a preset thickness range from the line segment group, and search with the input line segment as the center to obtain all output line segments whose distance from the input line segment is within a preset gate width;

[0104] A line set generation unit is configured to select a target line segment from all the output line segments, which satisfies a parallel overlapping projection condition with the input line segment and whose distance is less than the maximum length of the door, generate door data based on the input line segment and the target line segment, and construct a line data set based on the door data and the wall linear data.

[0105] Preferably, the vertex sampling module includes:

[0106] An array splitting unit, configured to split the line data set into a line segment set consisting of two discrete points;

[0107] a point sampling unit, configured to uniformly sample each line segment in the line segment set according to a preset sampling density to obtain point data;

[0108] The set construction unit constructs a discrete point set according to all the point data and the first and last points of each line segment.

[0109] Preferably, the vertex determination module includes:

[0110] a polygon determination unit, configured to determine any closed contour line as a valid polygon when the number of valid edges in the closed contour line is greater than 3;

[0111] an extension unit, configured to extend every two adjacent valid edges in the valid polygon to obtain valid edge extension lines;

[0112] The vertex determination unit is used to determine the intersection of two adjacent extension lines of the effective edges as the vertex of the closed contour line.

[0113] Preferably, the device further comprises:

[0114] The overlapping deletion module is used to delete the polygons of the two room polygons that overlap with the wall or door data when any two room polygons overlap.

[0115] It should be noted that the room data generation device based on the building vector diagram provided in an embodiment of the present invention is used to execute all the process steps of the room data generation method based on the building vector diagram in the above embodiment. The working principles and beneficial effects of the two correspond one to one, so they will not be repeated here.

[0116] An embodiment of the present invention further provides a terminal device. The terminal device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a room data generation program based on a building vector diagram. When the processor executes the computer program, the steps of the above-mentioned embodiments of the room data generation method based on a building vector diagram are implemented, such as Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are realized, such as the contour generation module.

[0117] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0118] The terminal device may be a computing device such as a desktop computer, laptop, PDA, or smart tablet. The terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will appreciate that the aforementioned components are merely examples of terminal devices and do not constitute a limitation of the terminal device. The terminal device may include more or fewer components than those described above, or a combination of certain components or different components. For example, the terminal device may also include input / output devices, network access devices, buses, and the like.

[0119] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.

[0120] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0121] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0122] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.

[0123] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A room data generation method based on building vector diagram, characterized in that: include: Acquire building vector graphics data, and obtain wall linear data based on the building vector graphics data; Generate door data according to the wall linear data, a preset wall thickness parameter and a maximum door length, and construct a line data set according to the door data and the wall linear data; Decomposing the line data set into discrete line segments, and performing point sampling on the discrete line segments to obtain a discrete point set; According to the preset circle diameter and the discrete point set, a plurality of closed contour lines are obtained based on the rolling ball method; Determining the vertices of the closed contour according to the valid sides in the closed contour; wherein the valid sides are sides in each of the closed contours whose side length is greater than the diameter of the circle; Restore according to all the vertices to obtain the room polygon; The generating of door data according to the wall linear data, a preset wall thickness parameter and a maximum door length, and constructing a line data set according to the door data and the wall linear data, includes: Traversing all edges of the wall linear data, converting each edge of the wall linear data into a discrete two-point line segment, and storing the segment segments into a line segment group; Traversing the line segment group, selecting an input line segment within a preset thickness range from the line segment group and searching with the input line segment as the center to obtain all output line segments whose distance from the input line segment is within a preset gate width; A target line segment that satisfies a parallel overlapping projection condition with the input line segment and whose distance is less than the maximum length of the door is selected from all the output line segments, door data is generated based on the input line segment and the target line segment, and a line data set is constructed based on the door data and the wall linear data.

2. The room data generation method based on building vector diagram according to claim 1 is characterized in that Decomposing the line data set into discrete line segments and performing point sampling on the discrete line segments to obtain a discrete point set includes: Splitting the line data set into a line segment set consisting of two discrete points; uniformly sampling each line segment in the line segment set according to a preset sampling density to obtain point data; A discrete point set is constructed based on all the point data and the first and last two points of each line segment.

3. The room data generation method based on building vector diagram according to claim 1 is characterized in that: The step of determining the vertices of the closed contour line according to the valid edges in the closed contour line comprises: When the number of valid edges in any of the closed contour lines is greater than 3, the closed contour line is determined to be a valid polygon; Extending every two adjacent valid sides of the valid polygon to obtain valid side extension lines; The intersection point of two adjacent extension lines of the effective edges is determined as the vertex of the closed contour line.

4. The room data generation method based on building vector diagram according to claim 1 is characterized in that: The method further comprises: When any two room polygons overlap, the polygons of the two room polygons that overlap with the wall or door data are deleted.

5. A room data generation device based on a building vector diagram, characterized in that: include: A data acquisition module is used to acquire building vector diagram data and obtain wall linear data based on the building vector diagram data; a line set generating module, configured to generate door data according to the wall linear data, a preset wall thickness parameter and a maximum door length, and to construct a line data set according to the door data and the wall linear data; a vertex sampling module, configured to decompose the line data set into discrete line segments, and perform point sampling on the discrete line segments to obtain a discrete point set; A contour generation module, configured to obtain a plurality of closed contour lines based on a rolling ball method according to a preset circle diameter and the discrete point set; a vertex determination module, configured to determine the vertices of the closed contour according to the valid edges in the closed contour; wherein the valid edges are edges in each of the closed contours whose side length is greater than the diameter of the circle; A room generation module, configured to restore all the vertices to obtain room polygons; Wherein, the line set generation module includes: a line segment generating unit, configured to traverse all edges of the wall linear data, convert each edge of the wall linear data into a discrete two-point line segment, and store the segment into a line segment group; a traversal search unit, configured to traverse the line segment group, select an input line segment within a preset thickness range from the line segment group, and search with the input line segment as the center to obtain all output line segments whose distance from the input line segment is within a preset gate width; A line set generation unit is configured to select a target line segment from all the output line segments, which satisfies a parallel overlapping projection condition with the input line segment and whose distance is less than the maximum length of the door, generate door data based on the input line segment and the target line segment, and construct a line data set based on the door data and the wall linear data.

6. The room data generating device based on building vector diagram according to claim 5, characterized in that: The vertex sampling module includes: An array splitting unit, configured to split the line data set into a line segment set consisting of two discrete points; a point sampling unit, configured to uniformly sample each line segment in the line segment set according to a preset sampling density to obtain point data; The set construction unit constructs a discrete point set according to all the point data and the first and last points of each line segment.

7. A terminal device, characterized in that: The system comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for generating room data based on a building vector map according to any one of claims 1 to 4 is implemented.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the room data generation method based on the building vector diagram according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Indoor automatic drawing and modeling method based on planar image

    CN110532602A