Grasshopper

algorithmic modeling for Rhino

I updated the formatting code in this forum. If you wrap the codeblocks in the CODE style the code should standout. You can use spaces for indenting.

 

Private Sub RunScript(ByVal inPts As List(Of On3dPoint), ByVal sPts2 As On3dPoint, ByRef A As Object)
  If (inPts.Count = 0) Then Return
  Dim points As On3dPoint() = inPts.ToArray()
  Dim distances As Double()
  ReDim distances(inPts.Count-1)
  For i As Integer = 0 To points.Length - 1
      distances(i) = inPts(i).DistanceTo(sPts2)
  Next

  Array.Sort(distances, points)

  A = points 'Returns an array of points, sorted by distance.
End Sub



Hopefully this helps the clearify posts.

Views: 175

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service