I'm trying to get pos 'x' and 'y' from JSON file (a part of STL file with coordinates of polygons) to array or object using newtonsoft package but unsuccessfully.
That looks my original file and converted by JSON online
I've read this but gives me a lots of errors.
Would you give me some tips or example ?
Thanks in advance
try
{
using (StreamReader reader = new StreamReader("test.json"))
{
json = reader.ReadToEnd();
List<vertex> items = JsonConvert.DeserializeObject<List<vertex>>(json);
}
dynamic array = JsonConvert.DeserializeObject(json);
foreach (var vert in array)
{
Console.WriteLine("{0} {1}", vert.x, vert.y);
}
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
public class vertex
{
public double x,y;
}