Catalano.Math.Geometry
Class FlatAnglesOptimizer
- java.lang.Object
-
- Catalano.Math.Geometry.FlatAnglesOptimizer
-
- All Implemented Interfaces:
- IShapeOptimizer
public class FlatAnglesOptimizer extends java.lang.Object implements IShapeOptimizer
Shape optimizer, which removes obtuse angles (close to flat) from a shape.
-
-
Constructor Summary
Constructors Constructor and Description FlatAnglesOptimizer()Initializes a new instance of theclass. FlatAnglesOptimizer(float maxAngleToKeep)Initializes a new instance of theclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description floatgetMaxAngleToKeep()Maximum angle between adjacent edges to keep in a shape, [140, 180].java.util.List<IntPoint>OptimizeShape(java.util.List<IntPoint> shape)Optimize specified shape.voidsetMaxAngleToKeep(float maxAngleToKeep)Maximum angle between adjacent edges to keep in a shape, [140, 180].
-
-
-
Constructor Detail
-
FlatAnglesOptimizer
public FlatAnglesOptimizer()
Initializes a new instance of theclass. Default value is set to 160.
-
FlatAnglesOptimizer
public FlatAnglesOptimizer(float maxAngleToKeep)
Initializes a new instance of theclass. Default value is set to 160. - Parameters:
maxAngleToKeep- Maximum acceptable angle between two edges of a shape (see).
-
-
Method Detail
-
getMaxAngleToKeep
public float getMaxAngleToKeep()
Maximum angle between adjacent edges to keep in a shape, [140, 180].- Returns:
- Angle.
-
setMaxAngleToKeep
public void setMaxAngleToKeep(float maxAngleToKeep)
Maximum angle between adjacent edges to keep in a shape, [140, 180].- Parameters:
maxAngleToKeep-
-
OptimizeShape
public java.util.List<IntPoint> OptimizeShape(java.util.List<IntPoint> shape)
Description copied from interface:IShapeOptimizerOptimize specified shape.- Specified by:
OptimizeShapein interfaceIShapeOptimizer- Parameters:
shape- Shape to be optimized.- Returns:
- Returns final optimized shape, which may have reduced amount of points.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG