Grasshopper

algorithmic modeling for Rhino

I have a curve, I draw perpendicular planes (frames) and in each plane I want to put a point using polar coordinates.

My first attempt to do this was doing point at parameter curve, then move point by frames.Xaxis . But I could not.

Now I tried to do it by points in polar coordinates in the plane WorldXY to orient points to plane frames. But it does not work for me.

Could anyone tell me I'm wrong?

   For i as int32 = 0 To N - 2
      Dim t As Transform = transform.ChangeBasis (plane.WorldXY, frames.item (i))
      pts.item (i) .transform (t)
      newpts.add (pts.item (i))
    Next

The result is newpts in its original position (of pts, so no change). However, if I print t, get this information, which makes me conclude that there is a transformation, but does not apply to pts.
      
0. R0 = 0. (0.978619276538596,0.205680119571811,0, -0.835499479690299), R1 = (- 0.139260647800845,0.662597603914643,0.735915000024231, -0.484446574911868), R2 = (0.151363085199673, -0.720180604917613,0.67707393447048,0.526547372506406), R3 = (0,0,0 , 1)


1. R0 = (0.980103168397586,0.198342718995972,0.00761216909280271, -0.833997919373362), R1 = (- 0.150647997457897,0.718355747671146,0.679168757121347, -0.501880684937877), R2 = (0.129239932524504, -0.666802208761424,0.733942677756205, -0.0974402469745317), R3 = (0,0, 0.1)


(...)

Any help please?

Thx.

Views: 259

Replies to This Discussion

This is the problem:

pts.item (i) .transform (t)

Point3d is a Structure, not a Class. Thus, when you access one in a list, you're given a copy of the original point. Then you transform that copy, but not the original.

Dim pt As Point3d = pts(i)

pt.Transform(Transform.PlaneToPlane(Plane.WorldXY, frames(i))

pts(i) = pt

I see.
Thank you :)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service