Scripting in GH Part 09

Software: 
Tag: 
Video Duration: 
10 minutes
Author: 
Zach Downey

In this tutorial we recreate the pointAt componet and the divide curve component using C#.  In order to accomplish we utilize the PointAtNormalizedLength() method of the input curve.  This allows us to specifiy a parameter value and create a point at that parameter.  

Point3d pt = new Point3d();
pt = x.PointAtNormalizedLength(t);
 
A = pt;
List<Point3d> pts = new List<Point3d>();
Point3d pt = new Point3d();
 
double spacing = 1.0 / numDivs;
double t;
 
for (int i = 0; i <= numDivs; i++) {
    t = i * spacing;
    pt = x.PointAtNormalizedLength(t);
    pts.Add(pt);
}
 
A = pts;

Rating

Please rate this tutorial below. Thanks.

5
Average: 5 (7 votes)

Want to Contribute?

Want to be an author? Drop us a line here we'd love to have you.

Already have a video you'd like to post? Send us a link and we'll get you going.

:)