Grasshopper

algorithmic modeling for Rhino

I'm flummoxed here. I'm simply trying to get the mean curve between 2 curves in Grasshopper, I couldn't find a component so thought it would be a quick C# script:

 

private void RunScript(Curve curveA, Curve curveB, ref object meanCurve)
{
Curve localCurve = Curve.CreateMeanCurve(curveA, curveB);
meanCurve = localCurve;
}

 

But no matter what I try the result is a null object. No errors, just no result.

 

Any suggestions greatly appreciated. 

Views: 596

Replies to This Discussion

Hi Dave,

 

you're flummoxed for a good reason. The Mean Curve algorithm was only written for Rhino5. It does not exist in Rhino4, so any script that uses that method will only work while running inside Rhino5.

 

There's quite a few of these cases in the SDK and we did not do a good job of documenting them. Somehow the notion that the Rhino4 SDK is only 'for a few more weeks/months' fuelled our lazy-ness.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Aha! Yes, it works fine in Rhino 5. Thanks for the clarification.

 

This begs the question, though: Since there IS a "MeanCurve" command implemented in Rhino 4, is there some way to trigger that from Grasshopper?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service