algorithmic modeling for Rhino
surface divide
Tags:
Comment
Option Explicit
'Script written by Rogozinski Wladimir
'Script copyrighted Rogozinski Wladimir
'Script version 5 июля 2012 г. 17:07:04
Call UniformSurfasePoints()
Sub UniformSurfasePoints()
Dim strObject,arrEdgeCurve,ListText(0),ListValue(0),ListResult,Rows,dblLength,arrPointsX,arrPointsY
Dim arrParameter,i,j,IsoCurveX(),IsoCurveY(),arrSurfPnt()
strObject = Rhino.GetObject("Select surface or polysurface", 24)
Rhino.EnableRedraw(False)
Rows = 10
ListText(0) = "Number rows in structure"
ListValue(0) = CStr(Rows)
ListResult = Rhino.PropertyListBox(ListText, ListValue, "Settings: ","Surfase Properties")
If Not IsArray(ListResult) Then Exit Sub
If IsNumeric(ListResult(0)) Then
Rows = CInt(ListResult(0))
Else
Rows = 10
End If
Rows = Rows - 1
If Not IsNull(strObject) Then
arrEdgeCurve = Rhino.DuplicateEdgeCurves (strObject)
dblLength = Rhino.CurveLength(arrEdgeCurve(0)) / Rows
arrPointsX = Rhino.DivideCurveLength(arrEdgeCurve(0), dblLength)
End If
If Not IsNull(strObject) Then
arrEdgeCurve = Rhino.DuplicateEdgeCurves (strObject)
dblLength = Rhino.CurveLength(arrEdgeCurve(1)) / Rows
arrPointsY = Rhino.DivideCurveLength(arrEdgeCurve(1), dblLength)
End If
For i=0 To Rows
arrParameter = Rhino.SurfaceClosestPoint(strObject, arrPointsX(i))
ReDim Preserve IsoCurveX(i)
IsoCurveX(i) = Rhino.ExtractIsoCurve (strObject, arrParameter , 1)
Next
Rhino.DeleteObjects arrEdgeCurve
For i=0 To Rows
arrParameter = Rhino.SurfaceClosestPoint(strObject, arrPointsY(i))
ReDim Preserve IsoCurveY(i)
IsoCurveY(i) = Rhino.ExtractIsoCurve (strObject, arrParameter , 0)
Next
For i=0 To Rows
For j=0 To Rows
ReDim Preserve arrSurfPnt(j)
arrSurfPnt(j) = Rhino.CurveCurveIntersection(IsoCurveX(i)(0), IsoCurveY(j)(0))
Rhino.AddPoint arrSurfPnt(j)(0,1)
Next
Next
For i=0 To Rows
Rhino.DeleteObjects IsoCurveX(i)
Rhino.DeleteObjects IsoCurveY(i)
Next
Rhino.EnableRedraw(True)
End Sub
Why dont you just rebuild?
nice, thx ;)
thx ;)
Great work! Can you tell us a little how your new definition works?
how does this work? wow
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson. Powered by
You need to be a member of Grasshopper to add comments!