algorithmic modeling for Rhino
Hi,
How can I convert List of point3f points to point3d.
I want to use ConvertAll function, but I do not know how to finish it:
List<Point3d> pts = points.ConvertAll(new Converter<Point3f, Point3d>(Point3d(Point3f)target);
What has to be typed instead of bold text ?
Thanks,
Tomas
Tags:
I think you have to write a method that you pass in as a delegate. You probably can't use anonymous methods in the C# editor.
List<Point3d> pts = points.ConvertAll(Convert3fTo3d);
...
/// additional code
private Point3d Convert3fTo3d(Point3f point)
{
return new Point3d(point.X, point.Y, point.Z);
}
Nice thanks:)
Now a days it is probably preferred to use the select LINQ extension method:
var doublePrecisionPoints = singlePrecisionPoints.Select(p => new Point3d(p.X, p.Y, p.Z));
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by