CN115482310A - Room data generation method, device, equipment and medium based on building vector diagram - Google Patents

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

Info

Publication number
CN115482310A
CN115482310A CN202211178786.7A CN202211178786A CN115482310A CN 115482310 A CN115482310 A CN 115482310A CN 202211178786 A CN202211178786 A CN 202211178786A CN 115482310 A CN115482310 A CN 115482310A
Authority
CN
China
Prior art keywords
data
line
line segment
wall
discrete
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211178786.7A
Other languages
Chinese (zh)
Inventor
吕道祯
罗梨
卢志豪
高民
王周红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Code Stone Information Technology Co ltd
Original Assignee
Guangzhou Code Stone Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Code Stone Information Technology Co ltd filed Critical Guangzhou Code Stone Information Technology Co ltd
Priority to CN202211178786.7A priority Critical patent/CN115482310A/en
Publication of CN115482310A publication Critical patent/CN115482310A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/04Indexing scheme for image data processing or generation, in general involving 3D image data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10012Stereo images

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Remote Sensing (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本发明公开了一种基于建筑矢量图的房间数据生成方法、装置、设备及介质,方法包括获取建筑矢量图数据,并根据建筑矢量图数据得到墙体线状数据;根据墙体线状数据、预设的墙体厚度参数和门最大长度,生成门数据,并根据门数据和墙体线状数据,构建线数据集合;将线数据集合分解为离散线段,对离散线段进行点采样,得到离散点集合;根据预设的圆直径和离散点集合,基于滚球法得到多个闭合轮廓线;根据闭合轮廓线中的有效边确定闭合轮廓线的顶点;其中,有效边为每一闭合轮廓线中边长大于圆直径的边;根据所有顶点进行还原,得到房间多边形。本方法能实现通过墙体线状数据生成房间数据,无需解析精准的门信息填补墙间隔。

Figure 202211178786

The invention discloses a method, device, device and medium for generating room data based on building vector diagrams. The method includes acquiring building vector diagram data, and obtaining wall linear data according to the building vector diagram data; according to the wall linear data, The preset wall thickness parameters and the maximum length of the door are used to generate door data, and a line data set is constructed based on the door data and wall linear data; the line data set is decomposed into discrete line segments, and point sampling is performed on the discrete line segments to obtain discrete Point set; according to the preset circle diameter and discrete point set, multiple closed contour lines are obtained based on the rolling ball method; the vertices of the closed contour lines are determined according to the effective edges in the closed contour lines; wherein, the effective edges are each closed contour line The side whose middle side is longer than the diameter of the circle; restore according to all vertices to get the room polygon. This method can realize the generation of room data through wall linear data, without the need to analyze accurate door information to fill in the wall interval.

Figure 202211178786

Description

基于建筑矢量图的房间数据生成方法、装置、设备及介质Method, device, equipment and medium for generating room data based on architectural vector diagram

技术领域technical field

本发明涉及建筑矢量图技术领域,尤其涉及一种基于建筑矢量图的房间数据生成方法、装置、设备及介质。The present invention relates to the technical field of architectural vector graphics, in particular to a method, device, device and medium for generating room data based on architectural vector graphics.

背景技术Background technique

目前,传统的3d地图房间一般由人工绘制多边形房间,转换成3d立体数据,这样会浪费大量的人力成本,绘制地图时间较长,因为是人工绘制,容易存在误差。而在一种墙体识别房间的方法,提供了通过墙体数据还原房间的思路,不过该方法需要解析精准的门、柱、窗信息从而填补墙间隔,得到闭合的房间多边形数据。一般情况下,门是弧形数据,需要被解析成符合周围环境的墙填补墙体数据间隔,部分没有门的区域会被合并到其它房间或者过道。然而,在房间生成过程中易受到到柱子等拐角影响,难以得到无缝隙的结构数据,不符合实际需求。At present, the traditional 3D map room is usually manually drawn polygonal room and converted into 3D stereo data, which will waste a lot of labor costs and take a long time to draw the map, because it is drawn manually, prone to errors. A method for identifying rooms by walls provides the idea of restoring rooms through wall data, but this method needs to analyze accurate door, column, and window information to fill in the wall intervals and obtain closed room polygon data. In general, doors are arc-shaped data, which need to be parsed into walls that fit the surrounding environment to fill the wall data gap, and some areas without doors will be merged into other rooms or aisles. However, it is easy to be affected by corners such as pillars during the room generation process, and it is difficult to obtain seamless structural data, which does not meet actual needs.

发明内容Contents of the invention

本发明提供了一种基于建筑矢量图的房间数据生成方法、装置、设备及介质,以实现通过墙体线状数据生成房间数据,无需解析精准的门信息填补墙间隔。The present invention provides a method, device, equipment and medium for generating room data based on architectural vector diagrams, so as to realize generating room data through wall linear data without analyzing accurate door information to fill in wall intervals.

第一方面,为了解决上述技术问题,本发明提供了一种基于建筑矢量图的房间数据生成方法,包括:In the first aspect, in order to solve the above-mentioned technical problems, the present invention provides a method for generating room data based on architectural vector graphics, including:

获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;Obtaining architectural vector diagram data, and obtaining wall linear data according to the architectural vector diagram data;

根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合;Generate door data according to the wall linear data, preset wall thickness parameters and door maximum 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, performing point sampling on the discrete line segments to obtain a discrete point set;

根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;According to the preset circle diameter and the set of discrete points, multiple closed contour lines are obtained based on the rolling ball method;

根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;Determining the vertices of the closed contour line according to the effective sides in the closed contour line; wherein, the effective side is a side whose side length is greater than the diameter of the circle in each of the closed contour lines;

根据所有所述顶点进行还原,得到房间多边形。Reduction is performed based on all said vertices to obtain the room polygon.

优选地,所述根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合,包括:Preferably, the door data is generated according to the wall linear data, the preset wall thickness parameters and the maximum door length, and a line data set is constructed according to the door data and the wall linear data, include:

遍历所述墙体线状数据的所有边,将所述墙体线状数据的每个边转换为离散的两点线段,并存入线段组;Traversing all sides of the wall linear data, converting each side of the wall linear data into discrete two-point line segments, and storing them in line segment groups;

遍历所述线段组,从所述线段组中选取一个预设厚度范围内的输入线段并以所述输入线段为中心进行搜索,得到与所述输入线段的距离在预设门宽度内的所有输出线段;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, and obtain all outputs whose distance from the input line segment is within the preset gate width line segment;

从所有所述输出线段中选取与所述输入线段满足平行重叠投影条件且距离小于所述门最大长度的目标线段,根据所述输入线段和所述目标线段生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合。Select a target line segment that satisfies the parallel overlapping projection condition with the input line segment and is less than the maximum length of the gate from all the output line segments, generate gate data according to the input line segment and the target line segment, and generate gate data according to the gate data and the wall line data to construct a line data set.

优选地,所述将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合,包括:Preferably, the decomposing the line data set into discrete line segments, and performing point sampling on the discrete line segments to obtain a set of discrete points includes:

将所述线数据集合拆分为由离散的两点组成的线段集;Splitting the line data set into a set of line segments consisting of two discrete points;

根据预设的采样密度在所述线段集中的每一线段上均匀采样,得到点数据;uniform sampling on each line segment in the line segment set according to a preset sampling density to obtain point data;

根据所有所述点数据和每一线段的首尾两个点,构建离散点集合。A set of discrete points is constructed according to all the point data and the first and last two points of each line segment.

优选地,所述根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点,包括:Preferably, the determining the vertices of the closed contour line according to the effective edges in the closed contour line includes:

当任一所述闭合轮廓线中有效边的个数大于3时,将所述闭合轮廓线确定为有效多边形;When the number of effective sides in any of the closed contour lines is greater than 3, the closed contour line is determined as a valid polygon;

对所述有效多边形中每两条相邻的有效边进行延长操作,得到有效边延长线;Performing an extension operation on every two adjacent valid sides in the valid polygon to obtain a valid side extension line;

将相邻两条所述有效边延长线的交点确定为所述闭合轮廓线的顶点。The intersection of two adjacent effective side extension lines is determined as the vertex of the closed contour line.

优选地,所述方法还包括:Preferably, the method also includes:

当任意两个所述房间多边形重叠时,删除两个所述房间多边形中与墙体或者门数据存在重合部分的多边形。When any two room polygons overlap, delete the polygons in the two room polygons that overlap with the wall or door data.

第二方面,本发明提供了一种基于建筑矢量图的房间数据生成装置,包括:In a second aspect, the present invention provides a device for generating room data based on architectural vector graphics, including:

数据获取模块,用于获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;A data acquisition module, configured to acquire architectural vector diagram data, and obtain wall linear data according to the architectural vector diagram data;

线集合生成模块,用于根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合;A line set generating module, configured to generate door data according to the wall line data, preset wall thickness parameters and door maximum length, and construct line data according to the door data and the wall line data gather;

顶点采样模块,用于将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合;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 set of discrete points;

轮廓生成模块,用于根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;A contour generation module, used to obtain multiple closed contours based on the rolling ball method according to the preset circle diameter and the set of discrete points;

顶点确定模块,用于根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;A vertex determination module, configured to determine a vertex of the closed contour line according to an effective side in the closed contour line; wherein, the effective side is a side whose side length is greater than the diameter of the circle in each closed contour line;

房间生成模块,用于根据所有所述顶点进行还原,得到房间多边形。The room generation module is used to perform restoration according to all the vertices to obtain the room polygon.

优选地,所述线集合生成模块包括:Preferably, the line set generation module includes:

线段生成单元,用于遍历所述墙体线状数据的所有边,将所述墙体线状数据的每个边转换为离散的两点线段,并存入线段组;A line segment generating unit, configured to traverse all sides of the wall linear data, convert each side of the wall linear data into discrete two-point line segments, and store them in the line segment group;

遍历搜索单元,用于遍历所述线段组,从所述线段组中选取一个预设厚度范围内的输入线段并以所述输入线段为中心进行搜索,得到与所述输入线段的距离在预设门宽度内的所有输出线段;The traversal search unit is used 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, and obtain a distance from the input line segment within a preset All output line segments within the gate width;

线集合生成单元,用于从所有所述输出线段中选取与所述输入线段满足平行重叠投影条件且距离小于所述门最大长度的目标线段,根据所述输入线段和所述目标线段生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合。A line set generating unit, configured to select a target line segment that satisfies the parallel overlapping projection condition with the input line segment and whose distance is smaller than the maximum length of the gate from all the output line segments, and generates gate data according to the input line segment and the target line segment , and construct a line data set according to the door data and the wall line data.

优选地,所述顶点采样模块包括:Preferably, 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 set of line segments according to a preset sampling density to obtain point data;

集合构建单元,根据所有所述点数据和每一线段的首尾两个点,构建离散点集合。The set construction unit constructs a set of discrete points according to all the point data and the first and last points of each line segment.

第三方面,本发明还提供了一种终端设备,包括处理器、存储器以及存储在所述存储器中且被配置为由所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现上述中任意一项所述的基于建筑矢量图的房间数据生成方法。In a third aspect, the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program Realize the room data generation method based on the building vector diagram described in any one of the above.

第四方面,本发明还提供了一种计算机可读存储介质,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行上述中任意一项所述的基于建筑矢量图的房间数据生成方法。In a fourth aspect, the present invention also provides a computer-readable storage medium, the computer-readable storage medium 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 The method for generating room data based on architectural vector graphics described in any one of the above.

相比于现有技术,本发明具有如下有益效果:Compared with the prior art, the present invention has the following beneficial effects:

本发明提供一种基于建筑矢量图的房间数据生成方法,通过获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,可以利用短边结合空间数据索引Rtree进行效率优化,生成门数据的多边形数组,结合原有墙体线状数据,构建包含门数据的线数据集合;将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合;根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;根据所有所述顶点进行还原,得到房间多边形。本发明利用alphaShape(滚球法)构建房间的闭合轮廓线,通过轮廓散点还原房间多边形,整个过程无需解析精准的门信息填补墙间隔,受到柱子、拐角的影响较小,更加符合实际需求。The present invention provides a method for generating room data based on architectural vector diagrams. By acquiring architectural vector diagram data, wall linear data is obtained according to the architectural vector diagram data; according to the wall linear data, the preset wall The body thickness parameter and the maximum length of the door can be optimized by using the short side combined with the spatial data index Rtree to generate a polygonal array of door data, combined with the original wall linear data, to construct a line data set containing door data; The data set is decomposed into discrete line segments, and point sampling is performed on the discrete line segments to obtain a set of discrete points; according to the preset circle diameter and the set of discrete points, multiple closed contour lines are obtained based on the rolling ball method; according to the closed contour The effective sides in the line determine the vertices of the closed contour line; wherein, the effective sides are the sides whose side length is greater than the diameter of the circle in each closed contour line; restore according to all the vertices to obtain the room polygon . The present invention uses alphaShape (rolling ball method) to construct the closed contour line of the room, and restores the room polygon through contour scattered points. The whole process does not need to analyze accurate door information to fill in the wall interval, and is less affected by columns and corners, which is more in line with actual needs.

附图说明Description of drawings

图1是本发明第一实施例提供的基于建筑矢量图的房间数据生成方法流程示意图;Fig. 1 is a schematic flowchart of a room data generation method based on a building vector diagram provided in the first embodiment of the present invention;

图2是平行重叠投影示意图;Fig. 2 is a schematic diagram of parallel overlapping projection;

图3是墙体线状数据的示意图;Fig. 3 is a schematic diagram of wall linear data;

图4是生成门数据后的线数据集合示意图;Fig. 4 is a schematic diagram of line data collection after gate data is generated;

图5是离散点集合的示意图;Fig. 5 is a schematic diagram of a set of discrete points;

图6是生成的闭合轮廓线及其边缘点数据的示意图;Fig. 6 is the schematic diagram of the generated closed contour line and its edge point data;

图7是房间多边形的整体示意图;Fig. 7 is an overall schematic diagram of a room polygon;

图8是本发明第二实施例提供的基于建筑矢量图的房间数据生成装置结构示意图。Fig. 8 is a schematic structural diagram of a device for generating room data based on a building vector diagram according to the second embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

参照图1,本发明第一实施例提供了一种基于建筑矢量图的房间数据生成方法,包括以下步骤:Referring to Fig. 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:

S11,获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;S11, obtaining architectural vector diagram data, and obtaining wall linear data according to the architectural vector diagram data;

S12,根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合;S12. Generate door data according to the wall linear data, preset wall thickness parameters and maximum door length, and construct a line data set according to the door data and the wall linear data;

S13,将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合;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;

S14,根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;S14. According to the preset circle diameter and the set of discrete points, multiple closed contour lines are obtained based on the rolling ball method;

S15,根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;S15. Determine the vertices of the closed contour line according to the effective sides in the closed contour line; wherein, the effective side is a side in each closed contour line whose side length is greater than the diameter of the circle;

S16,根据所有所述顶点进行还原,得到房间多边形。S16. Restore according to all the vertices to obtain the polygon of the room.

在步骤S11中,获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据。所述墙体线状数据包括墙体多边形或墙体多边形边线。In step S11, the architectural vector diagram data is obtained, and the wall line data is obtained according to the architectural vector diagram data. The linear data of the wall includes the polygon of the wall or the edge of the polygon of the wall.

需要说明的是,本发明通过墙体生成房间数据,在获取建筑矢量图数据(如CAD数据)之后,墙数据图层一般可以直接得到墙线数据,有些CAD也存在绘制完成的墙体多边形,此时需要解析这些多边形的边线数据。极少情况下,建筑矢量图缺失墙体数据,需要人工绘制墙体边线数据。It should be noted that the present invention generates room data through the wall. After obtaining the architectural vector diagram data (such as CAD data), the wall data layer can generally directly obtain the wall line data, and some CADs also have wall polygons that have been drawn. At this point, it is necessary to parse the edge data of these polygons. In rare cases, wall data is missing in the architectural vector diagram, and wall edge data needs to be manually drawn.

在步骤S12中,根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合,包括:In step S12, door data is generated according to the wall linear data, the preset wall thickness parameters and the maximum door length, and a line data set is constructed according to the door data and the wall linear data, include:

遍历所述墙体线状数据的所有边,将所述墙体线状数据的每个边转换为离散的两点线段,并存入线段组;Traversing all sides of the wall linear data, converting each side of the wall linear data into discrete two-point line segments, and storing them in line segment groups;

遍历所述线段组,从所述线段组中选取一个预设厚度范围内的输入线段并以所述输入线段为中心进行搜索,得到与所述输入线段的距离在预设门宽度内的所有输出线段;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, and obtain all outputs whose distance from the input line segment is within the preset gate width line segment;

从所有所述输出线段中选取与所述输入线段满足平行重叠投影条件且距离小于所述门最大长度的目标线段,根据所述输入线段和所述目标线段生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合。Select a target line segment that satisfies the parallel overlapping projection condition with the input line segment and is less than the maximum length of the gate from all the output line segments, generate gate data according to the input line segment and the target line segment, and generate gate data according to the gate data and the wall line data to construct a line data set.

在实际应用中,门最大长度参数为0.5到5米可以满足大部分CAD图的室内情况。根据不同场景,门最大长度参数为0米至20米。In practical applications, the maximum length of the door is 0.5 to 5 meters, which can meet the indoor conditions of most CAD drawings. According to different scenarios, the maximum length parameter of the door is 0 meters to 20 meters.

其中,所述平行重叠投影条件的判断过程包括:Wherein, the judging process of the parallel overlapping projection condition includes:

当线段A平行于线段B且线段A与线段B的间距在预设的墙体厚度参数以内,且线段A投影到线段B所在直线后得到的线段A’与线段B相交重叠时,判定线段A与线段B满足平行重叠投影条件。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 parameters, and line segment A' obtained after projecting line segment A to the line where line segment B is located intersects and overlaps line segment B, determine line segment A It satisfies the parallel overlapping projection condition with line segment B.

假设有两条线AB,如果它们符合下面条件则定义它们为平行重叠投影:Suppose there are two lines AB, they are defined as parallel overlapping projections if they meet the following conditions:

1)A平行于B;1) A is parallel to B;

2)A投影到B所在直线(两个顶点分别垂直投影)得到的A’与B相交重叠;2) When A is projected onto the straight line where B is located (the two vertices are projected vertically), A' and B are intersected and overlapped;

3)AB的间距在墙体厚度参数以内;3) The spacing of AB is within the wall thickness parameters;

如图2所示,假设ac平行dg平行hj,先不讨论厚度参数。ac与dg平行重叠投影因为ac在dg上的投影为df与dg相交。ac与eg平行重叠投影,因为ac在的在eg的所在直线dg上投影为df与eg相交。同理,ac与hj平行重叠投影。ab与fg不平行重叠投影,因为ab在eg的所在直线dg上投影为de与fg不相交。同理,ab与ij不平行重叠投影,ac与fg不平行重叠投影,因为ac在eg的所在直线dg上投影为df与fg相交但没有重叠部分。同理,ac与ij不平行重叠投影。As shown in Figure 2, assuming that ac is parallel to dg and hj is parallel, the thickness parameter will not be discussed first. The parallel overlapping projection of ac and dg is because the projection of ac on dg is the intersection of df and dg. The parallel overlapping projection of ac and eg is because the projection of ac on the straight line dg where eg is located is the intersection of df and eg. Similarly, ac and hj overlap projection in parallel. The overlapping projections of ab and fg are not parallel, because the projection of ab on the straight line dg where eg is located is that de and fg do not intersect. Similarly, ab and ij are non-parallel overlapping projections, and ac and fg are non-parallel overlapping projections, because the projection of ac on the straight line dg where eg is located is that df and fg intersect but do not overlap. Similarly, ac and ij are not parallel overlapping projections.

然后需要考虑到厚度参数,假设ac,dg间距离be为ε,hj,dg间距离eh为ε,假设预设的墙体厚度参数为1/2ε到3/2ε,则认为ac到hj距离2ε不符合厚度参数,则上述ac与hj不平行重叠投影。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 ε, assuming that the preset wall thickness parameter is 1/2ε to 3/2ε, it is considered that the distance from ac to hj is 2ε If the thickness parameter is not met, the above ac and hj are non-parallel overlapping projections.

在具体应用中,厚度范围参数为0.05到0.4米可以满足大部分CAD图的室内情况。根据不同场景,定义墙体厚度参数为0.01米至10米。In specific applications, the thickness range parameter of 0.05 to 0.4 meters can meet the indoor conditions of most CAD drawings. According to different scenarios, define the wall thickness parameter as 0.01m to 10m.

参照图3、图4,在步骤S12中生成了门数据,首先遍历所有墙体线状数据的边,找到所有小于墙体厚度的边,通过检索R-tree查看是否这条边能与一条附近平行重叠投影且距离小于门宽度的边生成墙。这里如果生成部分已经在墙体内部也没有影响,因为这一步主要作用就是封闭区间。在该过程中可以使用Rtree减少搜索量,降低时间成本。Referring to Fig. 3 and Fig. 4, the door data is generated in step S12, first traverse all the edges of the wall linear data, find all the edges smaller than the thickness of the wall, and check whether this edge can be connected with a nearby wall by searching the R-tree Edges with parallel overlapping projections and a distance less than the door width generate walls. Here, if the generated part is already inside the wall, it will not affect it, because the main function of this step is to close the interval. In this process, Rtree can be used to reduce the search volume and reduce the time cost.

在步骤S13中,将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合,包括:In step S13, decomposing the line data set into discrete line segments, and performing point sampling on the discrete line segments to obtain a set of discrete points, including:

将所述线数据集合拆分为由离散的两点组成的线段集;Splitting the line data set into a set of line segments consisting of two discrete points;

根据预设的采样密度在所述线段集中的每一线段上均匀采样,得到点数据;uniform sampling on each line segment in the line segment set according to a preset sampling density to obtain point data;

根据所有所述点数据和每一线段的首尾两个点,构建离散点集合。A set of discrete points is constructed according to all the point data and the first and last two points of each line segment.

其中,采样密度可以直接采用墙厚度。在具体实施中,先把多边形分解成离散的线,再将每条线用点采样,每个点之间固定宽度加上每个线段首尾两个点将所有点放在一个集合中,即可得到离散点集合,如图5所示。Among them, the sampling density can directly adopt the wall thickness. In the specific implementation, the polygon is first decomposed into discrete lines, and then each line is sampled with points, and the fixed width between each point plus two points at the beginning and end of each line segment puts all points in a set. A set of discrete points is obtained, as shown in Figure 5.

在步骤S14中,根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线。In step S14, a plurality of closed contour lines are obtained based on the rolling ball method according to the preset circle diameter and the set of discrete points.

需要说明的是,这一步目的是确定确定每个房间的大致形状,可以采用AlphaShape(滚球法)来还原轮廓。具体地,输入离散点集合,控制alpha参数的圆直径大于离散点之间的距离,可以直接采用半径为采样距离的alpha值,得到多个闭合曲线,然后通过该闭合曲线形成房间的多个闭合轮廓线。如图6所示,调用AlphaShape生成的多边形及其边缘点数据。由于AlphaShape无法还原具体角度的信息,所以该多边形四周的直角需要进一步还原。It should be noted that the purpose of this step is to determine the approximate shape of each room, and AlphaShape (rolling ball method) can be used to restore the outline. Specifically, input a set of discrete points, and the diameter of the circle controlling the alpha parameter is greater than the distance between the discrete points. You can directly use the alpha value whose radius is the sampling distance to obtain multiple closed curves, and then form multiple closures of the room through the closed curves contour line. As shown in Figure 6, call the polygon generated by AlphaShape and its edge point data. Since AlphaShape cannot restore specific angle information, the right angles around the polygon need to be further restored.

在步骤S15中,根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点,包括:In step S15, determining the vertices of the closed contour line according to the valid edges in the closed contour line includes:

当任一所述闭合轮廓线中有效边的个数大于3时,将所述闭合轮廓线确定为有效多边形;When the number of effective sides in any of the closed contour lines is greater than 3, the closed contour line is determined as a valid polygon;

对所述有效多边形中每两条相邻的有效边进行延长操作,得到有效边延长线;Performing an extension operation on every two adjacent valid sides in the valid polygon to obtain a valid side extension line;

将相邻两条所述有效边延长线的交点确定为所述闭合轮廓线的顶点。The intersection of two adjacent effective side extension lines is determined as the vertex of the closed contour line.

其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边。Wherein, the effective side is a side whose side length is greater than the diameter of the circle in each of the closed contour lines.

需要说明的是,在得到房间大致形状后,由于alphashape是由散点构成的,在同一条直线边上会出现大量散点而且会忽略拐角信息,需要先将大于alpha圆直径的边还原,将他们称为有效边。在有效边数大于3时,认为这是一个有效多边形。在每两条相邻有效边之间,需要找到一个他们延长线的点,这个延长线的交点就是多边形的顶点。求出所有顶点后,就可以还原这个房间多边形。It should be noted that after obtaining the approximate shape of the room, since the alphashape is composed of scattered points, there will be a large number of scattered points on the same straight line and the corner information will be ignored. It is necessary to restore the edges larger than the diameter of the alpha circle first. They are called active edges. When the number of valid sides is greater than 3, it is considered to be a valid polygon. Between every two adjacent effective sides, it is necessary to find a point of their extension line, and the intersection point of this extension line is the vertex of the polygon. After finding all the vertices, the room polygon can be restored.

进一步地,可以控制房间大小与边数控制房间的合法性。当发生特殊情况,例如两条相邻有效边平行或者交点非常远时,这时认为只两条边其实并不是实际房间的相邻边,做垂线来还原他们之间的另一条有效边。Further, the legality of the room can be controlled by controlling the size of the room and the number of sides. When a special situation occurs, such as two adjacent valid sides parallel or the intersection point is very far away, it is considered that only two sides are not actually adjacent sides of the actual room, and a vertical line is made to restore another valid side between them.

在步骤S16中,根据所有所述顶点进行还原,得到房间多边形。这一步骤可以实现多边形还原简化,最终生成的房间多边形如图7所示。In step S16, restore according to all the vertices to obtain the polygon of the room. This step can realize the simplification of polygon restoration, and the final polygon of the room is shown in Figure 7.

进一步地,当任意两个所述房间多边形重叠时,删除两个所述房间多边形中与墙体或者门数据存在重合部分的多边形。需要说明的是,因为希望得到的房间相互独立,不存在重叠情况,而AlphaShape可能得到重叠的数据结构,如地图的外轮廓一般也会生成房间区域。因此当房间多边形重叠时,需要对得到的房间数据做重叠检测,一般保留较小的多边形房间区域,将较大的房间作为局部或者整体的外轮廓。Further, when any two of the room polygons overlap, the polygons in the two room polygons that overlap with the wall or door data are deleted. It should be noted that because the desired rooms are independent of each other, there is no overlap, and AlphaShape may obtain overlapping data structures, such as the outer contour of the map, which generally also generates room areas. Therefore, when the room polygons overlap, it is necessary to perform overlap detection on the obtained room data. Generally, the smaller polygonal room area is reserved, and the larger room is used as a partial or overall outer contour.

本发明提供一种基于建筑矢量图的房间数据生成方法,通过获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,生成包含门数据的线数据集合,可以利用短边结合空间数据索引Rtree进行效率优化,构建包含门数据的线数据集合;将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合;根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;根据所有所述顶点进行还原,得到房间多边形。本发明利用alpha Shape(滚球法)构建房间的闭合轮廓线,构建包含门数据的线数据集合,并通过轮廓散点还原房间多边形,整个过程无需解析精准的门信息填补墙间隔,受到柱子、拐角的影响较小,更加符合实际需求。The present invention provides a method for generating room data based on architectural vector diagrams. By acquiring architectural vector diagram data, wall linear data is obtained according to the architectural vector diagram data; according to the wall linear data, the preset wall Thickness parameters of the body and the maximum length of the door to generate a line data set containing the door data, which can be optimized by using the short side combined with the spatial data index Rtree to construct a line data set containing the door data; the line data set is decomposed into discrete line segments, Carrying out point sampling on the discrete line segment to obtain a set of discrete points; according to the preset circle diameter and the set of discrete points, a plurality of closed contour lines are obtained based on the rolling ball method; The vertices of the closed contour lines; wherein, the effective side is the side in each closed contour line whose side length is greater than the diameter of the circle; restore according to all the vertices to obtain the room polygon. The present invention uses alpha Shape (rolling ball method) to construct the closed contour line of the room, constructs the line data set including the door data, and restores the room polygon through the contour scattered points. The whole process does not need to analyze the accurate door information to fill the wall interval, and is affected by the pillars, The influence of corners is less, which is more in line with actual needs.

参照图8,本发明第二实施例提供了一种一种基于建筑矢量图的房间数据生成装置,包括:Referring to FIG. 8, the second embodiment of the present invention provides a device for generating room data based on architectural vector graphics, including:

数据获取模块,用于获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;A data acquisition module, configured to acquire architectural vector diagram data, and obtain wall linear data according to the architectural vector diagram data;

线集合生成模块,用于根据所述墙体线状数据、预设的墙体厚度参数和门最大长度,生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合;A line set generating module, configured to generate door data according to the wall line data, preset wall thickness parameters and door maximum length, and construct line data according to the door data and the wall line data gather;

顶点采样模块,用于将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合;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 set of discrete points;

轮廓生成模块,用于根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;A contour generation module, used to obtain multiple closed contours based on the rolling ball method according to the preset circle diameter and the set of discrete points;

顶点确定模块,用于根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;A vertex determination module, configured to determine a vertex of the closed contour line according to an effective side in the closed contour line; wherein, the effective side is a side whose side length is greater than the diameter of the circle in each closed contour line;

房间生成模块,用于根据所有所述顶点进行还原,得到房间多边形。The room generation module is used to perform restoration according to all the vertices to obtain the room polygon.

优选地,所述线集合生成模块包括:Preferably, the line set generation module includes:

线段生成单元,用于遍历所述墙体线状数据的所有边,将所述墙体线状数据的每个边转换为离散的两点线段,并存入线段组;A line segment generating unit, configured to traverse all sides of the wall linear data, convert each side of the wall linear data into discrete two-point line segments, and store them in the line segment group;

遍历搜索单元,用于遍历所述线段组,从所述线段组中选取一个预设厚度范围内的输入线段并以所述输入线段为中心进行搜索,得到与所述输入线段的距离在预设门宽度内的所有输出线段;The traversal search unit is used 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, and obtain a distance from the input line segment within a preset All output line segments within the gate width;

线集合生成单元,用于从所有所述输出线段中选取与所述输入线段满足平行重叠投影条件且距离小于所述门最大长度的目标线段,根据所述输入线段和所述目标线段生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合。A line set generating unit, configured to select a target line segment that satisfies the parallel overlapping projection condition with the input line segment and whose distance is smaller than the maximum length of the gate from all the output line segments, and generates gate data according to the input line segment and the target line segment , and construct a line data set according to the door data and the wall line data.

优选地,所述顶点采样模块包括:Preferably, 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 set of line segments according to a preset sampling density to obtain point data;

集合构建单元,根据所有所述点数据和每一线段的首尾两个点,构建离散点集合。The set construction unit constructs a set of discrete points according to all the point data and the first and last points of each line segment.

优选地,所述顶点确定模块包括:Preferably, the vertex determination module includes:

多边形确定单元,用于当任一所述闭合轮廓线中有效边的个数大于3时,将所述闭合轮廓线确定为有效多边形;A polygon determination unit, configured to determine the closed contour as a valid polygon when the number of valid sides in any of the closed contours is greater than 3;

延长单元,用于对所述有效多边形中每两条相邻的有效边进行延长操作,得到有效边延长线;An extension unit, configured to perform an extension operation on every two adjacent valid sides in the valid polygon to obtain a valid side extension line;

顶点确定单元,用于将相邻两条所述有效边延长线的交点确定为所述闭合轮廓线的顶点。A vertex determining unit, configured to determine the intersection of two adjacent effective side extension lines as the vertex of the closed contour line.

优选地,所述装置还包括:Preferably, the device also includes:

重叠删除模块,用于当任意两个所述房间多边形重叠时,删除两个所述房间多边形中与墙体或者门数据存在重合部分的多边形。The overlap deletion module is configured to delete the polygons in the two room polygons that overlap with the wall or door data when any two of the room polygons overlap.

需要说明的是,本发明实施例提供的一种基于建筑矢量图的房间数据生成装置用于执行上述实施例的一种基于建筑矢量图的房间数据生成方法的所有流程步骤,两者的工作原理和有益效果一一对应,因而不再赘述。It should be noted that the device for generating room data based on architectural vector graphics provided by the embodiment of the present invention is used to execute all the process steps of the method for generating room data based on architectural vector graphics in the above embodiments, and the working principles of the two There is a one-to-one correspondence with the beneficial effects, so details are not repeated here.

本发明实施例还提供了一种终端设备。该终端设备包括:处理器、存储器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,例如基于建筑矢量图的房间数据生成程序。所述处理器执行所述计算机程序时实现上述各个基于建筑矢量图的房间数据生成方法实施例中的步骤,例如图1所示的步骤S11。或者,所述处理器执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如轮廓生成模块。The embodiment of the present invention also provides a terminal device. The terminal device includes: a processor, a memory, and a computer program stored in the memory and operable on the processor, for example, a program for generating room data based on a building vector diagram. When the processor executes the computer program, the steps in the above embodiments of the method for generating room data based on the architectural vector diagram are implemented, such as step S11 shown in FIG. 1 . Alternatively, when the processor executes the computer program, functions of each module/unit in the above-mentioned device embodiments, such as a profile generation module, are implemented.

示例性的,所述计算机程序可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器中,并由所述处理器执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序在所述终端设备中的执行过程。Exemplarily, the computer program may be divided into one or more modules/units, and the one or more modules/units are stored in the memory and executed by the processor to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

所述终端设备可以是桌上型计算机、笔记本、掌上电脑及智能平板等计算设备。所述终端设备可包括,但不仅限于,处理器、存储器。本领域技术人员可以理解,上述部件仅仅是终端设备的示例,并不构成对终端设备的限定,可以包括比上述更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。The terminal device may be computing devices such as desktop computers, notebooks, palmtop computers, and smart tablets. The terminal device may include, but not limited to, a processor and a memory. Those skilled in the art can understand that the above-mentioned components are only examples of terminal equipment, and do not constitute a limitation on terminal equipment, and may include more or less components than the above-mentioned components, or combine some components, or different components, such as the The above-mentioned terminal equipment may also include input and output equipment, network access equipment, bus and so on.

所称处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述终端设备的控制中心,利用各种接口和线路连接整个终端设备的各个部分。The so-called processor can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable gate array (Field-Programmable Gate Array, 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, and connects various parts of the entire terminal device with various interfaces and lines.

所述存储器可用于存储所述计算机程序和/或模块,所述处理器通过运行或执行存储在所述存储器内的计算机程序和/或模块,以及调用存储在存储器内的数据,实现所述终端设备的各种功能。所述存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory can be used to store the computer programs and/or modules, and the processor implements the terminal by running or executing the computer programs and/or modules stored in the memory and calling the data stored in the memory various functions of the device. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.) and the like; the storage data area may store Data created based on the use of the mobile phone (such as audio data, phonebook, etc.), etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, internal memory, plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card , a flash memory card (Flash Card), at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

其中,所述终端设备集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。Wherein, if the modules/units integrated in the terminal equipment are realized in the form of software function units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the present invention realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer When the program is executed by the processor, the steps in the above-mentioned various method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer-readable media Excludes electrical carrier signals and telecommunication signals.

需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本发明提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It should be noted that the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physically separated. A unit can be located in one place, or it can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. It can be understood and implemented by those skilled in the art without creative effort.

以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步的详细说明,应当理解,以上所述仅为本发明的具体实施例而已,并不用于限定本发明的保护范围。特别指出,对于本领域技术人员来说,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the protection scope of the present invention. . In particular, for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (10)

1.一种基于建筑矢量图的房间数据生成方法,其特征在于,包括:1. A method for generating room data based on building vector diagrams, comprising: 获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;Obtaining architectural vector diagram data, and obtaining wall linear data according to the architectural vector diagram data; 根据所述墙体线状数据、预设的墙体厚度参数和门最大长度生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合;Generate door data according to the wall linear data, preset wall thickness parameters and door maximum 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, performing point sampling on the discrete line segments to obtain a discrete point set; 根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;According to the preset circle diameter and the set of discrete points, multiple closed contour lines are obtained based on the rolling ball method; 根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;Determining the vertices of the closed contour line according to the effective sides in the closed contour line; wherein, the effective side is a side whose side length is greater than the diameter of the circle in each of the closed contour lines; 根据所有所述顶点进行还原,得到房间多边形。Reduction is performed based on all said vertices to obtain the room polygon. 2.根据权利要求1所述的基于建筑矢量图的房间数据生成方法,其特征在于,所述根据所述墙体线状数据、预设的墙体厚度参数和门最大长度生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合,包括:2. The method for generating room data based on architectural vector diagrams according to claim 1, wherein said door data is generated according to said wall linear data, preset wall thickness parameters and door maximum length, and According to the door data and the wall line data, construct a line data set, including: 遍历所述墙体线状数据的所有边,将所述墙体线状数据的每个边转换为离散的两点线段,并存入线段组;Traversing all sides of the wall linear data, converting each side of the wall linear data into discrete two-point line segments, and storing them in line segment groups; 遍历所述线段组,从所述线段组中选取一个预设厚度范围内的输入线段并以所述输入线段为中心进行搜索,得到与所述输入线段的距离在预设门宽度内的所有输出线段;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, and obtain all outputs whose distance from the input line segment is within the preset gate width line segment; 从所有所述输出线段中选取与所述输入线段满足平行重叠投影条件且距离小于所述门最大长度的目标线段,根据所述输入线段和所述目标线段生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合。Select a target line segment that satisfies the parallel overlapping projection condition with the input line segment and is less than the maximum length of the gate from all the output line segments, generate gate data according to the input line segment and the target line segment, and generate gate data according to the gate data and the wall line data to construct a line data set. 3.根据权利要求1所述的基于建筑矢量图的房间数据生成方法,其特征在于,所述将所述线数据集合分解为离散线段,对所述离散线段进行点采样,得到离散点集合,包括:3. The method for generating room data based on architectural vector diagrams according to claim 1, wherein said line data sets are decomposed into discrete line segments, and point sampling is carried out to said discrete line segments to obtain discrete point sets, include: 将所述线数据集合拆分为由离散的两点组成的线段集;Splitting the line data set into a set of line segments consisting of two discrete points; 根据预设的采样密度在所述线段集中的每一线段上均匀采样,得到点数据;uniform sampling on each line segment in the line segment set according to a preset sampling density to obtain point data; 根据所有所述点数据和每一线段的首尾两个点,构建离散点集合。A set of discrete points is constructed according to all the point data and the first and last two points of each line segment. 4.根据权利要求1所述的基于建筑矢量图的房间数据生成方法,其特征在于,所述根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点,包括:4. The method for generating room data based on building vector diagrams according to claim 1, wherein said determining the vertex of said closed contour line according to the effective sides in said closed contour line comprises: 当任一所述闭合轮廓线中有效边的个数大于3时,将所述闭合轮廓线确定为有效多边形;When the number of effective sides in any of the closed contour lines is greater than 3, the closed contour line is determined as a valid polygon; 对所述有效多边形中每两条相邻的有效边进行延长操作,得到有效边延长线;Performing an extension operation on every two adjacent valid sides in the valid polygon to obtain a valid side extension line; 将相邻两条所述有效边延长线的交点确定为所述闭合轮廓线的顶点。The intersection of two adjacent effective side extension lines is determined as the vertex of the closed contour line. 5.根据权利要求1所述的基于建筑矢量图的房间数据生成方法,其特征在于,所述方法还包括:5. The method for generating room data based on building vector diagrams according to claim 1, wherein the method further comprises: 当任意两个所述房间多边形重叠时,删除两个所述房间多边形中与墙体或者门数据存在重合部分的多边形。When any two room polygons overlap, delete the polygons in the two room polygons that overlap with the wall or door data. 6.一种基于建筑矢量图的房间数据生成装置,其特征在于,包括:6. A device for generating room data based on architectural vector graphics, comprising: 数据获取模块,用于获取建筑矢量图数据,并根据所述建筑矢量图数据得到墙体线状数据;A data acquisition module, configured to acquire architectural vector diagram data, and obtain wall linear data according to the architectural vector diagram data; 线集合生成模块,用于根据所述墙体线状数据、预设的墙体厚度参数和门最大长度生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合;A line set generation module, configured to generate door data according to the wall line data, preset wall thickness parameters and door maximum length, and construct a line data set according to the door data and the wall line 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 set of discrete points; 轮廓生成模块,用于根据预设的圆直径和所述离散点集合,基于滚球法得到多个闭合轮廓线;A contour generation module, used to obtain multiple closed contours based on the rolling ball method according to the preset circle diameter and the set of discrete points; 顶点确定模块,用于根据所述闭合轮廓线中的有效边确定所述闭合轮廓线的顶点;其中,所述有效边为每一所述闭合轮廓线中边长大于所述圆直径的边;A vertex determination module, configured to determine a vertex of the closed contour line according to an effective side in the closed contour line; wherein, the effective side is a side whose side length is greater than the diameter of the circle in each closed contour line; 房间生成模块,用于根据所有所述顶点进行还原,得到房间多边形。The room generation module is used to perform restoration according to all the vertices to obtain the room polygon. 7.根据权利要求6所述的基于建筑矢量图的房间数据生成装置,其特征在于,所述线集合生成模块包括:7. The device for generating room data based on architectural vector diagrams according to claim 6, wherein the line set generating module comprises: 线段生成单元,用于遍历所述墙体线状数据的所有边,将所述墙体线状数据的每个边转换为离散的两点线段,并存入线段组;A line segment generating unit, configured to traverse all sides of the wall linear data, convert each side of the wall linear data into discrete two-point line segments, and store them in the line segment group; 遍历搜索单元,用于遍历所述线段组,从所述线段组中选取一个预设厚度范围内的输入线段并以所述输入线段为中心进行搜索,得到与所述输入线段的距离在预设门宽度内的所有输出线段;The traversal search unit is used 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, and obtain a distance from the input line segment within a preset All output line segments within the gate width; 线集合生成单元,用于从所有所述输出线段中选取与所述输入线段满足平行重叠投影条件且距离小于所述门最大长度的目标线段,根据所述输入线段和所述目标线段生成门数据,并根据所述门数据和所述墙体线状数据,构建线数据集合。A line set generating unit, configured to select a target line segment that satisfies the parallel overlapping projection condition with the input line segment and whose distance is smaller than the maximum length of the gate from all the output line segments, and generates gate data according to the input line segment and the target line segment , and construct a line data set according to the door data and the wall line data. 8.根据权利要求6所述的基于建筑矢量图的房间数据生成装置,其特征在于,所述顶点采样模块包括:8. The device for generating room data based on building vector diagrams according to claim 6, wherein 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 set of line segments according to a preset sampling density to obtain point data; 集合构建单元,根据所有所述点数据和每一线段的首尾两个点,构建离散点集合。The set construction unit constructs a set of discrete points according to all the point data and the first and last points of each line segment. 9.一种终端设备,其特征在于,包括处理器、存储器以及存储在所述存储器中且被配置为由所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至5中任意一项所述的基于建筑矢量图的房间数据生成方法。9. A terminal device, characterized in that it includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program, it realizes the The method for generating room data based on architectural vector graphics described in any one of 1 to 5 is required. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行如权利要求1至5中任意一项所述的基于建筑矢量图的房间数据生成方法。10. A computer-readable storage medium, characterized in that the computer-readable storage medium 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 The method for generating room data based on architectural vector graphics described in any one of 1 to 5.
CN202211178786.7A 2022-09-27 2022-09-27 Room data generation method, device, equipment and medium based on building vector diagram Pending CN115482310A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211178786.7A CN115482310A (en) 2022-09-27 2022-09-27 Room data generation method, device, equipment and medium based on building vector diagram

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211178786.7A CN115482310A (en) 2022-09-27 2022-09-27 Room data generation method, device, equipment and medium based on building vector diagram

Publications (1)

Publication Number Publication Date
CN115482310A true CN115482310A (en) 2022-12-16

Family

ID=84394169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211178786.7A Pending CN115482310A (en) 2022-09-27 2022-09-27 Room data generation method, device, equipment and medium based on building vector diagram

Country Status (1)

Country Link
CN (1) CN115482310A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110210377A (en) * 2019-05-30 2019-09-06 南京维狸家智能科技有限公司 A kind of wall and door and window information acquisition method rebuild for three-dimensional house type
CN110532602A (en) * 2019-07-19 2019-12-03 中国地质大学(武汉) A kind of indoor autodraft and modeling method based on plan view image
US20200364929A1 (en) * 2019-05-13 2020-11-19 Wuhan University Multi-story indoor structured three-dimensional modeling method and system
CN111985291A (en) * 2020-02-19 2020-11-24 广东三维家信息科技有限公司 A method, device and electronic device for door identification in a floor plan
CN112712584A (en) * 2019-10-25 2021-04-27 阿里巴巴集团控股有限公司 Wall line determining method, space modeling method, device and equipment
CN114092953A (en) * 2021-11-29 2022-02-25 土巴兔集团股份有限公司 Method, device, medium and electronic equipment for identifying wall based on CAD (computer-aided design) outer contour

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200364929A1 (en) * 2019-05-13 2020-11-19 Wuhan University Multi-story indoor structured three-dimensional modeling method and system
CN110210377A (en) * 2019-05-30 2019-09-06 南京维狸家智能科技有限公司 A kind of wall and door and window information acquisition method rebuild for three-dimensional house type
CN110532602A (en) * 2019-07-19 2019-12-03 中国地质大学(武汉) A kind of indoor autodraft and modeling method based on plan view image
CN112712584A (en) * 2019-10-25 2021-04-27 阿里巴巴集团控股有限公司 Wall line determining method, space modeling method, device and equipment
CN111985291A (en) * 2020-02-19 2020-11-24 广东三维家信息科技有限公司 A method, device and electronic device for door identification in a floor plan
CN114092953A (en) * 2021-11-29 2022-02-25 土巴兔集团股份有限公司 Method, device, medium and electronic equipment for identifying wall based on CAD (computer-aided design) outer contour

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张宏鑫 等: "复杂建筑平面图纸的空间布局融合对偶识别方法", 《武汉大学学报》, 2 September 2021 (2021-09-02), pages 1 - 6 *
张宏鑫;李姝;宋超;: "室内平面图分块矢量化与高效三维建筑建模", 计算机科学与探索, no. 01, 15 January 2013 (2013-01-15), pages 1 - 5 *

Similar Documents

Publication Publication Date Title
US11288413B2 (en) Method for automatic modeling of an architecture based on an architectural drawing
CN113591197B (en) Online editing method and device, electronic equipment and storage medium
CN112669463B (en) Method for reconstructing curved surface of three-dimensional point cloud, computer device and computer-readable storage medium
CN114116065B (en) Method and device for acquiring topological graph data object and electronic equipment
CN106951432A (en) BIM data light weight method and device
CN109543209B (en) Management method and device for component database
CN115481268A (en) Parallel line wall data identification method, device, equipment and storage medium
US20240078255A1 (en) Method and apparatus for determining spatial two-tuple, computer device, and storage medium
CN113190894A (en) Reinforcing steel bar sample copying data processing method and device, terminal equipment and medium
CN113496543A (en) Point cloud data screening method and device, electronic equipment and storage medium
CN113435502B (en) Site flow determination method, device, equipment and storage medium
CN115169679A (en) Method, device and equipment for automatic planning of building indoor point cloud data collection site
Hellmuth et al. Datasets of captured images of three different devices for photogrammetry calculation comparison and integration into a laserscan point cloud of a built environment
WO2021115322A1 (en) Three-dimensional layout method, apparatus, and device for physical protection system of nuclear power plant
CN111311305A (en) Method and system for analyzing user public traffic band based on user track
CN115482310A (en) Room data generation method, device, equipment and medium based on building vector diagram
WO2025123627A1 (en) Building model management method and system, and electronic device
CN116503262A (en) Vectorization processing method and device for house type diagram and electronic equipment
EP4174781A2 (en) Method and apparatus for processing three dimensional graphic data, device, storage medium and product
CN114241094B (en) Animation drawing method, device, storage medium and electronic device
CN113126866B (en) Object determination method, device, electronic equipment and storage medium
CN115591246A (en) Atlas optimization method, device and computer storage medium
CN117994411A (en) Virtual building processing method, device, equipment and computer readable storage medium
CN112996009A (en) Wireless device deployment method and device, electronic device and storage medium
CN113790730B (en) Mobile robot navigation map conversion method and system based on DXF format

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination