Delaunay 2D算法
来源:互联网 发布:数据库er图讲解 编辑:程序博客网 时间:2024/06/07 15:47
Delaunay 2D算法
整个算法的流程如下所示:
Incremental Delaunay Triangulation. 1 Construct an initial triangle, which is large. 2 Randomly generate a point p in the unit square. 3 InsertVertex(p). 4 Repeat step 2 and 3
整个算法的关键在于insertVertex函数
InsertVertex(p) 1 pFace = LocatePoint(p) 2 FaceSplit( pFace ) 3 Legalize three edges of the original pFace.
inCircle函数
用于判断P是否位于三角形
若位于三角形
locatePoint函数
首先,三角形的面积计算如下:
Given a triangle [v0,v1,v2] with vi = (xi,yi), the area is given by
对于一个三角形
可见,每个
Face * LocatePoint( Point p) 1 Arbitrarily choose the initial face [vi,vj,vk] 2 Compute the barycentric coordinates of p with respect to current face. 3 If αi,αj,αk are non-negative, then return the current face. 4 Suppose αi is negative, get the face adjacent to the current face sharing edge [vj,vk], denote as F ˜ 5 If F ˜ is empty, return NULL. The point is outside the whole range. 6 Set current face to be F ˜, repeat through step 2
faceSplit函数
将p所在的face分割
edgeSwap函数
legalizeEdge函数
Suppose e = [v0,v1], the vertex against v is v2, compute the circum circle c through v,v0,v1. 2 If v2 is outside c, then return false. 3 EdgeSwap(e) 4 Recursive call LegalizeEdge(v,[v1,v2]); 5 Recursive call LegalizeEdge(v,[v0,v2]); 6 return true.
运算结果:
调用函数:
1000个随机点:
阅读全文
0 0
- Delaunay 2D算法
- 2D Delaunay Refinement (2D Delaunay 细化)
- d-dimensional Delaunay
- 一个开源的2D Delaunay Triangulator—Triangle
- Delaunay Triangulation算法学习
- Delaunay Triangulation算法学习
- Delaunay三角剖分算法
- Delaunay三角剖分算法
- Delaunay三角剖分算法
- Delaunay三角剖分算法
- Delaunay三角剖分算法
- Delaunay三角剖分算法
- Delaunay三角剖分算法
- Delaunay算法简介及实现
- Delaunay三角剖分算法
- 三角剖分算法(delaunay)
- Delaunay三角剖分算法
- Delaunay三角剖分算法
- SystemUI analysis---系统Notification数据生成流程
- 物理层
- javascript中的深复制方法一:jQuery中的extend方法
- Java网络编程之Netty拆包和黏包-yellowcong
- ubuntu 16.04 安装MySQL Workbench
- Delaunay 2D算法
- STM32硬件错误HardFault_Handler的处理方法
- hdu 3689 Infinite monkey theorem
- python小案例 随机数 冒泡排序 字符串的列表的使用
- rabbitmq重启丢失用户信息
- android杀不死的Service
- 就是这个软件,我和我男朋友分手了
- 刷题_01
- Shell 脚本