Grasshopper

algorithmic modeling for Rhino

Trying to test if to Breps intersect. My problem is that the ”RhUtil.RhinoIntersectBreps “ return the result as “True” even though they do not intersect, what am I doing wrong?

Views: 374

Attachments:

Replies to This Discussion

The SDK function returns true if it encountered no errors/problems whilst assessing the intersection. I've always counted the number of resulting curves or points to check if the objects intersect. Someone else might have a better way.

Cheers,

Jon
Yea, you have to watch this...I guess the RhinoScript expectation is that is if something doesn't work than it has "failed". I guess the SDK has more gray areas than that, so its definitely best to check whatever variables that were passed into the functions and see if they've been filled. Note that this isn't he only method that exhibits this behavior, but I can't remember which other common ones do.
Thanks for the replies…
Still having a problem determine, if there is an intersection or not. Here is the code:

Dim intsec As Boolean
Dim crvs() As IOnCurve
Dim pt As On3dPointArray

intsec = RhUtil.RhinoIntersectBreps(x, y, 0.01, crvs, pt)
If crvs Is DBNull.Value = True Then

Print("No intersection")
Else
Print("Intersection")

End If

A = crvs
Attachments:
Crvs won't be null, instead it will be an empty array. So the best thing to do is to see what the bounds of the array are (or the count or something). I'm not at a computer that I can write a little sample, but I'll try to get a quick example tomorrow.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service