计算几何 W47 Voronoi Diagrams and 3D Convex Hull
Voronoi Diagrams
points .
Nearest neighbor problem
举一个具象化的例子:
post offices
Find the closest post office
For which region, point is the closest point?
What is the region that servies?
(对于二维空间使用欧几里得距离定义的距离)两个最近点对连线线段的中垂线就是分界。
Definition of Voronoi Diagrams
A set of points
decomposition of into regions .
for any , is the closest point
Theorems
Cells of the Voronoi diagram of are convex.
Proof:
Consider . Draw the bisector of and let be the half space the contains the side of the bisector that includes . The cell of is the intersection of all ’s.
If not all points of lie on a line, the Voronoi diagram is made of straight line segments or rays and it is connected.
- the cells are convex regions from the previous proof
- the finite cells are polygons
- if there is a full line , then it implies that no bisector intersects , which means all points lie on a line.
The size of a planar Voronoi diagram is linear.
Proof:
: number of edges in Voronoi graph, : number of vertices in Voronoi graph, : size infinite cell
Euler’s Formula:
For infinite edges:
- put a bounding box,加入边界盒后的点数为 ,边数为 ,面数为 .
- one for each input point + outside
- all vertices have degree three, except four special corner vertices
一顿推导,得出:
Computing 2D Voronoi Diagrams
idea: sweep line
problem: the next point, can totally change everything above the sweep line.
we cannot assume we have compute the diagram above the sweep line correctly.
idea: define a region above the sweep line that we know is stable. Anything in this region is closer to than any point below the line i.e. cell of above the curve is stable.
sweep line:
curve:
Initially, all the Y-coordinates are the event points.
挨着向下扫描,在扫描线上方的点,两两之间用中垂线 bisector 分隔开,扫描线上方的点和扫描线用抛物线分隔开。这样得到的区域就是稳定的。
Other event points are when parabola segment disappear.
Can be found by checking three adjacent parabola segments.
We need a data structure for inserting and deleting parabola segments i.e., a balanced BST.
running time:
pere event points
events points (since size of the diagram is linear)
Generalization of Voronoi Diagrams
farthest point Voronoi diagram
higher order nearest neighbor
-order: same set of nearest neighbors
different distance measure
segments, curves etc.
distance based on shape enlarging
Triangulations
Let be set of points in
Theorem: Any trangulation of has triangles and edges.
is number of edges on Convex Hull of .
edge is illegal if .
Observation: Let be an illegaal edge of , let be triangulation obtained from by flipping , then
Pseudo code for legal triangulation:
while contains illegal edge
let and be the other points in the triangles incident to
remove and add
return
The Delaunay Triangulation
Let be set of points in , let be the Voronoi diagram of .
Let be the dual graph of , is the Delaunay graph of . 沃诺依图的对偶图是德劳内三角剖分
Theorem: is a plane graph
Assume that is in geneal position: no four points cocircular, not three points colinear.
Theorem:
- are vertices of the same face of circle through contains no other point of in its interior.
- from an edge of there is a closed disk that contains and on its boundary and doesn’t contain any other point of
Computing Delaunay Triangulation
using randomized incremental construction
as with point location, we maintain and a point location data structure .
3D Convex Hull
convex hull ofo points in
composed of
- vertices
- edges
- faces
Complexity of a 3D CH is linear
- 假设边是“线”: 在计算几何的上下文中,这里的“线”指的是 3D 凸包的边。 这些边形成凸包的边界。
- 从放置在凸包顶点顶部的光源投射边缘的阴影: 想象一下,您有一个光源直接位于凸包最高点(顶点)上方。 现在,将每条边的阴影投影到凸包下方的平坦表面上。 这类似于物体在光照射下投射的阴影。
- 由于凸性,边缘的阴影不会交叉: 因为根据定义,凸包是凸形状,因此当投影到平面上时,其边缘的阴影不会相交或相互交叉。 该特性是船体凸度的直接结果。
- 由于我们是从不在凸包外部的点进行投影: 投影是从凸包内部的点(具体来说,在最高顶点的顶部)完成的。 这确保了阴影投射在凸包内而不是外部。
Gift Wrapping for 3DCH
wrap a plane around the convex hull
- project the points to 2D, find the 2D CH
- an edge of 2D CH is a starting point
- perform a DFS on the faces. (the face is marked so we don’t visit it again)
time, is number of points, is output size.
Randomized Incremental Algorithm for 3DCH
- randomly shuffle the points
- create the convex hull of the first four points
- for insert
adding :
- faces visible from should be removed
- new faces should be added, touching the boundary of the formerly visible faces
an edges is a boundary edge if out of two faces next to it one is visible but the other is not.
to find the visible faces
- for every point maintain a list of faces visible from
- for every face maintain a list of points visible from
- for every face place a point and back to the pointer .
the points that can see , is a subset of points that can see and ,
如果一个点能同时看到两个相邻的面,那么这个点一定在这两个面延长面共同的上方。
if is the list of faces visible from then adding takes time asymptotically
i.e. on average.
expected running time