I'm quite new at programming with python. For the use of programming a machine I need to work with g-code. Therefore I use an Python program to read out the gcode from a data. Now I have to combine the code like following:
Code1:
- line1 (a, b, c)
- line2 (d, e, f)
Code2:
- line1 (g, h, i)
- line2 (j, k, l)
the result should look like
- line1 (a,b,c, g, h, i)
- line2 (d, e, f, j, k, l)
They code I have by now basically only creates the code for both. This does not merge it. I know I have to work with "numpy" somehow but I stuck.
import dxfgrabber
import numpy as np
left = dxfgrabber.readfile('data1')
right = dxfgrabber.readfile('data2')
def createcode(code):
for i in code.entities:
for p in i.points:
mylist = np.array(p)
print(mylist)
createcode(left)
createcode(right)