Grasshopper

algorithmic modeling for Rhino

How do we access curve control points from a C# node?

The idea is to smoothly rebuild the joint between two curves so that the pipe works continuosty.

Thanks

Views: 1485

Replies to This Discussion

If within a c# node:

 private void RunScript(Curve crv, object y, ref object A)
  {
    NurbsCurve nc = crv.ToNurbsCurve();
    List<Point3d> pts = new List<Point3d>();
    foreach(ControlPoint ncp in nc.Points)
    {
      pts.Add(ncp.Location);
    }
    A = pts;
  }

Not sure if it is exactly the way you want to go...you might want to be traversing the curve's parameter space (look at .PointAt() methods for curves).

Hi again!

It worked well, thanks :)

I have been playing with '.Knots' but I still don't see how to remove a curve control point / knot / greville point in C#. The reason for removal is because it's placed on the curve, it's an ugly kink...!

Using CreateUniformKnots or CreatePeriodicKnots modifies too much the overall curve. I would like instead to kill the knot or greville point in question, or to modify that precise one.

Makes sense?

Thanks in advance for your time and patience.

Miguel.

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