Grasshopper

algorithmic modeling for Rhino

Hello everyone !

I'm completely  new in coding and i'm trying to make an iterative 3D tree with python but i'm blocked here:

import rhinoscriptsyntax as rs

line = rs.GetObject("pick line")
ang = rs.GetReal("type angle",35.0)
ang1 = rs.GetReal("type angle",120.0)
scale = rs.GetReal("type angle",0.9)

startPt = rs.CurveStartPoint(line)
endPt = rs.CurveEndPoint(line)
vec = rs.VectorCreate(endPt, startPt)
baseP = rs.PlaneFromNormal (startPt, vec)

print baseP

it returns me: Origin=4,2,0 XAxis=1,0,0, YAxis=0,1,0, ZAxis=0,0,1

After that i want to rotate the "vec" vector with the VectorRotate command and give the ZAxis value to it. How can i retrieve the ZAxis from the BaseP ??

Thanks and if someone is a very big newbee like me in coding, watch the EncodedMatters tutorials from Ezio Blasetti, there are really good ! 

Views: 3159

Replies to This Discussion

Hi Ivo,

It's because I am too lazy to look at the whole code.
You should replace the:

    allGenerations.extend(newGeneration)

with:

    allGenerations.extend(newPoints)

The same goes for the upper tree component.

Check the attached file for "a" and "b" points, lines output.
If dataTrees confuse you (allLines, allGenerations) check this topic.

Attachments:

Thank you very much Djordje for taking of your time to help me !!

It's very tricky to understand how to proceed !! Thanks again !

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