algorithmic modeling for Rhino
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 ?
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);
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));