Option Explicit
‘Script written by <Marina Cisneros and Olivera Grk>
‘Script version Friday, 16 October 2009 14:11:31
Call Main()
Sub Main()
Dim polygons
Dim crack
Dim i, j
polygons = rhino.GetObjects (“get polygons”,4)
crack = rhino.getobjects (“sel pts”,1)
crack = rhino.PointCoordinates (crack)
For i=0 To ubound(polygons)
Dim vertex
vertex = Rhino.CurvePoints (polygons(i))
Dim vector()
ReDim vector(ubound(crack))
Dim length
Dim scale
Dim totvector
For j=0 To ubound(vertex)
For h=0 To ubound(crack)
vector(h) = rhino.VectorCreate (vertex(j),crack(h))
totvector = Rhino.VectorAdd (totvector, vector(h))
length = Rhino.VectorLength (totvector)
totvector = Rhino.VectorUnitize (totvector)
scale= 100/length
totvector= Rhino.VectorScale (totvector, scale)
Next
vertex(j) = rhino.pointadd (vertex(j), totvector)
Next
Rhino.Addpolyline vertex
Next
End Sub