./features/reapproximate polygonal contours
Download Features Source code Forum Ask for support

Reapproximate polygonal contours

This functionality was first developed as a part of "Contour Capture" algorithm aimed at extracting a piece of 2-dimensional hull. The purpose of contour reapproximation is to decrease the complexity of the contour and this way make it more appropriate for subsequent modeling operations.

Contour reapproximation is a multi-stage process. First, the input contour is segmented based on the accumulated angle criterion. As a result, straight segments are kept at their maximum possible length, and a new segment is only started when the contour locally changes its direction. The second stage is approximation as such. All accumulated segments are turned into non-rational spline curves.

To reapproximate a contour, make sure it is loaded into the active part of Analysis Situs. Once there, perform re-approx-contour Tcl command.

You can make segmentation explicit in the viewer by passing the optional -diagnostics key to the command. The green ball glyphs depict the inserted breakpoints where a new contour gets its vertices.

For better control over segmentation, use the optional -ang key followed by the barrier angle specified in degrees.