aewallin/openvoronoi — pull request #6 by kaben (2012-01-28 21:50:14+00:00)
Title: Cpp medial axis

Hi Anders,

This is mostly to provide C++ access to MedialAxis and MedialAxisWalk. It also provides C++ access to PolygonInterior (by removing the #include , which wasn't being used anymore).

It also adds optional constructor arguments to MedialAxis and MedialAxisWalk. The MedialAxis argument "dp_thr" specifies a dot-product threshold for deciding whether consecutive edges are nearly parallel. The MedialAxisWalk argument "edge_pts" specifies the number of points to use when subdividing parabolas.

(It turns out that "edge_pts" doesn't help much: as you note in the code, some parabolic edges can be rendered with a small number of points, and some require more. It would be better to compute the number of points needed to satisfy some criterion for smooth rendering, and then this "smoothness" criterion could be specified instead.)

Finally, there's a segfault bug triggered on my copy of Lucid when performing operations on an edge's twin, when the twin is null. The null condition can be checked via "if ( twin == HEEdge() )". Note that "operator =(HEEdge &)" is one of the operations that segfaults. This means VoronoiDiagramChecker::check_edge() segfaults, since it uses "operator =" before it performs the null check. This looks like a regression, but I don't understand VoronoiDiagramChecker very well yet, so I didn't try to make any changes.

-- K