Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Shared Function GetPolylineDict(cList As List(Of ITrimmedCurve), maxStep As Double, Optional noBorders As Boolean = False, Optional maxStepCount As Double = Double.PositiveInfinity) As List(Of KeyValuePair(Of Point, ITrimmedCurve))
- Dim ret As New List(Of KeyValuePair(Of Point, ITrimmedCurve))
- Dim firstCurve = True
- For Each cv In cList
- Dim pl = GetPolyline(cv, maxStep, noBorders, maxStepCount)
- If cv.IsReversed Then pl.Reverse()
- If Not firstCurve And Not noBorders Then
- If New Separation(ret.Last.Key, pl.First).Distance < maxStep Then
- pl.RemoveAt(0)
- End If
- End If
- For plI = 0 To pl.Count - 1
- ret.Add(New KeyValuePair(Of Point, ITrimmedCurve)(pl(plI), cv))
- Next
- firstCurve = False
- Next
- If ret.Count > 1 AndAlso (ret.Last.Key - ret.First.Key).Magnitude < maxStep / 2 Then ret.RemoveAt(ret.Count - 1)
- Return ret
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement