Grasshopper

algorithmic modeling for Rhino

When I Using the Point on Curve Component Of Grasshopper, to get the Point on the Curve, I Got an Very strange Problerm, And I think for an long time, and I can not think out what wrong with it . The Input Paramater type is an Custom Paramater Type derive from GH_Curve:The Detail is Show at the picture

Update:


The Code is on the attachment as below

Views: 575

Attachments:

Replies to This Discussion

Yup, the Point On Curve object is weird in this respect (probably qualifies as a bug). It inherits from GH_Param<GH_Point>, however it needs to take in curves, so it cannot rely on the standard conversion algorithms. Turns out all it tries is GH_Curve.CastFrom(remoteGoo) and throws an exception if that fails. It doesn't try to then do remoteGoo.CastTo<GH_Curve>. It probably should.

Looks like at the moment there's nothing you can do about this.

But why the point on curve object show the error convert from Curve to curve failed, wbat the realationship between Curve and curve?
Just because they have similar names doesn't mean they are the same type. Rhino has a Matrix type, so does Eto, so does MathNet. But they are all completely different types as far as the computer is concerned. Any conversion from one to the other must be specially coded up by someone.

The type you are putting in is not GH_Curve and has an unknown type id. I agree that the conversion could have worked, and should have worked, but at the moment it's an unhandled case.

So If I wan't to make the point on curve object work when I input my Custom Curve Paramater derive from GH_Curve work . What I can do for this? Thank You

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service