Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. 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))
  2. Dim ret As New List(Of KeyValuePair(Of Point, ITrimmedCurve))
  3.  
  4. Dim firstCurve = True
  5. For Each cv In cList
  6. Dim pl = GetPolyline(cv, maxStep, noBorders, maxStepCount)
  7. If cv.IsReversed Then pl.Reverse()
  8. If Not firstCurve And Not noBorders Then
  9. If New Separation(ret.Last.Key, pl.First).Distance < maxStep Then
  10. pl.RemoveAt(0)
  11. End If
  12. End If
  13. For plI = 0 To pl.Count - 1
  14. ret.Add(New KeyValuePair(Of Point, ITrimmedCurve)(pl(plI), cv))
  15. Next
  16. firstCurve = False
  17. Next
  18.  
  19. If ret.Count > 1 AndAlso (ret.Last.Key - ret.First.Key).Magnitude < maxStep / 2 Then ret.RemoveAt(ret.Count - 1)
  20.  
  21. Return ret
  22. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement