Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Global mitte_x=100
- Global mitte_y=100
- Global radius=80
- Global stp#=3.6
- Type code
- Field x#
- Field y#
- End Type
- kreis(mitte_x,mitte_y,radius,stp,0,360)
- Graphics 800,600,0,2
- SetBuffer FrontBuffer()
- Rect 300,200,200,200,0
- Local kk.code
- Local file=WriteFile("out"+radius+"-"+stp+".gcode")
- WriteLine file,"G1 F25000"
- For kk.code=Each code
- Plot 300+kk\x,400-kk\y
- WriteLine file,"G1 X"+kk\x+" Y"+kk\y
- Next
- WriteLine file,"G1 X0 Y0"
- Rect 100,100,100,100,1
- WaitKey()
- End
- Function kreis(M_X#,M_Y#,r#,stp#,start#,finish#)
- ;M_X = mittelpunkt in X
- ;M_Y = mittelpunkt in Y
- ;r = radius
- ;stp = winkelschritt
- ;start = startwinkel
- ;finish = endwinkel
- ;F = vorschub
- ;dir = +1=gegen uhr -1= mit der uhr
- Local counter#=start
- Local cc.code
- While counter<=360+start
- cc.code=New code
- cc\x=M_X+(Cos(counter)*r)
- cc\y=M_Y+(Sin(counter)*r)
- counter=counter+stp
- Wend
- End Function
Add Comment
Please, Sign In to add comment