Grasshopper

algorithmic modeling for Rhino

Goofs,

How do I retrieve the y coördinate of a curve at sampled (and "Equidistant") steps in x-direction, without first building Bbox and plane/curve intersections? This shouldn't be hard for mathematics, I suppose.

Or, how do I translate Intersect.IntersectionEvent (which is a booleans) into point3d?

Thanx,

Pim.

Views: 585

Replies to This Discussion

Hey Pim,

hope that helps...

best, [u

Rhino.Geometry.Intersect.CurveIntersections intersections = Rhino.Geometry.Intersect.Intersection.CurvePlane(crv, pl, doc.ModelAbsoluteTolerance);

List<Point3d> intersectionPoints = new List<Point3d>(intersections.Count);
List<double> param_t = new List<double>(intersections.Count);

    for (int i = 0; i < intersections.Count; i++)
    {
      if(intersections[i].IsPoint){
        double pt = intersections[i].ParameterA;
        param_t.Add(pt);
        intersectionPoints.Add(crv.PointAt(pt));
      }else{
        double pt = intersections[i].ParameterB;
        param_t.Add(pt);
        intersectionPoints.Add(crv.PointAt(pt));
      }
    }


P = intersectionPoints;
t = param_t;

Thanks [u

You did help me to get started, but I've found what I was looking for in DivideAsContour, file attached.

Now DivideAsContour produces an array of Point3d.

If I were to use the points in that array, could I translate them into a list (of Point3d)?

Pim.

Here's the corresponding Divide in X component...

Cheers,

Pim.

Attachments:

List<Point3d> list = new List<Point3d>(arrPoints);

Or use the AddRange() method on lists to add an array of points all at once.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks David!

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