I am new to python and I'm trying to generate a g-code using python. I'm using sympy because I also need to do segments, intersections, and even convex hull.
Given an initial point(s) I need to rotate it(them) +/- 120 degrees from the center (0,0), and my end result should be something like this:
"G0 X0 Y120.4"
I turn evaluate=False to get actual points, but the way I am doing it only works for the initial one and not for the others:
G0 X0 Y120.400000000000
G0 X-301*sqrt(3)/5 Y-301/5
How do I make the other points in the form of the initial Z point?
from sympy import Point, pi
z = Point(0, 120.4, evaluate = False)
x = z.rotate(pi*2/3)
y = z.rotate(-pi*2/3)
print('G0 X{0} Y{1}'.format(z.x,z.y))
print('G0 X{0} Y{1}'.format(x.x,x.y))