C# 클래스 AForge.Math.Geometry.ClosePointsMergingOptimizer

Shape optimizer, which merges points within close distance to each other.

This shape optimizing algorithm checks all points of a shape and merges any two points which are within specified distance to each other. Two close points are replaced by a single point, which has mean coordinates of the removed points.

Because of the fact that the algorithm performs points merging while it goes through a shape, it may merge several points (more than 2) into a single point, where distance between extreme points may be bigger than the specified limit. For example, suppose a case with 3 points, where 1st and 2nd points are close enough to be merged, but the 3rd point is a little bit further. During merging of 1st and 2nd points, it may happen that the new point with mean coordinates will get closer to the 3rd point, so they will be merged also on next iteration of the algorithm.

For example, the below circle shape comprised of 65 points, can be optimized to 8 points by setting MaxDistanceToMerge to 28.

상속: IShapeOptimizer
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
ClosePointsMergingOptimizer ( ) : System

Initializes a new instance of the ClosePointsMergingOptimizer class.

ClosePointsMergingOptimizer ( float maxDistanceToMerge ) : System

Initializes a new instance of the ClosePointsMergingOptimizer class.

OptimizeShape ( List shape ) : List

Optimize specified shape.

메소드 상세

ClosePointsMergingOptimizer() 공개 메소드

Initializes a new instance of the ClosePointsMergingOptimizer class.
public ClosePointsMergingOptimizer ( ) : System
리턴 System

ClosePointsMergingOptimizer() 공개 메소드

Initializes a new instance of the ClosePointsMergingOptimizer class.
public ClosePointsMergingOptimizer ( float maxDistanceToMerge ) : System
maxDistanceToMerge float Maximum allowed distance between points, which are /// merged during optimization (see ).
리턴 System

OptimizeShape() 공개 메소드

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