Topology2D Type
A type containing only static member functions for 2D topological operations.
Static members
| Static member |
Description
|
Full Usage:
Topology2D.join (getLine, splitDistance, xs)
Parameters:
'T -> Line2D
splitDistance : float
xs : ResizeArray<'T>
Returns: ResizeArray<ResizeArray<'T>>
|
Returns the groups of consecutive elements, loops or polylines. They are split where the distance between the end point of one element and the start point of the next element is greater than 'splitDistance'. For each element it will compute a line given the 'getLine' function. The Line2D is used as an abstraction to hold start and end of arbitrary object. Then for each line start and end point it finds the next closest line end or start point respectively. Only start with end or end with start points are considered. If the distance between two points is greater than the 'splitDistance' it will be considered as a new group.
|
Full Usage:
Topology2D.joinReversing (getLine, splitDistance, xs)
Parameters:
'T -> Line2D
splitDistance : float
xs : ResizeArray<'T>
Returns: ResizeArray<ResizeArray<'T * bool>>
|
Returns the groups of consecutive elements, loops or polylines. They are split where the distance between the end point of one element and the start point of the next element is greater than 'splitDistance'. For each element it will compute a line given the 'getLine' function. The Line2D is used as an abstraction to hold start and end of arbitrary object. Then for each line start and end point it finds the next closest line end or start point respectively. Start points can match with start points and end points can match with end points too. If the distance between two points is greater than the 'splitDistance' it will be considered as a new group. The result will be a list of lists of 'T and a Boolean values indicating if the element was reversed.
|
Full Usage:
Topology2D.sortToLoop (getLine, xs)
Parameters:
'T -> Line2D
xs : ResizeArray<'T>
|
Sorts elements in place to be in a circular structure. This does not recognize if there are actually two loops, not just one. Use Topology2D.join instead. For each line end point it finds the next closest line start point. (Does not check other line end points that might be closer) Line2D is used as an abstraction to hold start and end of arbitrary object.
|
Full Usage:
Topology2D.sortToLoopWithReversing (getLine, reverseInPlace, xs)
Parameters:
'T -> Line2D
reverseInPlace : int -> 'T -> unit
xs : ResizeArray<'T>
|
Sorts elements in place to be in a circular structure. This does not recognize if there are actually two loops, not just one. Use Topology2D.joinReversing instead. For each line end it finds the next closest start point or end point. Line2D is used as an abstraction to hold start and end of arbitrary object. Reverses the input in place where required. e.g. the reverseInPlace function might just update an item at the given index in the array. Depending on the structure of 'T the index might not be needed to reverse an element in place.
|
Euclid