Grasshopper

algorithmic modeling for Rhino

Hello,

I am having difficulties.

I want an accumulation of polyline curves. They also need to move and rotate.
example with repetitions = 2:

INPUT :
A B C D

OUTPUT (I want):
A with displacement and rotation
A with another displacement and rotation
A B  with displacement and rotation
A B  with another displacement and rotation
A B C  with displacement and rotation
A B C  with another displacement and rotation
A B C D  with displacement and rotation
A B C D  with another displacement and rotation

My problem (I have):
I only get the last polyline curve.
I get :
D with displacement and rotation
D with displacement and rotation
D with displacement and rotation
D with displacement and rotation

Everything seems fine when I look at the resulting curves BEFORE the output. The problem seems at       A = curvelist...
There is probably a story with the all the flattens.


I am completely lost lost lost...

°°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°°
      Dim curvee As OnCurve
      Dim o As New Integer
      Dim q As New Integer
      Dim anglebase As New Double
      Dim vectorr As New On3dVector
      Dim curvelist As New List(Of OnCurve)
      Dim center As New On3dPoint
      center.x = 0
      center.y = 0
      center.z = 0

      o = geometry.Count
      q = vector.Count

      anglebase = 360 / repetitions

      For zzz As Integer = 0 To q / repetitions - 1
        For jj As Integer = 0 To repetitions - 1
          For oo As Integer = 0 To (p - 1) Mod o
            curvee = geometry(oo)

            move_rotate(0, anglebase * jj, curvee, center)

            curvelist.Add(curve)

          Next
        Next
      Next

      A = curvelist
      p = p + 1

°°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°°

Here is the code for "move_rotate". It directly comes from :


°°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°° °°°°

  Dim p As Integer = 1

  Sub move_rotate(ByVal dblZ_amount As Double, ByVal dblRotationAngle As Double, ByVal _
    ObjectToMove As OnCurve, ByVal pntCenter As On3dpoint)'As OnNurbsCurve


    Dim move_xform As New OnXform
    move_xform.Translation(0, 0, dblZ_amount)

    Dim vertZ_axis As New On3dVector(0, 0, 1)
    Dim rotate_xform As New OnXform

    rotate_xform.Rotation(dblRotationAngle, vertZ_axis, pntCENTER)
    ObjectToMove.Transform(move_xform)
    ObjectToMove.Transform(rotate_xform)

  End Sub

Views: 237

Attachments:

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service