# 二叉空间分割

**二叉空间分割（BSP）树**是一种空间数据结构，其中二叉树表示用超平面对 d 维空间的递归划分：每个内部节点存储一个超平面，将其区域分成两个半空间；每个叶节点对应一个凸子区域，存放多边形片段（用于深度排序）或有界体积（用于布尔运算）。<sup>[1](https://ntrs.nasa.gov/api/citations/19900011335/downloads/19900011335.pdf)</sup><sup> • </sup><sup>[2](https://doi.org/10.1145/37402.37421)</sup> 该结构由 亨利·福克斯（Henry Fuchs）、兹维·凯德姆（Zvi Kedem）和布鲁斯·奈勒（Bruce Naylor）于 1980 年提出，用于为可见面生成预计算与视点无关的多边形排序，后来成为构造实体几何、光线追踪和碰撞检测的标准工具。<sup>[3](https://research-portal.uea.ac.uk/en/publications/the-priority-face-determination-tree-for-hidden-surface-removal/)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 用（子）超平面递归划分 d 维空间的二叉树；内部节点存储分割平面，叶节点存储多边形片段或有界体积<sup>[2](https://doi.org/10.1145/37402.37421)</sup><sup> • </sup><sup>[1](https://ntrs.nasa.gov/api/citations/19900011335/downloads/19900011335.pdf)</sup> |
| 起源 | 福克斯（Fuchs）、凯德姆（Kedem）和奈勒（Naylor），1980 年，用于隐藏面消除中与视点无关的多边形优先级排序<sup>[3](https://research-portal.uea.ac.uk/en/publications/the-priority-face-determination-tree-for-hidden-surface-removal/)</sup> |
| 集合运算 | 蒂博（Thibault）和奈勒（Naylor）（SIGGRAPH 1987）证明 BSP 树可表示正则集合，并在边界表示上求值布尔（CSG）表达式<sup>[2](https://doi.org/10.1145/37402.37421)</sup> |
| 最坏情况规模 | 任意 n 个不相交三角形都存在规模为 O(n<sup>2</sup>) 的 BSP，而任意三角形在最坏情况下需要 Ω(n<sup>2</sup>)<sup>[4](https://doi.org/10.1007/S00454-019-00102-0)</sup> |
| 轴对齐情形 | 对于平面中 n 个等向矩形，规模至多 3n−1（若它们铺满空间则为 2n−1），可在 O(n log n) 时间内构造<sup>[5](https://epubs.siam.org/doi/10.1137/S0895480101384347)</sup> |
| 特例 | kd 树是轴对齐的 BSP 树，用任意位置的坐标对齐平面分割空间<sup>[6](https://graphics.cg.uni-saarland.de/courses/cg1-2019/slides/CG03-SpatialIndex.pdf)</sup> |
| 实际规模 | 为真实地图构建的 BSP 树显示 O(n) 存储，而理论最坏情况为 O(n<sup>2</sup>)<sup>[7](https://www.tandfonline.com/doi/abs/10.1080/02693799008941535)</sup> |

## 结构与构造

BSP 树的每个节点存储一个超平面，在 d 维中写成一个平面，其带符号距离函数将点分类为正、负或位于平面上。该平面将节点区域分成两个子区域，构造递归进行，直到每个子问题只包含输入对象的极小部分。<sup>[8](https://www.cs.ucdavis.edu/~amenta/w11/29toth.pdf)</sup> 多边形实体可表示为其边界曲面所有内部半空间所定义的体积，因此该树编码的是几何本身，而不只是几何的索引。<sup>[1](https://ntrs.nasa.gov/api/citations/19900011335/downloads/19900011335.pdf)</sup>

**分割平面。** 一种常见构造使用输入多边形本身作为分割平面，这种方法称为自动划分。当多边形横跨所选平面时，必须将其切成片段，树的规模以所得片段数计量。糟糕的平面选择会在每个节点切分许多多边形并使树膨胀，因此平面选择是构造的核心问题。<sup>[9](https://citeseerx.ist.psu.edu/document?doi=d6207c3b3a928d32761a484498d7fd23838b72e9&repid=rep1&type=pdf)</sup> 随机化候选平面的选择顺序可避免最坏情形：随机自动划分分析表明，对于平面中的直线集合，存在规模为 O(n log n) 的 BSP，这既提供了随机构造，也提供了小规模树的概率存在性证明。<sup>[10](https://courses.csail.mit.edu/6.854/20/Notes/n27-geometry.html)</sup>

## 规模理论

BSP 树的规模（以片段计数）一直是计算几何的核心课题。佩特森（Paterson）和姚（Yao）于 1990 年证明，任意 n 个不相交三角形都存在规模为 O(n<sup>2</sup>) 的 BSP；对于任意三角形，最坏情况规模有匹配的 Ω(n<sup>2</sup>) 下界；对于胖对象、低密度集合和轴对齐对象，已有更好的界。<sup>[4](https://doi.org/10.1007/S00454-019-00102-0)</sup>

对于轴对齐输入，这些界几乎是紧的。伯曼（Berman）、达斯古普塔（DasGupta）和穆图克里希南（Muthukrishnan）证明了平面中 n 个等向矩形的 BSP 规模上界为 3n−1，改进了此前的 4n 界；当矩形铺满底层空间时上界为 2n−1；达到这些界的 BSP 可在 O(n log n) 时间内构建。相应的最坏情况下界一般为 2n−o(n)，铺砌情形为 3n/2−o(n)。<sup>[5](https://epubs.siam.org/doi/10.1137/S0895480101384347)</sup> 由于 BSP 树是计算几何中最流行的数据结构之一，这些界即使只有常数因子的改进，也会影响建立在其上的应用性能。<sup>[5](https://epubs.siam.org/doi/10.1137/S0895480101384347)</sup>

最坏情况界可能高估实际代价。一个用于地理信息系统的改进 BSP 树实现发现，在真实地图上构建的树占用 O(n) 存储，而 n 条线段的理论最坏情况为 O(n<sup>2</sup>)。<sup>[7](https://www.tandfonline.com/doi/abs/10.1080/02693799008941535)</sup>

## 隐藏面消除与渲染

最初的应用是可见面问题。较简单的画家算法方法从后往前绘制多边形，让较近的几何覆盖较远的几何，但无法一致地确定多边形深度；按极值顶点或按质心排序在某些配置下会失败。<sup>[11](https://www.sciencedirect.com/science/article/pii/B9780125434577500267)</sup> BSP 树通过为多边形存储与视点无关的优先级顺序来解决这个问题：给定任意视点，遍历树会以正确的从后到前（或从前到后）顺序访问多边形，因为如果观察者位于节点平面的一侧，另一侧的任何东西都不可能遮挡这一侧的几何。<sup>[3](https://research-portal.uea.ac.uk/en/publications/the-priority-face-determination-tree-for-hidden-surface-removal/)</sup><sup> • </sup><sup>[10](https://courses.csail.mit.edu/6.854/20/Notes/n27-geometry.html)</sup> 该遍历足够快，可以交互速度支持隐藏面消除，包括在个人计算机上。<sup>[1](https://ntrs.nasa.gov/api/citations/19900011335/downloads/19900011335.pdf)</sup>

由于排序是预计算的且与视点无关，BSP 树适合几何固定、视点移动的场景。

## 构造实体几何与集合运算

蒂博（Thibault）和奈勒（Naylor）1987 年的 SIGGRAPH 论文确立了 BSP 树作为任意维任意多面体精确表示的地位，而不仅仅是排序工具。他们描述了从边界表示（B-rep）到 BSP 树的转换，以及一种在作为构造实体几何（CSG）树给出的 B-rep 上求值任意集合论（布尔）表达式的方法，结果生成 BSP 树。<sup>[2](https://doi.org/10.1145/37402.37421)</sup> 布尔运算也可以通过用一个操作数的 BSP 表示切割另一个操作数的多边形表示来执行，并且由于多边形在细分时被分类，这简化了 CSG 实现。<sup>[1](https://ntrs.nasa.gov/api/citations/19900011335/downloads/19900011335.pdf)</sup> 同一篇论文描述了一个交互式 3D 设计程序，其中对象用工具增量修改，并更新树以表示每次集合运算。<sup>[2](https://doi.org/10.1145/37402.37421)</sup>

后来的工作改进了合并：一种使用线性规划可行性测试的布尔集合运算方法消除了早期 BSP 合并算法中困难的树划分和多边形切割需求，其合并过程在最坏情况下运行时间为 Ω(n<sup>2</sup>)。<sup>[12](https://www.sciencedirect.com/science/article/abs/pii/S0010448508002030)</sup>

## 光线追踪与加速结构

具有任意方向分割平面的 BSP 树是光线追踪的一类空间加速结构，与 kd 树、均匀网格和包围体层次（BVH）并列。kd 树将分割限制为任意位置的轴对齐平面，是 BSP 树的特例，在基于 CPU 的光线追踪器中得到广泛使用。<sup>[6](https://graphics.cg.uni-saarland.de/courses/cg1-2019/slides/CG03-SpatialIndex.pdf)</sup><sup> • </sup><sup>[13](https://graphics.stanford.edu/papers/gpu_kdtree/)</sup> 蒂亚戈·伊泽（Thiago Ize）及其同事 2008 年的一项研究表明，基于 BSP 的通用光线追踪器在各种场景中与最先进的 BVH 和 kd 树系统相比也很有竞争力。<sup>[14](https://doi.org/10.1109/rt.2008.4634637)</sup>

BSP 树也用于范围搜索。任何基于平面中 n 条不相交线段的端点构建的 BSP 树，都可以转换为针对这些线段本身的 BSP 树，且范围搜索效率几乎相同，支持常数复杂度凸查询范围的 ε-近似范围查询，其时间由与 ε-扩展范围相交的线段数决定；对于 R<sup>d</sup> 中 n 个对象的低密度场景，线性规模的 BSP 给出相同的查询行为。<sup>[15](https://www.sciencedirect.com/science/article/pii/S0925772105000672)</sup>

## 变体与后续用途

**面向对象的 BSP 树。** 对象 BSP 树在构造过程中使用层次椭球覆盖，相对传统形式减少了场景的碎片化；在这种修改后的结构上制定了对象组合、删除和运动的算法。<sup>[16](https://www.microsoft.com/en-us/research/publication/efficient-object-bsp-trees/)</sup>

**概率建模。** 范（Fan）、李（Li）和西森（Sisson）（2018）的 BSP-Tree 过程推广了 Mondrian 过程——一种用于空间划分的贝叶斯非参数先验，其轴对齐切割限制了灵活性。BSP-Tree 过程是一个几乎必然右连续的马尔可夫跳跃过程，在二维凸多边形中放置均匀分布的斜切割，在非均匀概率测度下扩展到方向区分切割，并用条件序贯蒙特卡洛进行推断；在合成划分和关系建模任务上，它相对标准 Mondrian 过程显示出明显的推断改进。<sup>[17](https://proceedings.mlr.press/v84/fan18b.html)</sup> 后续工作将 BSP-Tree 过程扩展到二维以上。<sup>[18](https://arxiv.org/abs/1903.09348)</sup>

**形状学习。** BSP-Net（2019）将这一结构借用到 3D 深度学习中：网络将形状重建为从基于一组平面构建的 BSP 树得到的一组凸体。推断出的凸体直接提取为[多边形网格](https://www.edgepedia.org/zh/polygon-mesh)，无需等值面化，产生适合锐利几何的紧凑低多边形网格，并保证水密且易于参数化。<sup>[19](https://arxiv.org/abs/1911.06971)</sup>

**其他领域。** 一种基于 BSP 的分割方案已应用于图像压缩，递归划分图像并将划分记录为二叉树。<sup>[20](https://arxiv.org/abs/1211.2037)</sup>

## References

1. [Bradley N. Bell (1989). Binary Space Partitioning Trees and Their Uses. NASA/Lyndon B. Johnson Space Center, GTSA 1989.](https://ntrs.nasa.gov/api/citations/19900011335/downloads/19900011335.pdf)
2. [William C. Thibault, Bruce F. Naylor (1987). Set operations on polyhedra using binary space partitioning trees. ACM SIGGRAPH Computer Graphics 21(4), 153–162.](https://doi.org/10.1145/37402.37421)
3. [The priority face determination tree for hidden surface removal, University of East Anglia](https://research-portal.uea.ac.uk/en/publications/the-priority-face-determination-tree-for-hidden-surface-removal/)
4. [Removing Depth-Order Cycles Among Triangles, Discrete & Computational Geometry (2019)](https://doi.org/10.1007/S00454-019-00102-0)
5. [Piotr Berman, Bhaskar DasGupta, S. Muthukrishnan (2002). Exact Size of Binary Space Partitionings and Improved Rectangle Tiling Algorithms. SIAM Journal on Discrete Mathematics 15(2), 252–267.](https://epubs.siam.org/doi/10.1137/S0895480101384347)
6. [kD-Trees, Saarland University Computer Graphics course slides](https://graphics.cg.uni-saarland.de/courses/cg1-2019/slides/CG03-SpatialIndex.pdf)
7. [P. van Oosterom (1990). A modified binary space partitioning tree for geographic information systems. Int. J. Geographical Information Systems 4(2).](https://www.tandfonline.com/doi/abs/10.1080/02693799008941535)
8. [Csaba D. Tóth. Binary space partition tree, lecture notes (UC Davis)](https://www.cs.ucdavis.edu/~amenta/w11/29toth.pdf)
9. [Binary Space Partitioning (BSP) Trees, CiteSeerX](https://citeseerx.ist.psu.edu/document?doi=d6207c3b3a928d32761a484498d7fd23838b72e9&repid=rep1&type=pdf)
10. [MIT 6.854 Lecture Notes: Randomized Incremental Constructions, BSP](https://courses.csail.mit.edu/6.854/20/Notes/n27-geometry.html)
11. [A Walk through BSP Trees, ScienceDirect](https://www.sciencedirect.com/science/article/pii/B9780125434577500267)
12. [Improved Binary Space Partition merging, Computer-Aided Design (ScienceDirect)](https://www.sciencedirect.com/science/article/abs/pii/S0010448508002030)
13. [Tim Foley, Jeremy Sugerman (2005). KD-Tree Acceleration Structures for a GPU Raytracer. Graphics Hardware 2005.](https://graphics.stanford.edu/papers/gpu_kdtree/)
14. [Thiago Ize et al. (2008). Ray tracing with the BSP tree.](https://doi.org/10.1109/rt.2008.4634637)
15. [Mark de Berg, Micha Streppel (2006). Approximate range searching using binary space partitions. Computational Geometry 33(3), 139–151.](https://www.sciencedirect.com/science/article/pii/S0925772105000672)
16. [Navendu Jain, Sorav Bansal, Sanjiv Kapoor (2000). Efficient Object BSP Trees. ICVGIP 2000, Microsoft Research](https://www.microsoft.com/en-us/research/publication/efficient-object-bsp-trees/)
17. [Xuhui Fan, Bin Li, Scott Sisson (2018). The Binary Space Partitioning-Tree Process. AISTATS, PMLR 84:1859–1867.](https://proceedings.mlr.press/v84/fan18b.html)
18. [Binary Space Partitioning Forests, arXiv:1903.09348](https://arxiv.org/abs/1903.09348)
19. [BSP-Net: Generating Compact Meshes via Binary Space Partitioning, arXiv:1911.06971](https://arxiv.org/abs/1911.06971)
20. [Time Complexity Analysis of Binary Space Partitioning Scheme for Image Compression, arXiv:1211.2037](https://arxiv.org/abs/1211.2037)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Numerical, string, and geometric algorithms › Computational geometry

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/binary-space-partitioning

English original: https://www.edgepedia.org/binary-space-partitioning
