C# Class Accord.Math.Geometry.FlatAnglesOptimizer

Shape optimizer, which removes obtuse angles (close to flat) from a shape.

This shape optimizing algorithm checks all adjacent edges of a shape and substitutes any 2 edges with a single edge if angle between them is greater than MaxAngleToKeep. The algorithm makes sure there are not obtuse angles in a shape, which are very close to flat line.

The shape optimizer does not optimize shapes to less than 3 points, so optimized shape always will have at least 3 points.

For example, the below circle shape comprised of 65 points, can be optimized to 10 points by setting MaxAngleToKeep to 160.

Inheritance: IShapeOptimizer
Mostra file Open project: accord-net/framework

Public Methods

Method Description
FlatAnglesOptimizer ( ) : System

Initializes a new instance of the FlatAnglesOptimizer class.

FlatAnglesOptimizer ( float maxAngleToKeep ) : System

Initializes a new instance of the FlatAnglesOptimizer class.

OptimizeShape ( List shape ) : List

Optimize specified shape.

Method Details

FlatAnglesOptimizer() public method

Initializes a new instance of the FlatAnglesOptimizer class.
public FlatAnglesOptimizer ( ) : System
return System

FlatAnglesOptimizer() public method

Initializes a new instance of the FlatAnglesOptimizer class.
public FlatAnglesOptimizer ( float maxAngleToKeep ) : System
maxAngleToKeep float Maximum acceptable angle between two edges of a shape (see ).
return System

OptimizeShape() public method

Optimize specified shape.
public OptimizeShape ( List shape ) : List
shape List Shape to be optimized.
return List