08-14-2018, 03:24 PM
perfect thanks that worked, its not the most intuitive way to create an object. here is the code as i edited in case its helps someone else out. i removed a loop and directly indexed the double[] for speed and clarity
Code:
public static Mat PointListToMat(Point[] pts, Vector ToolVec = null)
{
Vector tv = ToolVec;
if(ToolVec == null) tv = Vector.ZAxis();
// Create the list of points as an array of array of double
int np = pts.Length;
double[] xyzijk = new double[6];
// Convert a double array of arrays to a Mat object:
Mat points_mat = new Mat(6, np);
for (int c = 0; c < np; c++)
{
points_mat[0, c] = pts[c].X;
points_mat[1, c] = pts[c].Y;
points_mat[2, c] = pts[c].Z;
points_mat[3, c] = tv.X;
points_mat[4, c] = tv.Y;
points_mat [5 c] = tv.Z;
}
return points_mat;
}