Skip to content

iSvB/cgeo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cgeo

Implementation of some computational geometry algorithms.

Delaunay triangulation

Simple incremental algorithm with dynamic search cache.

  1. Create superstructure.
  2. Perform step 3-4 for each node from input.
  3. Add node to triangulation.
  4. Find triangle in which falls this node (or on rib).
  5. If node lies in epsilon-neighborhood of any vertex of triangle - ignore this node.
  6. If node fall on rib, then this rib splits on two new, and each triangle adjacent with this rib also splits in two new.
  7. If node falls in triangle - split this triangle in three new.
  8. Check Delaunay condition for new triangles and perform required changes.

alt tag

Convex hull

Graham scan.

  1. Let p0 - point from set of points Q with minimal Y-axis coordinate, or leftmost if exist matching.
  2. Let p1, p2, ..., pm - rest of the points of Q, sorted by polar angle that measured counterclockwise relative to the point p0.
  3. Add p0 to hull.
  4. Add p1 to hull.
  5. For each point cur in p3..pm:
  6. Let a - penultimate added point in hull.
  7. Let b - last added point in hull
  8. While axis b-a & b-cur forms left-handed coordinate system remove last added point from hull.
  9. Add cur to convex hull.

alt tag

About

Implementation of some computational geometry algorithms: computing Delaunay triangulation & convex hull.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages