0

first post here. I am a CNC machine operator and i want to make a program that outputs code for my CNC machine (G-code).

What i am trying to understand is how i can put the start and en points of line`s inside my DXF file containing the geometry i want to machine, to some sort of list, so i can (hopefully) do some sweepline calculations with them.

I found al lot of information about how to read a DXF file, but i could not find how to store these points.

SO: how can i save a pair of line points (x1 y1 , x2 y2) to a list an calculate with them.

never mind my bad english

addy
  • 21
  • 3

1 Answers1

1

In C# there is an object called a List. You can store your points, as Point objects, in a list.

List<Point> myList = new List<Point>();
myList.Add(new Point(x1, y1));

and then continue using the Add method to add more points to your list. You can retrieve the points from the list using a foreach loop or by index number. The points are ordered in the list in the same order that you added them.

Stewbob
  • 16,759
  • 9
  • 63
  • 107