Grasshopper

algorithmic modeling for Rhino

I have been noticing a few odd things with some bits of GH lately.
One of my favourite (and most used) SDK functions was

RhUtil.RhinoPointInPlanarClosedCurve

which for the life of me just plain refuses to work since I upgraded to v0.60018. Also the 'import from Rhino' option for freehand curves that one draws on the Gh canvas doesn't seem to work.

There's more, but its just not coming to my mind. I'll keep adding stuff as I find it, but does anyone else here have similar issues with these functions or is it just my particular installation that is buggy?

Views: 259

Replies to This Discussion

The import feature is a known bug. You have to wiggle the object about on the canvas before the changes are properly applied.

Where are you using RhinoPointInPlanarClosedCurve? This function cannot be affected by Grasshopper, it is part of the Rhino SDK. Can you send me an example of where it fails?
David,

After some testing, I have not been able to recreate the disfunctionality of RhinoPointInPlanarClosedCurve. It probably was just a one off case where that function did not work. Since then, it has worked everytime I used it.

Can that happen if some DLL fails to load/loads improperly when Rhino starts?

Suryansh.
Hi Suryansh,

no, there is only one version of this function, so if you can call it you always get the same functionality. If the function is not available (which is not possible if Rhino is loaded because it is part of Rhino) you'll get a crash when trying to call it.

It is possible that RhinoPointInPlanarClosedCurve has a bug which causes it to provide erroneous results with particular input.

Oh wait, I just noticed you put a repeatable case in this discussion... to be continued.
Hi David, I emailed you the Rhino & GHX file as well! You don't have to rebuild this..

Thanks!



Hi David,

I finally managed to recreate the issue again. As you can see in the attached images, if I get the points through a definition and then use my .Net component to test if they lie inside a given polyline, it refuses to work persistently saying "Object reference not set to an instance of an object".

However, it works if I simply stream the contents out to a text file, and then in a seperate GH file (running simultaneously in the same Rhino session, on the same Rhino model file) stream them back into creating points.

It also works if the points are baked and then re-imported into a another GH file. Hope the screenshot helps.
Hi Suryansh,

the bug is not with the function, but with your data. It looks like you have some null or invalid points in your data which are causing the function to crash, which in turn causes your script to terminate.

Directly below your loop, add the following line:

For i As Integer = 0 To P.Count - 1
If (P(i) Is Nothing) Then Continue For

This will skip the point if it is null.


The two cases in which you said it does work (i.e. streaming through a file or baking an re-importing) effectively do the same by removing all null points in the process.
Yup,

noticed the null data right after I posted here, and fixed it with the 'Clean Tree' component. I couldn't get the syntax going for If Is Null... I was trying to use the Rhinoscript syntax, and it didn't work..

Thanks for help!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service