The pen plotter I'm using has a plot area of about 142mm x 142mm. Import mathdef triangleLongLeg(r): #Solve for the long leg of the triangle return math.sqrt( (r** 2) - ((r/ 2)** 2) )def circleGcode(penx,peny,centerx,centery): print( "G0Z5 F%i" % zfeed) print( "G0X%iY%i F%i" % (penx, peny, xyfeed)) print( "G0Z0 F%i" % zfeed) print( "G2X%iY%iI%iJ%i F%i" % (penx, peny, centerx, centery, xyfeed)) print( "") x = 80 y = 90r = 10zfeed = 400xyfeed = 4000 #Calculate Centers:centers = list()longleg = triangleLongLeg(r)centers.append()centers.append()centers.append()centers.append()centers.append()centers.append()centers.append() #Generate the gcode print( "G90") #Set absolute modepoints = centerscircleGcode(points-r,points,r, 0) for points in centers: circleGcode(centers,centers,points,points) print( "G0Z5") print( "G0X0Y0") About the Machine This is the Python that generated that gcode: I#J# as pivot point of arc (center of circle) relative to the current pen position.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |