Implementation of some computational geometry algorithms.
Simple incremental algorithm with dynamic search cache.
- Create superstructure.
- Perform step 3-4 for each node from input.
- Add node to triangulation.
- Find triangle in which falls this node (or on rib).
- If node lies in epsilon-neighborhood of any vertex of triangle - ignore this node.
- If node fall on rib, then this rib splits on two new, and each triangle adjacent with this rib also splits in two new.
- If node falls in triangle - split this triangle in three new.
- Check Delaunay condition for new triangles and perform required changes.
Graham scan.
- Let p0 - point from set of points Q with minimal Y-axis coordinate, or leftmost if exist matching.
- Let p1, p2, ..., pm - rest of the points of Q, sorted by polar angle that measured counterclockwise relative to the point p0.
- Add p0 to hull.
- Add p1 to hull.
- For each point cur in p3..pm:
- Let a - penultimate added point in hull.
- Let b - last added point in hull
- While axis b-a & b-cur forms left-handed coordinate system remove last added point from hull.
- Add cur to convex hull.