I'm using this code:
Code: Select all
points = (
(0,0,0),
(0,2,0),
(2,2,0),
(3,3,0),
(3,2,0),
(0,0,0)
)
wire = Part.makePolygon(points)
Part.show(wire, "Wire")
o = DOC.addObject("Path::Feature","myPath2")
o.Path = Path.fromShapes((wire))
DOC.recompute()
p = o.Path
print(p.toGCode())
Code: Select all
G90
G17
G0
G0 X3.000000 Y3.000000
G1 X3.000000 Y3.000000 Z0.000000
G1 X3.000000 Y2.000000 Z0.000000
G1 X0.000000 Y0.000000 Z0.000000
G1 X0.000000 Y2.000000 Z0.000000
G1 X2.000000 Y2.000000 Z0.000000
G1 X3.000000 Y3.000000 Z0.000000
Code: Select all
G90
G17
G0 X0.000000 Y0.000000 Z0.000000 # first point
G1 X0.000000 Y2.000000 Z0.000000 # second point
G1 X2.000000 Y2.000000 Z0.000000 # third point
G1 X3.000000 Y3.000000 Z0.000000 # fourth point
G1 X3.000000 Y2.000000 Z0.000000 # fifth point
G1 X0.000000 Y0.000000 Z0.000000 # ending point the polygon is closed
Code: Select all
G90
G17
G0 X0.000000 Y0.000000 Z0.000000 # first point
G1 Y2.000000 # second point
G1 X2.000000 # third point
G1 X3.000000 Y3.000000 # fourth point
G1 Y2.000000 # fifth point
G1 X0.000000 Y0.000000 # ending point the polygon is closed
TIA and Regards.
Carlo D.