I have a file with the following data:
1
4 16 10 8 10 6 8 6 -6 8 6 -10 8 100 16 10 8 10 6 8 6 -6 8 6 -10 8 104 16 -10 8 10 -6 8 6 -6 8 -6 -10 8 -104 16 -10 8 -10 -6 8 -6 6 8 -6 10 8 -104 16 10 8 -10 6 8 -6 6 8 6 10 8 10
What I want to achieve is that if the line starts with 4 then ignore the first two number (e.g. 4 16
) and then convert the remaining into a collection of Point3D (e.g. for the first line it should return new Point3D (10,8,10)
, new Point3D (6,8,6)
, new Point3D (-6,8,6)
, new Point3D (-10,8,100) )
.
I have been able to do the first part but I am struggling with conversion of the string to number to Point3D. I am new to F# and I am kind of struggling with this. Can anyone point me in the right direction?
I have a file with the following data:
What I want to achieve is that if the line starts with 4 then ignore the first two number (e.g.
4 16
) and then convert the remaining into a collection of Point3D (e.g. for the first line it should returnnew Point3D (10,8,10)
,new Point3D (6,8,6)
,new Point3D (-6,8,6)
,new Point3D (-10,8,100) )
.I have been able to do the first part but I am struggling with conversion of the string to number to Point3D. I am new to F# and I am kind of struggling with this. Can anyone point me in the right direction?