Grasshopper

algorithmic modeling for Rhino

Hi, I'm trying to figure out how to add a kink at a specifiv nurb control vertice.

Using a bit of code ripped from the primer:

Private Sub RunScript(ByVal CPoints As List(Of On3dPoint), ByVal y As Integer, ByVal x As Integer, ByVal z As Integer, ByRef A As Object, ByRef B As Object, ByRef C As Object, ByRef D As Object)
   
    Dim dimension As Integer = 3
    Dim order As Integer = 4
    Dim nc As New OnNurbsCurve
    nc.CreateClampedUniformNurbs(dimension, order, CPoints.ToArray())

    'Add kink
    Dim cv As New On3dPoint(0, 0, 0)
    nc.GetCV(x + 1, cv)
    nc.InsertKnot(x, 3)
    nc.SetCV(x + 2, cv)
    '/Add kink
   
    If (nc.IsValid() ) Then
      A = nc
    End If

  End Sub


That worked, but mostly out of an trial and error process. I would appreciate if someone who actually knows how it works could explain how it should be done.

/Cheers

Views: 155

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service