Grasshopper

algorithmic modeling for Rhino

I have problem in script from proving ground (http://theprovingground.wikidot.com/scripts-structure) in my grass 8.0063 panelling dont fit to surface i have look at script and dont know what is wrong any ideas ?

script:

Private Sub RunScript(ByVal Srf As Surface, ByVal U As Integer, ByVal V As Integer, ByRef Wires As Object)

    Dim lines As New List (Of Line)

    Dim ustep As Double = 1 / u
    Dim vstep As Double = 1 / v

    For i As Integer = 0 To u - 1
      For j As Integer = 0 To v - 1

        Dim ptA As Point3d = srf.PointAt(i * ustep, j * vstep)
        Dim ptB As Point3d = srf.PointAt((i + 1) * ustep, j * vstep)
        Dim ptC As Point3d = srf.PointAt((i + 1) * ustep, (j + 1) * vstep)
        Dim ptD As Point3d = srf.PointAt(i * ustep, (j + 1) * vstep)
        Dim mpt As Point3d = srf.PointAt((i * ustep) + (0.5 * uStep), (j * vstep) + (0.5 * vstep))

        Dim lnA As Line = New Line(ptA, mpt)
        Dim lnB As Line = New Line(ptB, mpt)
        Dim lnC As Line = New Line(ptC, mpt)
        Dim lnD As Line = New Line(ptD, mpt)

        lines.Add(lnA)
        lines.Add(lnB)
        lines.Add(lnC)
        lines.Add(lnD)

      Next
    Next

    Wires = lines
  End Sub

Views: 272

Attachments:

Replies to This Discussion

Hi John,

 

I haven't tried setting everything up, but if you 'reparametrize' the surface (to do so, right click the surface parameter that is green in your screenshot), does the script work?

Thanks,

 

- Giulio
________________
giulio@mcneel.com

good point ! Its working now :), thanks for help !!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service