Table of Contents

Class FindPathThroughForbiddenArea

Namespace
CADability
Assembly
CADability.dll

Class to find a polyline between two points that does not cross the forbidden area

public class FindPathThroughForbiddenArea
Inheritance
FindPathThroughForbiddenArea
Inherited Members

Constructors

FindPathThroughForbiddenArea(BoundingRect[])

Constructor to define the forbidden area

public FindPathThroughForbiddenArea(BoundingRect[] forbiddenArea)

Parameters

forbiddenArea BoundingRect[]

Rectangle which may not be crossed

Methods

ContainsPoint(GeoPoint2D)

Tests whether the provided point toTest is contained in one of the rectangles

public bool ContainsPoint(GeoPoint2D toTest)

Parameters

toTest GeoPoint2D

Point to test

Returns

bool

true if contained, false otherwise.

ContainsPoint(GeoPoint2D, double)

public bool ContainsPoint(GeoPoint2D toTest, double xyOffset)

Parameters

toTest GeoPoint2D
xyOffset double

Returns

bool

FindPath(GeoPoint2D, GeoPoint2D, double)

Finds a polyline which connects startPoint and endPoint and returns the intermediate points. The resulting polyline does not cross the forbidden area

public List<GeoPoint2D> FindPath(GeoPoint2D startPoint, GeoPoint2D endPoint, double xyOffset)

Parameters

startPoint GeoPoint2D

The polyline starts here

endPoint GeoPoint2D

the polyline end here

xyOffset double

Distance to keep from the forbidden areas: the forbidden areas are inflated by this value

Returns

List<GeoPoint2D>

Intermediate points to go around the forbidden area

PolyLineHitTest(GeoPoint2D[])

Tests whether the provided polyline interferes with one of the rectangles

public bool PolyLineHitTest(GeoPoint2D[] toTest)

Parameters

toTest GeoPoint2D[]

The polyline

Returns

bool

true when the polyline and one of the rectangles interfere, fals otherwise

PolyLineHitTest(GeoPoint2D[], double)

public bool PolyLineHitTest(GeoPoint2D[] toTest, double xyOffset)

Parameters

toTest GeoPoint2D[]
xyOffset double

Returns

bool