计算几何课堂:DCEL(双向边链表)
这里为单独介绍DCEL数据结构的讲解视频,这个数据结构隶属于几何寻路项目之中,关于其他算法,有兴趣的童鞋可以参考这个系列视频:计算几何课堂:几何寻路之旅
1. 视频章节:DCEL(双向边链表)
6.1 DCEl是什么?
6.2 例子:DCEL
6.3 基本操作
6.4 如何合并边
6.5 如何计算两边夹角
2. 拓展阅读
3. 附录:项目代码
个人作业项目代码:Algorithm
2.3.1.1 Vertex
Description | Entry File |
---|---|
Get all incident edges of the vertex | public List<HalfEdge> allIncidentEdges() |
Find the first ClockWise Edge with two vertices destination and origin | HalfEdge firstClockWiseEdge( Vertex origin ) |
Find the first CounterClockWise Edge with two vertices destination and origin | HalfEdge firstCounterClockWiseEdge( Vertex destination ) |
Connect two vertices by adding new half-edges | Face connect( Vertex v ) |
Re-connect half-edges incident to this vertex.(Duality Implementation) | void connect( List<HalfEdge> E ) |
2.3.1.2 Half-edge
Description | Entry File |
---|---|
Walk around all halfEdges connected to this one, and get vertices incident to them. | List<Vertex> walkAroundVertex() |
Walk around and get all halfEdges connected to this one. | List<HalfEdge> walkAroundEdge() |
Split the edge into two parts | Vertex split( Vertex split ) |
Get all inner faces bounded by this half-edge, but not including holes. | Collection<HalfEdge> getInners() |
Sort half-edges in clock wise order with the point i as the center. | List<HalfEdge> sortInClockWise( List<HalfEdge> E, Vector i ) |
2.3.1.3 Face
Description | Entry File |
---|---|
Walk around all halfEdges, starting at this face and get visited halfEdges. | List<HalfEdge> walkAroundEdge() |
Walk around all halfEdges, starting at this face and get visited vertices. | List<Vertex> walkAroundVertex() |
Is the point inside this convex hull? but excluding the boundary. | boolean isInsideConvexHull( Vector p ) |
Is the point on this convex hull? including the boundary. | boolean isOnConvexHull( Vector p ) |
Is the point inside This Polygon? | boolean isInsidePolygon( Vector p ) |
Is the point On This Polygon? | boolean isOnPolygon( Vector p ) |
4. 参考资料
- 计算几何 | Computational Geometry
- Computational Geometry: Algorithms and Applications
- Simple Stupid Funnel Algorithm
5. 免责声明
※ 本文之中如有错误和不准确的地方,欢迎大家指正哒~
※ 此项目仅用于学习交流,请不要用于任何形式的商用用途,谢谢呢;