Grasshopper

algorithmic modeling for Rhino

Error CS0103 "The name 'Intersect' does not exist in the current context"

Hi, new to c#, can anyone tell me why I'm receiving the above error? Is the something about using loops that removes the namespace? Below is the code as it stands. 

double intersection_tolerance = 0.001;
Point3d overlap_point = new Point3d();
Curve[] overlap_curve;


foreach (Curve trail in Trails) {

foreach (Brep section in Sections) {

Intersect.Intersection.CurveBrep(trail, section, intersection_tolerance, out overlap_curve, out overlap_point);

}
}

Views: 1133

Replies to This Discussion

Try:Rhino.Geometry.Intersect.Intersection.

Hi Peter,

That seems to have solved it, though its given me a few other bugs to work out. Any idea why you would need to declare the namespace again inside the loop?

What bugs?

BTW: This Method returns false/true. Always use an if clause: if(Rhino.blah.blah) ... then do something with the out

BTW: both out stuff are arrays

BTW: The build-in editor is crap.

See attached as well

Attachments:

Had a look at this and I think I understand about 30% of what's going on haha. Will have to keep studying it, thanks for sending

Hi Peter,

Okay I am waaaaay out of my depth with this one obviously, so I don't expect you too waste any more time on me, I might be beyond hope.

I've worked out that the out stuff are arrays, which I am really struggling to work out how to convert into generic lists based on their types.

And I'm a little lost when you say the method returns false/true, unless you're referring to the fact an intersection might not exist therefor the method is false? If so I'm guessing I'll need to to have an if clause in case the result comes up null.

And I guess when you say the build in editor is crap you're referring to my previous question about why you need to declare a namespace inside a loop. If so agreed.

Well ... the build in editor is crap for a vast variety of reasons ... but programming is a task for the brave anyway (BTW: I hate computers).

Hope dies last ... so keep walking the walk. Buy decent cigars and tons of espresso as well.

See attached where the Method is not tested ... but the length of the out array is tested (if no ccx event occurs). The thing is unfinished on purpose: what happens if a line is "split" by another brep?

Attachments:

Haha very inspiring words. Thanks a lot mate, I'll have a look at it in a bit and report back.

Get these 3 training freaky things as well for the long winter nights (Vodka a must).

Attachments:

Thanks, man this is all ace. There's definitely some more vocab I need to learn before I can understand all this but this is all a huge help. You're a star.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service