Grasshopper

algorithmic modeling for Rhino

hey guys,

can you tell me why im not getting a circle returned into circle


  Dim intCirc As New Circle

    Dim sp1 As New Sphere(x, z)
    Dim sp2 As New Sphere(y, z)

    'Dim ti As Double, tj As Double
    Dim j As Boolean = Rhino.Geometry.Intersect.Intersection.spheresphere(sp1, sp2, intCirc)

circle = intCirc


thanks

Views: 420

Replies to This Discussion

Well, what I think is happening is that you've named your out variable the same as the actual type itself. Therefore the interpreter/compiler is getting confused as to whether you're talking about your variable "circle" or the class "Circle". Since VB.Net is NOT case sensitive there's no difference between the two, even when have one be a lowercase "c" (which would work in C#). So, long and short, rename your out variable and you'll be fine...

Except that it appears that this method isn't working correctly. The method is outputting a circle, but its invalid with a center point of 0,0,0 and a radius of 0. I think that Steve, the developer who's responsible for RhinoCommon, should take a look and see if there's anything going on there.

On another note, your variable j is not a boolean. Its actually a special enumeration that specifies the intersection type itself (none, point (ie tangent spheres), circle, or overlap). So it should read Dim j as Intersect.SphereSphereIntersection
thanks damien,

i tried all that you said..



Dim intCirc As New Circle

Dim sp1 As New Sphere(x, z)
Dim sp2 As New Sphere(y, z)


Dim j As Intersect.SphereSphereIntersection = Rhino.Geometry.Intersect.Intersection.spheresphere(sp1, sp2, intCirc)



A = IntCirc
B = sp1
C = sp2



im printing 'invalid circle' out of A
I can repeat this, looks like a bug in RhinoCommon. I'll fix it for the next release.

Edit: yup, a bug. It's fixed now.

--
David Rutten
david@mcneel.com
Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service