CN117609524A - Visual analysis method, device and equipment based on three-dimensional R-tree spatial index - Google Patents

Visual analysis method, device and equipment based on three-dimensional R-tree spatial index Download PDF

Info

Publication number
CN117609524A
CN117609524A CN202311630698.0A CN202311630698A CN117609524A CN 117609524 A CN117609524 A CN 117609524A CN 202311630698 A CN202311630698 A CN 202311630698A CN 117609524 A CN117609524 A CN 117609524A
Authority
CN
China
Prior art keywords
node
triangular
index
space
tree
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
CN202311630698.0A
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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202311630698.0A priority Critical patent/CN117609524A/en
Publication of CN117609524A publication Critical patent/CN117609524A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/54Browsing; Visualisation therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本申请涉及一种基于三维R树空间索引的通视分析方法、装置和设备。通过为数据集中的每一个三角面片建立细粒度3D‑R树空间索引,再将视点和目标点连接的视线与空间索引进行空间交查询操作,判断该目标点相对于视点的可见性。本发明通过对原始数据的三角面片建立索引库,舍去传统方法的插值过程,降低计算代价和计算复杂度,能够实现海量三角面片数据的快速通视分析,此外,还可以支持更多的查询功能,为后续的进一步分析做好初步准备工作。

The present application relates to a visual analysis method, device and equipment based on three-dimensional R-tree spatial index. By establishing a fine-grained 3D-R tree spatial index for each triangular patch in the data set, and then performing a spatial intersection query between the line of sight and the spatial index connecting the viewpoint and the target point, the visibility of the target point relative to the viewpoint is determined. This invention establishes an index database for the triangular patches of the original data, discards the interpolation process of the traditional method, reduces the calculation cost and computational complexity, and can realize rapid visual analysis of massive triangular patch data. In addition, it can also support more The query function can make preliminary preparations for further analysis.

Description

基于三维R树空间索引的通视分析方法、装置和设备Visual analysis method, device and equipment based on three-dimensional R-tree spatial index

技术领域Technical field

本申请涉及可视性分析技术领域,特别是涉及一种基于三维R树空间索引的通视分析方法、装置和设备。The present application relates to the technical field of visibility analysis, and in particular to a visibility analysis method, device and equipment based on a three-dimensional R-tree spatial index.

背景技术Background technique

可视性分析是空间分析中的重要环节。在二维平面分析中,包括点对点的通视性分析以及基于视点的可视域分析。通视性主要研究对象是观察点与被观察点这两点的可视性,即从一点是否能观察到另一点,也称为点可视;可视域是主要研究在观察点给定的视线范围内所能观察到的可视点的点集,也称为面可视。空间可视点集(isovist)与视景锥模型是基于三维空间模型的分析,特别是在城市研究中,涉及运算的模型数据量大多以亿计算,十分庞大。在进行精细的运算之前,快速有效的二维空间分析已经帮助研究做了初筛的工作,使得在三维视觉分析中,参与运算的视点都是在视域分析中表现较好的、比较有潜力的。Visibility analysis is an important part of spatial analysis. Two-dimensional plane analysis includes point-to-point visibility analysis and viewpoint-based visual domain analysis. The main research object of visibility is the visibility of the observation point and the observed point, that is, whether one point can be observed from another point, also known as point visibility; the visual field is mainly studied at the given point of observation. The point set of visible points that can be observed within the line of sight is also called surface visibility. The spatial visible point set (isovist) and visual cone model are based on the analysis of three-dimensional spatial models. Especially in urban research, the amount of model data involved in calculations is mostly calculated in the hundreds of millions, which is very huge. Before detailed calculations are carried out, fast and effective two-dimensional spatial analysis has helped the research to do the preliminary screening work, so that in the three-dimensional visual analysis, the viewpoints involved in the calculation are those that perform better in the field of view analysis and have greater potential. of.

可视性分析是由人眼观察事物这一基本事实延伸而来,它可以直接解决实际生活中的可视问题,应用潜力和价值巨大:目前在景观分析、建筑规划、天文等领域都己有很深的应用。在景观分析或景区路径规划中,有景点、参观路线、基础设施规划等应用;而建筑物的建设、规划同样离不开可视性分析,它关系到了整个城市的视觉效果;在电力行业,通信电力塔的选址以及优化需要可视域分析为其进行指导布局;在天文学中,观测行星天体需要有一个良好的地面观测站,其最重要的条件便是可视域效果最好;在很多游戏中,需要考虑到人物角色处于不同位置所看到区域的不同,因此在游戏的设计开发中,可视性分析也是必须要考虑的问题。Visibility analysis is extended from the basic fact that human eyes observe things. It can directly solve visual problems in real life. It has huge application potential and value: it is currently used in landscape analysis, architectural planning, astronomy and other fields. Very deep application. In landscape analysis or scenic route planning, there are applications such as scenic spots, visiting routes, and infrastructure planning; and the construction and planning of buildings are also inseparable from visibility analysis, which is related to the visual effect of the entire city; in the power industry, The site selection and optimization of communication power towers require visual field analysis to guide the layout; in astronomy, observing planetary objects requires a good ground observation station, and the most important condition is that the visual field effect is the best; in astronomy, observing planetary objects requires a good ground observation station. In many games, it is necessary to take into account the different areas seen by characters in different positions. Therefore, visibility analysis is also an issue that must be considered in the design and development of games.

随着三维场景复杂性增加,运用规则格网描述地面起伏或简单的城市模型已经不能满足应用需求,而是通过利用倾斜摄影三维模型对各种复杂地物包括楼房、树木、路灯、广告牌等进行更精确逼真的空间表达。倾斜摄影三维建模(简称倾斜三维)技术是近年来在遥感测绘领域兴起的一项重要的重组建模技术,相较于传统的人工三维建模方法,倾斜三维重建具有准确度高、成果模型精美、人为干预程度低、制作周期短、还原度高等优点。由于倾斜三维模型还原的细节多、精度高,往往这类三维模型都会具有海量的三角面片数以及超高的贴图质量,数据量巨大,加大了实时空间分析和可视化的难度。且在三维空间对象组织模型中,这些海量的三角面片模型大多用于GPU可视化渲染,在空间分析中,相应的可视性分析也大多基于GPU渲染,因此所支持的空间分析能力较弱,难以对数据进行深层次的挖掘分析。As the complexity of 3D scenes increases, the use of regular grids to describe ground undulations or simple city models can no longer meet application needs. Instead, oblique photography 3D models are used to describe various complex features including buildings, trees, street lights, billboards, etc. Perform more accurate and realistic spatial expressions. Oblique photography 3D modeling (referred to as oblique 3D) technology is an important restructured modeling technology that has emerged in the field of remote sensing mapping in recent years. Compared with traditional artificial 3D modeling methods, oblique 3D reconstruction has the characteristics of high accuracy and good results. It has the advantages of exquisiteness, low degree of human intervention, short production cycle, and high degree of restoration. Due to the large number of details and high precision restored by tilted 3D models, such 3D models often have a large number of triangle patches and ultra-high texture quality. The amount of data is huge, which increases the difficulty of real-time spatial analysis and visualization. And in the three-dimensional spatial object organization model, these massive triangular patch models are mostly used for GPU visual rendering. In spatial analysis, the corresponding visibility analysis is mostly based on GPU rendering, so the supported spatial analysis capabilities are weak. It is difficult to conduct in-depth mining and analysis of data.

发明内容Contents of the invention

基于此,有必要针对上述技术问题,提供一种基于三维R树空间索引的通视分析方法、装置和设备,以便实现对海量的三角面片数据的快速可视分析。Based on this, it is necessary to address the above technical problems and provide a visual analysis method, device and equipment based on three-dimensional R-tree spatial index, so as to achieve rapid visual analysis of massive triangular patch data.

一种基于三维R树空间索引的通视分析方法,所述方法包括:A perspective analysis method based on three-dimensional R-tree spatial index, the method includes:

获取三维对象的空间三角面片模型;在空间三角面片模型中包含若干个空间三角面片;Obtain the space triangle patch model of the three-dimensional object; the space triangle patch model contains several space triangle patches;

以每一个空间三角面片为索引节点,构建空间三角面片模型的三维R树空间索引;Using each space triangle patch as an index node, construct a three-dimensional R-tree spatial index of the space triangle patch model;

对当前视点与目标点连线得到视线,对视线和三维R树空间索引进行空间交查询;Obtain the line of sight by connecting the current viewpoint and the target point, and perform a spatial intersection query on the line of sight and the three-dimensional R-tree spatial index;

根据空间交查询的结果得到目标点的可视性。The visibility of the target point is obtained based on the results of the spatial intersection query.

一种基于三维R树空间索引的通视分析装置,所述装置包括:A visual analysis device based on three-dimensional R-tree spatial index, the device includes:

空间三角面片模型获取模块,用于获取三维对象的空间三角面片模型;在空间三角面片模型中包含若干个空间三角面片;The space triangle patch model acquisition module is used to obtain the space triangle patch model of a three-dimensional object; the space triangle patch model contains several space triangle patches;

三维R树空间索引构建模块,用于以每一个空间三角面片为索引节点,构建空间三角面片模型的三维R树空间索引;The three-dimensional R-tree spatial index building module is used to construct a three-dimensional R-tree spatial index of the spatial triangle patch model using each spatial triangle patch as an index node;

空间交查询模块,用于对当前视点与目标点连线得到视线,对视线和三维R树空间索引进行空间交查询;The spatial intersection query module is used to obtain the line of sight from the current viewpoint and the target point, and performs spatial intersection query on the line of sight and the three-dimensional R-tree spatial index;

目标点可视性分析模块,用于根据空间交查询的结果得到目标点的可视性。The target point visibility analysis module is used to obtain the visibility of the target point based on the results of the spatial intersection query.

一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:A computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the following steps:

获取三维对象的空间三角面片模型;在空间三角面片模型中包含若干个空间三角面片;Obtain the space triangle patch model of the three-dimensional object; the space triangle patch model contains several space triangle patches;

以每一个空间三角面片为索引节点,构建空间三角面片模型的三维R树空间索引;Using each space triangle patch as an index node, construct a three-dimensional R-tree spatial index of the space triangle patch model;

对当前视点与目标点连线得到视线,对视线和三维R树空间索引进行空间交查询;Obtain the line of sight by connecting the current viewpoint and the target point, and perform a spatial intersection query on the line of sight and the three-dimensional R-tree spatial index;

根据空间交查询的结果得到目标点的可视性。The visibility of the target point is obtained based on the results of the spatial intersection query.

上述基于三维R树空间索引的通视分析方法、装置和设备,通过为数据集中的每一个三角面片建立细粒度3D-R树空间索引,再将视点和目标点连接的视线与空间索引进行空间交查询操作,判断该目标点相对于视点的可见性。较于现有技术中的通视算法和GPU管道渲染等方法,本方法通过对原始数据的三角面片建立索引库,舍去传统方法的插值过程,降低计算代价和计算复杂度,还可以支持更多的查询功能,为后续的进一步分析做好初步准备工作。The above-mentioned visual analysis method, device and equipment based on three-dimensional R-tree spatial index establishes a fine-grained 3D-R tree spatial index for each triangular patch in the data set, and then performs the line of sight and spatial index connecting the viewpoint and the target point. Spatial intersection query operation determines the visibility of the target point relative to the viewpoint. Compared with methods such as the view-through algorithm and GPU pipeline rendering in the existing technology, this method establishes an index library for the triangular patches of the original data, discards the interpolation process of the traditional method, reduces the calculation cost and complexity, and can also support More query functions make preliminary preparations for further analysis.

附图说明Description of drawings

图1为一个实施例中基于三维R树空间索引的通视分析方法的流程示意图;Figure 1 is a schematic flow chart of a perspective analysis method based on a three-dimensional R-tree spatial index in one embodiment;

图2为建筑物模型的三角面片的示意图;Figure 2 is a schematic diagram of the triangular patch of the building model;

图3为面向空间三角面片的细粒度空间索引的示意图;Figure 3 is a schematic diagram of fine-grained spatial indexing for spatial triangle patches;

图4为基于细粒度3D-R树空间索引的快速通视性分析方法设计流程示意图;Figure 4 is a schematic diagram of the design process of a fast visibility analysis method based on fine-grained 3D-R tree spatial index;

图5为面向抛物线的通视分析示意图;Figure 5 is a schematic diagram of the parabolic analysis;

图6为基于3D-R树和AABB的空间三角面片索引示意图,其中,图6(a)为3D-R树空间索引结构,图6(b)为3D-R树;Figure 6 is a schematic diagram of the spatial triangle patch index based on 3D-R tree and AABB. Figure 6(a) is the 3D-R tree spatial index structure, and Figure 6(b) is the 3D-R tree;

图7为插入节点后分裂了的3D-R树结构的示意图;Figure 7 is a schematic diagram of the 3D-R tree structure that is split after inserting nodes;

图8为视线与三角面片的空间交查询问题示意图;Figure 8 is a schematic diagram of the spatial intersection query problem between the line of sight and the triangular patch;

图9为通视分析的整体流程示意图;Figure 9 is a schematic diagram of the overall process of visual analysis;

图10为视线线段与轴向包围盒的相交示意图;Figure 10 is a schematic diagram of the intersection between the line of sight line segment and the axial bounding box;

图11为基于3D-R树索引的通视分析性能示意图;Figure 11 is a schematic diagram of the performance of view analysis based on 3D-R tree index;

图12为基于3D-R树索引的通视分析的时间复杂度示意图;Figure 12 is a schematic diagram of the time complexity of view analysis based on 3D-R tree index;

图13为一个实施例中计算机设备的内部结构图。Figure 13 is an internal structure diagram of a computer device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.

在一个实施例中,如图1所示,提供了一种基于三维R树空间索引的通视分析方法,包括以下步骤:In one embodiment, as shown in Figure 1, a perspective analysis method based on a three-dimensional R-tree spatial index is provided, including the following steps:

步骤102,获取三维对象的空间三角面片模型。Step 102: Obtain the spatial triangle patch model of the three-dimensional object.

在空间三角面片模型中包含若干个空间三角面片。The space triangle patch model contains several space triangle patches.

通常三角面片直接存储坐标点,由三维空间坐标点构成三角面,由三角面片包围形成三维空间对象。三角面片在表达现实世界中的物体时,有如下优点:Usually, triangular patches directly store coordinate points, and triangular faces are formed from three-dimensional space coordinate points, which are surrounded by triangular patches to form three-dimensional space objects. Triangular patches have the following advantages when expressing objects in the real world:

(1)数据结构简单、显示速度和光照计算快,并且非常适合并行处理。(1) The data structure is simple, the display speed and lighting calculation are fast, and it is very suitable for parallel processing.

(2)利用三维扫描技术可以获取大量三角网格。(2) A large number of triangular meshes can be obtained using three-dimensional scanning technology.

(3)当面片的数量足够多时,可以以任意的精度无限逼近复杂的曲面。(3) When the number of patches is large enough, complex surfaces can be infinitely approximated with arbitrary accuracy.

如图2所示,提供建筑物模型的三角面片的示意图。As shown in Figure 2, a schematic diagram of the triangular patch of the building model is provided.

三角面片数据的结构则分为顶点和面两部分信息,广泛采用obj文件格式存储,具体如下:The structure of triangular patch data is divided into two parts: vertex and face information, which are widely stored in the obj file format, as follows:

(1)顶点的几何信息:若三角面片模型包含n个顶点,即V={v1,v2,...,vn},obj文件中由v代表顶点,v开头的行,之后用三个数字来对应该顶点的(x,y,z)坐标。顶点的编号从小到大依次排列。(1) Geometric information of vertices: If the triangular patch model contains n vertices, that is, V = {v 1 , v 2 ,..., v n }, v represents the vertex in the obj file, and the lines starting with v are followed by Use three numbers to correspond to the (x, y, z) coordinates of the vertex. The vertex numbers are arranged from small to large.

(2)通过三角形的边和三角形面来表示三角网格之间的拓扑连接关系。每两个顶点表示一条三角形的边,如(v1,v2)。逆时针方向每三个顶点表示对应的面,如(v1,v2,v3)。由于三角形的边可以从三角形的面中找到,所以三角面片模型只需要包含三角面片的信息即可。若三角面片模型包含m个面,则F={f1,f2,...,fm}。在三角面片模型文件中由f代表三角面片,每行以f作为起始标志,在f之后是三个整数,对应于该三角面片的三个顶点编号,以逆时针顺序排列。(2) Represent the topological connection relationship between triangular meshes through triangle sides and triangular faces. Every two vertices represent the sides of a triangle, such as (v 1 , v 2 ). Every three vertices in the counterclockwise direction represent the corresponding surface, such as (v 1 , v 2 , v 3 ). Since the sides of a triangle can be found from the faces of the triangle, the triangle patch model only needs to contain information about the triangle patches. If the triangular patch model contains m faces, then F={f 1 , f 2 ,..., f m }. In the triangle patch model file, f represents the triangle patch. Each line uses f as the starting mark. After f are three integers, corresponding to the three vertex numbers of the triangle patch, arranged in counterclockwise order.

步骤104,以每一个空间三角面片为索引节点,构建空间三角面片模型的三维R树空间索引。Step 104: Use each space triangle patch as an index node to construct a three-dimensional R-tree spatial index of the space triangle patch model.

对大规模地理矢量要素进行数据划分和构建空间索引,常用的方法包括对象分割法和规则分割法两种,其中,对象分割法是采用层次包围体实现,常用的包围体有:包围球(Spheres)、轴向包围盒(Axis-aligned Bounding Box,ABB)、方向包围盒(OrientedBounding Box,OBB)、离散方向多面体(Discrete Orientation Polytopes,DOP)及凸体(Convex Hull)等5类。对象分割算法要进行包围体的计算、分割、相交等判断,随着包围体的紧凑性增大,相应的计算复杂度也越来越高。而规则分割算法包括规则格网、四叉树/八叉树、KD树、BSP树及R树等。传统方法直接对整个地理矢量要素进行分割,造成局部细节信息丢失,并不适用于精确的通视性分析。For data division and spatial index construction of large-scale geographical vector elements, commonly used methods include object segmentation and rule segmentation. Among them, the object segmentation method is implemented by using hierarchical bounding bodies. Commonly used bounding bodies include: bounding spheres (Spheres). ), Axis-aligned Bounding Box (ABB), Oriented Bounding Box (OBB), Discrete Orientation Polytopes (DOP) and Convex Hull. The object segmentation algorithm requires calculation, segmentation, intersection and other judgments of the bounding body. As the compactness of the bounding body increases, the corresponding computational complexity becomes higher and higher. The rule segmentation algorithms include regular grids, quadtrees/octrees, KD trees, BSP trees and R-trees, etc. Traditional methods directly segment the entire geographical vector elements, resulting in the loss of local detailed information, and are not suitable for accurate visibility analysis.

三角面片模型的面片数量巨大,在对上亿个三角面片进行通视计算时,求交运算所花费的时间相当之多,效率低下。故本方法提出将普遍应用在二维的R树拓展到三维空间,建立3D-R树的空间据结构,基于此数据结构进行三角面片的通视计算。该算法在继承R树良好的空间搜索能力的同时,采用自下向上的构建方式,使得每个节点的最小边界矩形的重叠交差范围减少,同时保证了树的平衡性。将R树扩展到三维空间,使得其可以很好的对三角面片建立空间索引。如图3所示,提供面向空间三角面片的细粒度空间索引的示意图,以每一个三角面片为索引节点,对三维对象构建细粒度3D-R树空间索引。其中,box表示包围盒,Point(XAmin,YAmin,ZAmin)和Point(XAmax,YAmax,ZAmax)分别表示三角面片A对应的包围盒的最小坐标点和最大坐标点。The triangular patch model has a huge number of patches. When performing visual calculations on hundreds of millions of triangular patches, the intersection operation takes a lot of time and is inefficient. Therefore, this method proposes to extend the R-tree that is commonly used in two-dimensional space to three-dimensional space, establish a spatial data structure of 3D-R tree, and perform perspective calculation of triangular patches based on this data structure. This algorithm inherits the good spatial search ability of R-tree and adopts a bottom-up construction method to reduce the overlapping range of the minimum boundary rectangle of each node while ensuring the balance of the tree. Extend the R tree to three-dimensional space so that it can well establish spatial indexes for triangular patches. As shown in Figure 3, a schematic diagram of fine-grained spatial indexing for spatial triangular patches is provided. Each triangular patch is used as an index node to construct a fine-grained 3D-R tree spatial index for three-dimensional objects. Among them, box represents the bounding box, Point(X Amin , Y Amin , Z Amin ) and Point(X Amax , Y Amax , Z Amax ) respectively represent the minimum coordinate point and the maximum coordinate point of the bounding box corresponding to the triangle patch A.

R树的叶子节点包含特定的数据对象,而在进行空间索引时,从树的根节点开始按数值范围逐步搜索,直至叶子节点,以找到目标数据对象(在本方法中,该目标数据对象是指三角面片),这一方法显著提升了检索效率。The leaf nodes of the R tree contain specific data objects, and when performing spatial indexing, the root node of the tree is gradually searched according to the numerical range until the leaf node to find the target data object (in this method, the target data object is Refers to triangular patches), this method significantly improves the retrieval efficiency.

步骤106,对当前视点与目标点连线得到视线,对视线和三维R树空间索引进行空间交查询。Step 106: Obtain the line of sight by connecting the current viewpoint and the target point, and perform a spatial intersection query on the line of sight and the three-dimensional R-tree spatial index.

在成功构建3D-R树索引后,则可以将通视分析问题转换为视点与目标观测点连接的视线与三角面片的空间交查询问题。After the 3D-R tree index is successfully constructed, the visual analysis problem can be converted into the spatial intersection query problem of the visual line and the triangular patch connecting the viewpoint and the target observation point.

步骤108,根据空间交查询的结果得到目标点的可视性。Step 108: Obtain the visibility of the target point according to the result of the spatial intersection query.

如图4所示,提供基于细粒度3D-R树空间索引的快速通视性分析方法设计流程示意图。As shown in Figure 4, a schematic diagram of the design process of a fast visibility analysis method based on fine-grained 3D-R tree spatial index is provided.

值得说明的是,本方法除了应用于两点之间直线段的通视分析以外,还可以应用于曲线之间的通视分析。如图5所示,提供面向抛物线的通视分析示意图,首先将抛物线离散拆解为几条直线段,这些直线段可以近似拟合为一条抛物曲线,再对离散拆解的每条直线段依次运用本方法进行通视分析查询,从而得到每段直线段的通视性,若在查询过程中发生交叉情况,则整条抛物曲线被判定为不可视。It is worth noting that, in addition to being applied to the visibility analysis of straight line segments between two points, this method can also be applied to the visibility analysis between curves. As shown in Figure 5, a schematic diagram of a parabola-oriented comprehensive analysis is provided. First, the parabola is discretely disassembled into several straight line segments. These straight line segments can be approximately fitted into a parabola curve, and then each discrete straight line segment is disassembled in turn. This method is used to perform visibility analysis and query to obtain the visibility of each straight line segment. If an intersection occurs during the query process, the entire parabola is judged to be invisible.

上述基于三维R树空间索引的通视分析方法中,为数据集中的每一个三角面片建立细粒度3D-R树空间索引,再将视点和目标点连接的视线与空间索引进行空间交查询操作,判断该目标点相对于视点的可见性。本方法后续还可以利用多线程并行计算,进一步加快海量三角面片数据的可视分析。较于现有技术中的通视算法和GPU管道渲染等方法,本方法通过对原始数据的三角面片建立索引库,舍去传统方法的插值过程,降低计算代价和计算复杂度,还可以支持更多的查询功能,为后续的进一步分析做好初步准备工作。In the above-mentioned view analysis method based on the three-dimensional R-tree spatial index, a fine-grained 3D-R tree spatial index is established for each triangular patch in the data set, and then the line of sight and the spatial index connecting the viewpoint and the target point are subjected to a spatial intersection query operation. , determine the visibility of the target point relative to the viewpoint. This method can also use multi-threaded parallel computing in the future to further speed up the visual analysis of massive triangular patch data. Compared with methods such as the view-through algorithm and GPU pipeline rendering in the existing technology, this method establishes an index library for the triangular patches of the original data, discards the interpolation process of the traditional method, reduces the calculation cost and complexity, and can also support More query functions make preliminary preparations for further analysis.

应该理解的是,虽然图1的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although various steps in the flowchart of FIG. 1 are shown in sequence as indicated by arrows, these steps are not necessarily executed in the order indicated by arrows. Unless explicitly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Figure 1 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these sub-steps or stages The sequence is not necessarily sequential, but may be performed in turn or alternately with other steps or sub-steps of other steps or at least part of the stages.

R树常采用最小边界矩形(Minimal Bounding Rectangle,MBR)的概念,对数据项进行包围。在二维空间,MBR呈现为矩形,而在三维空间,则演化为长方体。从叶子节点开始,MBR用于包围数据项,而父节点同样利用MBR将其子节点的MBR框起来,随着层级升高,MBR所涵盖的空间逐渐扩大,最终,根节点的MBR将整个数据集包含其中。一棵n阶R树的节点结构可以如下定义:R-trees often use the concept of Minimal Bounding Rectangle (MBR) to surround data items. In two-dimensional space, MBR appears as a rectangle, while in three-dimensional space, it evolves into a cuboid. Starting from the leaf nodes, MBR is used to surround the data items, and the parent node also uses MBR to frame the MBR of its child nodes. As the level increases, the space covered by MBR gradually expands. Finally, the MBR of the root node encloses the entire data. set included. The node structure of an n-order R-tree can be defined as follows:

叶子节点:(Count,Level,<OI1,MBR1>,<OI2,MBR2>…<OIn,MBRn>);Leaf node: (Count,Level,<OI 1 ,MBR 1 >,<OI 2 ,MBR 2 >…<OI n ,MBR n >);

中间节点:(Count,Level,<CP1,MBR1>,<CP2,MBR2>…<CPn,MBRn>);Intermediate nodes: (Count,Level,<CP 1 ,MBR 1 >,<CP 2 ,MBR 2 >…<CP n ,MBR n >);

其中,<OIn,MBRn>表示目标数据对象,OIn为空间目标的标识,MBRn为该目标的最小边界矩形;<CPn,MBRn>表示数据索引,CPn为指向子树根节点的指针。Count≤m指示节点中用到的数据项或索引项的个数,Level表示该节点在树中的层数。Among them, <OI n ,MBR n > represents the target data object, OI n is the identification of the space target, and MBR n is the minimum bounding rectangle of the target; <CP n ,MBR n > represents the data index, and CP n points to the subtree root. Pointer to the node. Count≤m indicates the number of data items or index items used in the node, and Level indicates the number of levels of the node in the tree.

本发明主要包括四种数据结构:最小轴向包围盒、视线结构、3D-R树节点、3D-R树。并对其中的主要成员变量进行介绍:The invention mainly includes four data structures: minimum axial bounding box, line of sight structure, 3D-R tree node, and 3D-R tree. And introduce the main member variables:

(1)最小轴向包围盒:R树在三维的情况下,每个数据项的最小边界矩形演化为轴向包围盒的形式,采用Max-Min表示法,即轴向包围盒在三个方向上的最大最小值。(1) Minimum axial bounding box: In the case of R-tree in three dimensions, the minimum bounding rectangle of each data item evolves into the form of an axial bounding box, using the Max-Min representation, that is, the axial bounding box is in three directions the maximum and minimum values on.

struct Rect3d{struct Rect3d{

double m_Min[3];double m_Min[3];

double m_Max[3];double m_Max[3];

};};

(2)视线结构:视点和目标点的空间位置构成视线结构。(2) Line of sight structure: The spatial positions of the viewpoint and target point constitute the line of sight structure.

struct Seg3d{struct Seg3d{

s_start[3];s_start[3];

s_end[3];s_end[3];

};};

(3)3D-R树节点:主要包括孩子节点指针,指向下一个节点的指针,以及数据ID、层级索引。(3) 3D-R tree node: mainly includes child node pointer, pointer to the next node, as well as data ID and level index.

struct Node{struct Node{

m_child*;m_child*;

m_next*;m_next*;

m_data;m_data;

m_level;m_level;

};};

(4)3D-R树:建立面向三角面片的索引结构,主要包含节点信息、轴向包围盒信息以及视线结构信息。(4) 3D-R tree: Establish an index structure for triangular patches, which mainly includes node information, axial bounding box information and line of sight structure information.

class 3d_Rtree{class 3d_Rtree{

struct Node;struct Node;

struct Rect3d;struct Rect3d;

struct Seg3d;struct Seg3d;

};。};.

在一个实施例中,以每一个空间三角面片为索引节点,构建空间三角面片模型的三维R树空间索引,包括:In one embodiment, each space triangle patch is used as an index node to construct a three-dimensional R-tree spatial index of the space triangle patch model, including:

根据当前三角面片获取对应层的根节点;Get the root node of the corresponding layer based on the current triangle patch;

遍历根节点的子节点,找出因插入当前三角面片而导致最小边界长方体扩张程度最小的子节点作为目标子节点;Traverse the child nodes of the root node and find the child node that causes the smallest expansion of the minimum boundary cuboid due to the insertion of the current triangle patch as the target child node;

将当前三角面片插入对应的目标子节点后,若此时目标子节点中的三角面片的数量不超过对应的目标子节点的预设阈值,那么无需对目标子节点进行分裂,可得到新的目标子节点;After inserting the current triangular patch into the corresponding target sub-node, if the number of triangular patches in the target sub-node does not exceed the preset threshold of the corresponding target sub-node, then there is no need to split the target sub-node and a new The target child node;

若新的目标子节点为其所在层的根节点,则停止操作,完成当前三角面片的插入。If the new target sub-node is the root node of its layer, the operation stops and the insertion of the current triangular patch is completed.

在一个实施例中,所述方法还包括:In one embodiment, the method further includes:

当存在多个因插入三角面片而导致最小边界长方体扩张程度最小的子节点时,选择其中最小边界长方体体积最小的子节点作为目标子节点。When there are multiple child nodes with the smallest expansion degree of the minimum boundary cuboid due to the insertion of triangular patches, select the child node with the smallest volume of the minimum boundary cuboid as the target child node.

在一个实施例中,所述方法还包括:In one embodiment, the method further includes:

将当前三角面片插入对应的目标子节点后,若此时目标子节点中的三角面片的数量超过对应的目标子节点的预设阈值,则将目标子节点分裂为第一子节点和第二子节点;After inserting the current triangular patch into the corresponding target sub-node, if the number of triangular patches in the target sub-node exceeds the preset threshold of the corresponding target sub-node, the target sub-node will be split into the first sub-node and the third sub-node. Two child nodes;

若第一子节点不是其所在层的根节点,则根据层级索引找到其父节点,并调整父节点的最小边界长方体,使得调整后的最小边界长方体能够包围第一子节点和第二子节点;If the first child node is not the root node of its layer, find its parent node according to the level index, and adjust the minimum boundary cuboid of the parent node so that the adjusted minimum boundary cuboid can surround the first child node and the second child node;

若调整后的最小边界长方体超出父节点的存储约束,则将父节点进行分裂,得到第一父节点和第二父节点;If the adjusted minimum boundary cuboid exceeds the storage constraints of the parent node, the parent node is split to obtain the first parent node and the second parent node;

若第一父节点为其所在层的根节点,则返回第一父节点,停止操作;若第一父节点不是所在层的根节点,则根据层级索引找到其父节点,并调整其父节点的最小边界长方体,使得调整后的最小边界长方体能够包围第一父节点和第二父节点。If the first parent node is the root node of the layer where it is located, return to the first parent node and stop the operation; if the first parent node is not the root node of the layer where it is located, find its parent node according to the level index and adjust the parent node's The minimum boundary cuboid enables the adjusted minimum boundary cuboid to surround the first parent node and the second parent node.

在一个实施例中,在将目标子节点分裂为第一子节点和第二子节点之后,对原先的目标子节点中的三角面片和当前三角面片按照最邻近策略分别插入至第一子节点和第二子节点中。In one embodiment, after the target sub-node is split into a first sub-node and a second sub-node, the triangular patch in the original target sub-node and the current triangular patch are inserted into the first sub-node respectively according to the nearest neighbor strategy. node and the second child node.

为了构建3D-R树空间索引结构,依次插入三角面片数据。R树的节点按照设定的阈值进行动态分裂,随之调整R树高度。该构建过程涉及数据插入、最小扩张节点查询、以及分裂信息的上传,最终生成完整的三维面树。如表1所示,提供3D-R树的构建流程。In order to construct the 3D-R tree spatial index structure, the triangular patch data is inserted in sequence. The nodes of the R tree are dynamically split according to the set threshold, and the height of the R tree is adjusted accordingly. The construction process involves data insertion, minimum expansion node query, and uploading of splitting information, and finally generates a complete three-dimensional surface tree. As shown in Table 1, the construction process of 3D-R tree is provided.

表1 3D-R树的构建流程Table 1 3D-R tree construction process

为了更直观地体现上述操作,通过图的方式进行讲解,对3D-R树插入一个三角面片的过程。本发明算法的核心思想是为每个空间三角面片构建轴向包围盒,自下而上建立3D-R树。如图6所示,提供基于3D-R树和AABB的空间三角面片索引示意图,其中,图6(a)为3D-R树空间索引结构,图6(b)为3D-R树。p1,p2,...,p5表示原始数据的空间三角面片,实线立方体表示空间三角面片的轴向包围盒,用最小(Xmin,Ymin,Zmin)和最大(Xmax,Ymax,Zmax)坐标点来表示。依据R树的原理,继续向上集成,得到根节点所对应的索引空间R1,R2。根据构建好的空间索引库,可以快速查询每个三角面片的轴向包围盒,从而快速获得与视线相交的空间索引数据。当要插入新的三角面片P6时,首先进行最小扩张节点的查询,在根节点中有两个AABB,分别为R1,R2,两者进行比较,可以看出R1已经部分包围了P6,而若在R2中插入会使R2的Range增大很多。因此选择R1作为插入节点。但由于在该树中所设置的阈值为3,即节点所能存储的最大对象为3个,因此需要对插入节点进行分裂操作。In order to reflect the above operation more intuitively, the process of inserting a triangular patch into the 3D-R tree will be explained through diagrams. The core idea of the algorithm of the present invention is to construct an axial bounding box for each spatial triangle patch and build a 3D-R tree from bottom to top. As shown in Figure 6, a schematic diagram of the spatial triangle patch index based on 3D-R trees and AABB is provided, in which Figure 6(a) is the 3D-R tree spatial index structure, and Figure 6(b) is the 3D-R tree. p 1 , p 2 ,..., p 5 represent the spatial triangle patch of the original data, and the solid line cube represents the axial bounding box of the spatial triangle patch, using the minimum (X min , Y min , Z min ) and the maximum ( X max , Y max , Z max ) coordinate points are represented. According to the principle of R tree, continue to integrate upward to obtain the index space R 1 and R 2 corresponding to the root node. According to the constructed spatial index library, the axial bounding box of each triangular patch can be quickly queried, thereby quickly obtaining the spatial index data that intersects the line of sight. When inserting a new triangular patch P 6 , first query the minimum expansion node. There are two AABBs in the root node, namely R 1 and R 2. Comparing the two, it can be seen that R 1 has been partially surrounded P 6 is removed, and if inserted into R 2 , the Range of R 2 will increase a lot. Therefore R 1 is selected as the insertion node. However, since the threshold set in the tree is 3, that is, the maximum object that a node can store is 3, the inserted node needs to be split.

将根节点R1分裂成R1,R1',同时根据最邻近策略选择将P2,P6放入一个节点,P1,P3放入另一个节点,向上传播,由于父节点中只包含R1,R2,未超过阈值,因此无需分裂,只需要调整Range,确保将叶子节点包围即可,插入节点后分裂了的3D-R树结构如图7所示。Split the root node R 1 into R 1 and R 1 ', and at the same time choose to put P 2 and P 6 into one node, P 1 and P 3 into another node according to the nearest neighbor strategy, and propagate upward. Since there are only It contains R 1 and R 2 and does not exceed the threshold, so there is no need to split. You only need to adjust the Range to ensure that the leaf nodes are surrounded. The split 3D-R tree structure after inserting the node is shown in Figure 7.

在一个实施例中,对视线和三维R树空间索引进行空间交查询,包括:In one embodiment, performing a spatial intersection query on the line of sight and the three-dimensional R-tree spatial index includes:

获取视线的起点坐标和终点坐标;Get the starting point coordinates and end point coordinates of the line of sight;

根据起点坐标和终点坐标从三维R树空间索引中找到对应的节点的最小边界长方体;Find the minimum boundary cuboid of the corresponding node from the three-dimensional R-tree spatial index according to the starting point coordinates and the end point coordinates;

根据起点坐标和终点坐标判断视线是否与对应节点的最小边界长方体相交;Determine whether the line of sight intersects the minimum boundary cuboid of the corresponding node based on the starting point coordinates and end point coordinates;

若相交,则进一步获取对应节点中的三角面片信息;If they intersect, further obtain the triangular patch information in the corresponding node;

根据三角面片信息判断视线是否与对应节点中的三角面片相交。Determine whether the line of sight intersects the triangle patch in the corresponding node based on the triangle patch information.

在一个实施例中,根据空间交查询的结果得到目标点的可视性,包括:In one embodiment, obtaining the visibility of the target point based on the results of the spatial intersection query includes:

若视线与对应节点的最小边界长方体不相交,则目标点可见;If the line of sight does not intersect with the minimum boundary cuboid of the corresponding node, the target point is visible;

若视线与对应节点的最小边界长方体相交,但与对应节点中的三角面片不相交,则目标点可见;If the line of sight intersects the minimum boundary cuboid of the corresponding node but does not intersect with the triangular patch in the corresponding node, the target point is visible;

若视线与对应节点的最小边界长方体相交,且与对应节点中的三角面片相交,则目标点不可见。If the line of sight intersects the minimum boundary cuboid of the corresponding node and the triangle patch in the corresponding node, the target point is invisible.

如图8所示,提供视线与三角面片的空间交查询问题示意图,先进行视线与轴向包围盒的相交测试,再进行线段与三角面片的相交测试,从而得到目标点的可视性。As shown in Figure 8, a schematic diagram of the spatial intersection query problem between the line of sight and the triangular patch is provided. First, the intersection test of the line of sight and the axial bounding box is performed, and then the intersection test of the line segment and the triangular patch is performed to obtain the visibility of the target point. .

如图9所示,提供通视分析的整体流程示意图。在3D-R树空间索引构建完成后,进入空间交查询阶段。在进行两点间的通视分析时,需要对视点与目标点连线即视线与3D-R树进行空间交查询操作,若相交,则两点之间并不互见,若不相交,则代表该目标点可视。上述问题可转换为数学几何问题,即直线段与轴向包围盒的空间相交问题以及进一步地分析直线段与三角形的交叉问题。As shown in Figure 9, a schematic diagram of the overall process of visual analysis is provided. After the construction of the 3D-R tree spatial index is completed, the spatial intersection query stage is entered. When performing a line of sight analysis between two points, it is necessary to perform a spatial intersection query on the line connecting the viewpoint and the target point, that is, the line of sight and the 3D-R tree. If they intersect, the two points do not see each other. If they do not intersect, it means The target point is visible. The above problem can be converted into a mathematical geometry problem, that is, the spatial intersection problem of a straight line segment and an axial bounding box, and the further analysis of the intersection problem of a straight line segment and a triangle.

如图10所示,提供视线线段与轴向包围盒的相交示意图。As shown in Figure 10, a schematic diagram of the intersection of the line of sight line segment and the axial bounding box is provided.

设线段起始点与终点分别为轴向包围盒AABB的最大最小点分别为A(Xmax,Ymax,Zmax)和B(Xmin,Ymin,Zmin),线段上任意一点可以表示为:Let the starting point and end point of the line segment be respectively The maximum and minimum points of the axial bounding box AABB are A (X max , Y max , Z max ) and B (X min , Y min , Z min ) respectively. Any point on the line segment can be expressed as:

其中表示线段的方向,t表示从起点到任意一点的斜向距离。判断一条线段与立方体是否相交,核心原理是线段穿过立方体的部分是六个面中与两两平面相交部分的交,可以将问题转换为线段进入平面的最大斜向距离max(tx_near,ty_near,tz_near)与离开平面的最小斜向距离min(tx_far,ty_far,tz_far)之间的关系,若进入平面的最大斜向距离小于离开平面的最小斜向距离,则表示线段与立方体相交:in represents the direction of the line segment, and t represents the diagonal distance from the starting point to any point. To determine whether a line segment intersects a cube, the core principle is that the part of the line segment that passes through the cube is the intersection of the parts of the six faces that intersect with two planes. The problem can be converted into the maximum oblique distance of the line segment into the plane max(t x_near ,t The relationship between y_near ,t z_near ) and the minimum oblique distance min(t x_far ,t y_far ,t z_far ) from the plane. If the maximum oblique distance entering the plane is less than the minimum oblique distance leaving the plane, it means that the line segment is Intersection of cubes:

max(tx_near,ty_near,tz_near,0)≤min(tx_far,ty_far,tz_far,1) (2)max(t x_near ,t y_near ,t z_near ,0)≤min(t x_far ,t y_far ,t z_far ,1) (2)

以X-slab为例,线段与X平面的交点为:Taking X-slab as an example, the intersection point of the line segment and the X plane is:

xstart+t*dx=Xmin (3)x start +t*d x =X min (3)

求解系数t即可,同理可以求取Y-slab和Z-slab的系数t,再运用公式2的判断条件,得到布尔运算结果。如表2所示,提供直线段与轴向包围盒AABB的空间交查询算法流程伪代码。Just solve the coefficient t. In the same way, you can find the coefficient t of Y-slab and Z-slab, and then use the judgment conditions of Formula 2 to get the Boolean operation result. As shown in Table 2, the pseudo code of the spatial intersection query algorithm process of the straight line segment and the axial bounding box AABB is provided.

表2直线段与轴向包围盒AABB的空间交查询算法流程Table 2 Spatial intersection query algorithm flow of straight line segment and axial bounding box AABB

为了提高判断结果的准确性,本方法在完成视线与3D-R树的空间交查询后,需要进一步判断当前视线与当前轴向包围盒内部的三角面片的空间关系,一种基本的检测算法是计算目标对象与三角形所在的平面的交点,再判断交点是否在三角形内。若交点在三角形内,则对象与三角形相交;否则,不相交。由于计算机中的浮点数占用字节有限,表示的精度受到限制,在计算直线与平面交点时,对同一变量进行多次乘法或除法操作会导致误差累积,最终计算结果可能因精度问题而产生较大误差,导致以上算法出现效率较低和易产生浮点数误差的问题,。In order to improve the accuracy of the judgment results, this method needs to further determine the spatial relationship between the current line of sight and the triangular patch inside the current axial bounding box after completing the spatial intersection query between the line of sight and the 3D-R tree. A basic detection algorithm It calculates the intersection point between the target object and the plane where the triangle is located, and then determines whether the intersection point is within the triangle. If the intersection point is within the triangle, the object intersects the triangle; otherwise, it does not intersect. Since floating point numbers in computers occupy limited bytes, the accuracy of representation is limited. When calculating the intersection of a straight line and a plane, multiple multiplication or division operations on the same variable will lead to error accumulation, and the final calculation result may be larger due to accuracy issues. Large errors cause the above algorithm to have low efficiency and prone to floating point errors.

本方法通过向量与矩阵计算可以快速得出交点与重心坐标,而无需对包含三角形的平面方程进行预计算。This method can quickly obtain the coordinates of the intersection point and center of gravity through vector and matrix calculations without precomputing the plane equations containing triangles.

设三角形三个顶点分别为Po,P1,P2,则线段与三角形相交时可以得到:Assume that the three vertices of the triangle are P o , P 1 , and P 2 respectively. When the line segment intersects the triangle, we can get:

其中,(u,v)∈Ω={(u,v):u≥0,v≥0,u+v≤1}称为重心坐标,通过求解三个变量t,u,v的范围限制判断是否相交,上述公式可以采用克拉姆法则进行求解:Among them, (u, v)∈Ω = {(u, v): u ≥ 0, v ≥ 0, u + v ≤ 1} is called the center of gravity coordinate, which is determined by solving the range limits of the three variables t, u, v Whether they intersect or not, the above formula can be solved using Cram's rule:

其中各个向量参数定义为:Each vector parameter is defined as:

如果得到的解(u,v)∈Ω且t∈[0,1],那么直线与平面的交点位于三角形内;否则,位于三角形外。若u=0或v=0或u+v=1,则交点在三角形的边上。If the obtained solution (u, v) ∈ Ω and t ∈ [0, 1], then the intersection point of the line and the plane is located inside the triangle; otherwise, it is located outside the triangle. If u=0 or v=0 or u+v=1, the intersection point is on the side of the triangle.

如表3所示,提供直线与三角面片求交算法的伪代码。As shown in Table 3, the pseudo code of the intersection algorithm of straight lines and triangle patches is provided.

表3直线与三角面片求交算法的伪代码Table 3 Pseudo code of intersection algorithm of straight line and triangle patch

为了分析本发明算法在海量数据集上的通视性能,选取A地区不同规模的三角面片数据集进行测试运算,分析在不同数据集规模下该算法的通视性能和时间复杂度。本发明算法测试平台的具体配置如表4所示。In order to analyze the visibility performance of the algorithm of the present invention on massive data sets, triangular patch data sets of different sizes in area A were selected for test operations, and the visibility performance and time complexity of the algorithm under different data set sizes were analyzed. The specific configuration of the algorithm testing platform of the present invention is shown in Table 4.

表4通视分析性能实验环境配置Table 4 Visual analysis performance experimental environment configuration

分别在三角面片数据量为十万、百万、千万、亿级单位的数据规模下进行测试分析,为每一个三角面片构建矩形包围盒,生成3D-R树细粒度空间索引。在每一个数据集范围内选取合适的视点位置,对数据范围内每一个像素点进行通视分析,不同数据规模的通视性能如表5所示,随着数据量指数级增长,通视分析的性能并没有呈线性递减,其浮动控制在单位时间十万次以内。Test and analysis were carried out on data scales of 100,000, 1 million, 10 million and 100 million units of triangular patch data respectively, a rectangular bounding box was constructed for each triangular patch, and a 3D-R tree fine-grained spatial index was generated. Select an appropriate viewpoint position within each data set, and perform visual analysis on each pixel within the data range. The visual performance of different data scales is shown in Table 5. As the amount of data increases exponentially, visual analysis The performance does not decrease linearly, and its floating control is within 100,000 times per unit time.

表5通视分析实验结果Table 5 Visual analysis experimental results

如图11所示,提供基于3D-R树索引的通视分析性能示意图。当三角面片数量在一亿个以内时,单位时间内视线与3D-R树细粒度空间索引相交运算最高可达38万次,并随着数据集规模的增大而缓慢下降。当三角面片数量达到一亿个以上时,其单位时间内的通视分析性能逐渐收敛,趋于稳定。这说明本发明算法的通视分析性能受到数据集规模的影响较小。在时间复杂度方面,如图12所示,提供基于3D-R树索引的通视分析的时间复杂度示意图。当三角面片数据量在4亿以下时,时间复杂度呈现对数增长,即O(logkn),其中k为节点最大分裂数。但在三角面片数量级达到4亿以上后,运算时间逐渐递增,这是由于随着数据量规模的增加,空间交查询操作也更为复杂,在通视性能逐渐收敛的情况下,查询时间势必会呈现增长趋势。以上测试运算展现了单线程操作下的性能分析结果,后续将启用多线程操作,可以更大幅度提升计算性能。As shown in Figure 11, a schematic diagram of the through-view analysis performance based on 3D-R tree index is provided. When the number of triangular patches is less than 100 million, the intersection operation between the line of sight and the fine-grained spatial index of the 3D-R tree can reach up to 380,000 times per unit time, and slowly decreases as the size of the data set increases. When the number of triangular patches reaches more than 100 million, its visual analysis performance per unit time gradually converges and becomes stable. This shows that the visual analysis performance of the algorithm of the present invention is less affected by the size of the data set. In terms of time complexity, as shown in Figure 12, a schematic diagram of the time complexity of view analysis based on 3D-R tree index is provided. When the amount of triangular patch data is less than 400 million, the time complexity increases logarithmically, that is, O(log k n), where k is the maximum number of node splits. However, after the magnitude of triangular patches reaches more than 400 million, the calculation time gradually increases. This is because as the size of the data increases, the spatial intersection query operation becomes more complex. When the visibility performance gradually converges, the query time is bound to increase. There will be a growth trend. The above test operations show the performance analysis results under single-threaded operation. Multi-threaded operation will be enabled in the future, which can greatly improve computing performance.

相较于传统的通视分析方法,本发明算法无需对地形点的高程进行插值,而是通过对三角面片建立空间索引,在计算视线与地形是否相交的步骤中直接在已构建完毕的索引库中查找,极大的降低了算法的复杂度,并在海量数据集上进行测试分析,其通视分析性能逐渐收敛。Compared with the traditional sight-through analysis method, the algorithm of the present invention does not need to interpolate the elevation of terrain points. Instead, it establishes a spatial index on the triangular patch, and directly calculates whether the sight line intersects with the terrain in the already constructed index. Searching in the library greatly reduces the complexity of the algorithm, and when tested and analyzed on massive data sets, its visual analysis performance gradually converges.

综上,随着三维场景的复杂性不断增加,GIS数据的日益充实,面临着面向广泛的三维场景进行通视分析时长期存在的问题,包括通视分析的可用性、操作性和安全性等,这些问题严重制约了通视分析的实际应用。本方法围绕大规模场景下快速通视分析问题展开深入研究,提出一种基于3D-R树索引的快速通视分析方法,通过对三角面片模型建立3D-R树细粒度空间索引,依次将视点与目标点的连线即视线与空间索引进行空间交查询操作,避免传统算法高程内插过程,可以在不同规模数据集上快速高效地完成通视分析,单线程计算性能最高可以达到每秒38万次。相较于传统算法,例如R2、R3和Xdraw算法的时间复杂度是随着视域半径的二次方甚至三次方进行增长,并不适用于海量数据集下的大范围视域分析问题,而本方法的时间复杂度表现为对数时间,可以支持远距离通视分析,为后续基于大规模数据集的通视应用问题提供新的思路。In summary, as the complexity of three-dimensional scenes continues to increase and GIS data becomes increasingly enriched, we are faced with long-standing problems when conducting visual analysis for a wide range of three-dimensional scenes, including the usability, operability, and security of visual analysis. These problems seriously restrict the practical application of visual analysis. This method conducts in-depth research on the problem of fast view analysis in large-scale scenes, and proposes a fast view analysis method based on 3D-R tree index. It establishes a 3D-R tree fine-grained spatial index for the triangular patch model, and sequentially The connection between the viewpoint and the target point, that is, the line of sight and the spatial index, performs spatial intersection query operations to avoid the height interpolation process of the traditional algorithm, and can quickly and efficiently complete visual analysis on data sets of different sizes. The single-threaded computing performance can reach up to 1 second. 380,000 times. Compared with traditional algorithms, the time complexity of R 2 , R 3 and Xdraw algorithms increases with the quadratic or even cubic power of the field of view radius, which is not suitable for large-scale view field analysis problems under massive data sets. , and the time complexity of this method is logarithmic time, which can support long-distance visibility analysis and provide new ideas for subsequent visibility application problems based on large-scale data sets.

在一个实施例中,提供了一种基于三维R树空间索引的通视分析装置,包括:空间三角面片模型获取模块、三维R树空间索引构建模块、空间交查询模块和目标点可视性分析模块,其中:In one embodiment, a visual analysis device based on a three-dimensional R-tree spatial index is provided, including: a spatial triangle patch model acquisition module, a three-dimensional R-tree spatial index construction module, a spatial intersection query module and target point visibility Analysis module, which:

空间三角面片模型获取模块,用于获取三维对象的空间三角面片模型;在空间三角面片模型中包含若干个空间三角面片;The space triangle patch model acquisition module is used to obtain the space triangle patch model of a three-dimensional object; the space triangle patch model contains several space triangle patches;

三维R树空间索引构建模块,用于以每一个空间三角面片为索引节点,构建空间三角面片模型的三维R树空间索引;The three-dimensional R-tree spatial index building module is used to construct a three-dimensional R-tree spatial index of the spatial triangle patch model using each spatial triangle patch as an index node;

空间交查询模块,用于对当前视点与目标点连线得到视线,对视线和三维R树空间索引进行空间交查询;The spatial intersection query module is used to obtain the line of sight from the current viewpoint and the target point, and performs spatial intersection query on the line of sight and the three-dimensional R-tree spatial index;

目标点可视性分析模块,用于根据空间交查询的结果得到目标点的可视性。The target point visibility analysis module is used to obtain the visibility of the target point based on the results of the spatial intersection query.

关于基于三维R树空间索引的通视分析装置的具体限定可以参见上文中对于基于三维R树空间索引的通视分析方法的限定,在此不再赘述。上述基于三维R树空间索引的通视分析装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Regarding the specific limitations of the visual analysis device based on the three-dimensional R-tree spatial index, please refer to the above-mentioned limitations on the visual analysis method based on the three-dimensional R-tree spatial index, which will not be described again here. Each module in the above-mentioned three-dimensional R-tree spatial index-based perspective analysis device can be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor of the computer device in the form of hardware, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图13所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储三角面片等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于三维R树空间索引的通视分析方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in Figure 13. The computer device includes a processor, memory, network interface, and database connected through a system bus. Wherein, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage medium stores operating systems, computer programs and databases. This internal memory provides an environment for the execution of operating systems and computer programs in non-volatile storage media. The database of the computer device is used to store data such as triangle patches. The network interface of the computer device is used to communicate with external terminals through a network connection. The computer program, when executed by a processor, implements a perspective analysis method based on a three-dimensional R-tree spatial index.

本领域技术人员可以理解,图13中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 13 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Specific computer equipment can May include more or fewer parts than shown, or combine certain parts, or have a different arrangement of parts.

在一个实施例中,提供了一种计算机设备,包括存储器和处理器,该存储器存储有计算机程序,该处理器执行计算机程序时实现上述实施例中方法的步骤。In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of the method in the above embodiment are implemented.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述实施例中方法的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage. In the media, when executed, the computer program may include the processes of the above method embodiments. Any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined in any way. To simplify the description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, all possible combinations should be used. It is considered to be within the scope of this manual.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation modes of the present application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all fall within the protection scope of the present application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims (10)

1. A method for visual analysis based on three-dimensional R-tree spatial index, the method comprising:
acquiring a space triangular patch model of a three-dimensional object; the space triangular surface patch model comprises a plurality of space triangular surface patches;
constructing a three-dimensional R tree space index of the space triangular patch model by taking each space triangular patch as an index node;
obtaining a sight line by connecting a current viewpoint with a target point, and carrying out space intersection query on the sight line and the three-dimensional R tree space index;
and obtaining the visibility of the target point according to the result of the space intersection query.
2. The method of claim 1, wherein constructing a three-dimensional R-tree spatial index for the spatial triangular patch model with each spatial triangular patch as an inode comprises:
acquiring a root node of a corresponding layer according to the current triangular patch;
traversing the child nodes of the root node, and finding out the child node with the minimum boundary cuboid expansion degree caused by the insertion of the current triangular patch as a target child node;
after inserting the current triangular patches into the corresponding target sub-nodes, if the number of the triangular patches in the target sub-nodes does not exceed the preset threshold value of the corresponding target sub-nodes at the moment, splitting the target sub-nodes is not needed, and a new target sub-node can be obtained;
and if the new target child node is the root node of the layer where the new target child node is located, stopping the operation and completing the insertion of the current triangular patch.
3. The method according to claim 2, wherein the method further comprises: when there are a plurality of child nodes having the smallest expansion degree of the smallest bounding box due to the insertion of the triangular patches, a child node having the smallest volume of the smallest bounding box is selected as the target child node.
4. The method according to claim 2, wherein the method further comprises:
after inserting the current triangular patches into the corresponding target sub-nodes, if the number of the triangular patches in the target sub-nodes exceeds a preset threshold value of the corresponding target sub-nodes at the moment, splitting the target sub-nodes into a first sub-node and a second sub-node;
if the first child node is not the root node of the layer where the first child node is located, finding a father node according to the hierarchy index, and adjusting the minimum boundary cuboid of the father node so that the adjusted minimum boundary cuboid can surround the first child node and the second child node;
if the adjusted minimum boundary cuboid exceeds the storage constraint of the father node, splitting the father node to obtain a first father node and a second father node;
if the first father node is the root node of the layer where the first father node is located, returning to the first father node, and stopping operation; if the first father node is not the root node of the layer, finding the father node according to the hierarchical index, and adjusting the minimum boundary cuboid of the father node, so that the adjusted minimum boundary cuboid can surround the first father node and the second father node.
5. The method of claim 4, wherein after splitting the target child node into a first child node and a second child node, the triangular patches and the current triangular patches in the original target child node are inserted into the first child node and the second child node according to a nearest neighbor policy, respectively.
6. The method of claim 1, wherein spatially intersecting the line of sight and the three-dimensional R-tree spatial index comprises:
acquiring a starting point coordinate and an end point coordinate of the sight;
finding the minimum boundary cuboid of the corresponding node from the three-dimensional R tree space index according to the starting point coordinate and the ending point coordinate;
judging whether the sight line intersects with a minimum boundary cuboid of a corresponding node according to the starting point coordinate and the ending point coordinate;
if the triangular patches are intersected, triangular patch information in the corresponding nodes is further acquired;
and judging whether the sight line intersects with the triangular patch in the corresponding node according to the triangular patch information.
7. The method of claim 1, wherein deriving the visibility of the target point from the results of the spatial cross-query comprises:
if the sight line is not intersected with the minimum boundary cuboid of the corresponding node, the target point is visible;
if the line of sight intersects a minimum bounding cuboid of the corresponding node, but does not intersect a triangular patch in the corresponding node, the target point is visible;
and if the sight line intersects with the minimum boundary cuboid of the corresponding node and intersects with the triangular patch in the corresponding node, the target point is invisible.
8. A three-dimensional R-tree spatial index-based visualization analysis apparatus, the apparatus comprising:
the space triangular patch model acquisition module is used for acquiring a space triangular patch model of the three-dimensional object; the space triangular surface patch model comprises a plurality of space triangular surface patches;
the three-dimensional R tree space index construction module is used for constructing a three-dimensional R tree space index of the space triangular patch model by taking each space triangular patch as an index node;
the space intersection query module is used for obtaining a sight line from a current viewpoint and a target point, and performing space intersection query on the sight line and the three-dimensional R tree space index;
and the target point visibility analysis module is used for obtaining the visibility of the target point according to the result of the space intersection query.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202311630698.0A 2023-11-30 2023-11-30 Visual analysis method, device and equipment based on three-dimensional R-tree spatial index Pending CN117609524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311630698.0A CN117609524A (en) 2023-11-30 2023-11-30 Visual analysis method, device and equipment based on three-dimensional R-tree spatial index

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311630698.0A CN117609524A (en) 2023-11-30 2023-11-30 Visual analysis method, device and equipment based on three-dimensional R-tree spatial index

Publications (1)

Publication Number Publication Date
CN117609524A true CN117609524A (en) 2024-02-27

Family

ID=89949558

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311630698.0A Pending CN117609524A (en) 2023-11-30 2023-11-30 Visual analysis method, device and equipment based on three-dimensional R-tree spatial index

Country Status (1)

Country Link
CN (1) CN117609524A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119051978A (en) * 2024-10-25 2024-11-29 卓望数码技术(深圳)有限公司 Octree-based network attack traffic space index analysis method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119051978A (en) * 2024-10-25 2024-11-29 卓望数码技术(深圳)有限公司 Octree-based network attack traffic space index analysis method and device
CN119051978B (en) * 2024-10-25 2025-01-07 卓望数码技术(深圳)有限公司 Octree-based network attack traffic spatial index analysis method and device

Similar Documents

Publication Publication Date Title
CN109145366B (en) Lightweight visualization method of building information model based on Web3D
CN110704928B (en) Method for converting BIM model into GIS model
CN113781667B (en) Three-dimensional structure simplified reconstruction method, device, computer equipment and storage medium
US7557803B2 (en) Method, computer program product and data structure for representing two- or three-dimensional object modeling
CN101281654A (en) A large-scale complex 3D scene processing method based on octree
CN103413297A (en) Cutting method based on integrated three-dimensional GIS model
CN105160706B (en) Landform parallel constructing method is constrained under a kind of unit multi-core environment
CN109872390B (en) Organization method of massive three-dimensional models
CN114627219A (en) Rendering method and device, storage medium, and electronic device for three-dimensional scene data
CN102193998B (en) Arc scanning type construction scheme of triangular irregular network containing edge topological information
CN102393826B (en) A continuous collision detection method for flexible scenes based on multi-core parallel processing
CN116721218B (en) Three-dimensional real estate model light-weight method, system and equipment
CN113066160A (en) Indoor mobile robot scene data and its test case generation method
CN115661374A (en) Rapid retrieval method based on space division and model voxelization
CN115797568A (en) Modeling method and device based on three-dimensional GIS and BIM integration
CN108230452A (en) A kind of model filling-up hole method based on textures synthesis
CN105468375A (en) Surface structure light point cloud data oriented corresponding point search structure construction method
CN117609524A (en) Visual analysis method, device and equipment based on three-dimensional R-tree spatial index
CN104090945B (en) Geographic space entity constructing method and system
Zhao et al. Completing point clouds using structural constraints for large-scale points absence in 3D building reconstruction
CN113971718B (en) Method for performing Boolean operation on three-dimensional point cloud model
CN115270500A (en) Boolean difference calculation method and device and electronic equipment
CN115578536A (en) Node merging method and device for layered and partitioned three-dimensional model and electronic device
CN110533764A (en) Divide shape quaternary tree veining structure method towards groups of building
CN115115800A (en) BIM model simplification method and device

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