Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I have this issue while scripting in vb.net when creating a line with two points.

I am creating a k-d tree (not kraft dinner) script and am outputting the representation of the tree as a list of lines.

My issue is sometimes I try to create a line between two points, and I get a line between the last parent node and 0,0,0. ( I have attached an image of the output to show the error. Nodes, 2, 10, and 9 connect to 0,0,0 but they shouldn't.

I am assuming that if the line constructor doesn't receive a valid point, it assumes the world origin as a point?

If so, what is the syntax for checking to see whether a point3d variable is not valid?

Below was my attempt at checking it but I recieved this error. 

Error: 'IsNot' requires operands that have reference types, but this operand has the value type 'Rhino.Geometry.Point3d'. (line 139)

------------------------------------
If ptChildBelow IsNot Nothing Then  ' this what I wan't done

      Dim lineA As New Line(ptParent, ptChildBelow)
      listLines.Add(lineA)
End If

-------------------------------------

Thanks in advance for the help, and I uploaded my definition in case it's useful for anyone.

Views: 1566

Attachments:

Replies to This Discussion

I could be mistaken but try

If not ptChildBelow.isValid then...
Oops I meant

If ptChildBelow.isValid then...

Thanks Brian, that's what I was looking for!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service