Thread: Draw Circle

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    25
    Rep Power
    0

    Draw Circle


    Hello All
    I have designed an XY table with two stepper motors. One stepper motor controls the x -axis and the other controls the y –axis. I simply send a command to the parallel port which in turn sends the command to the stepper motors. Each command sends one step. One hundred steps will move the x or y axis 1mm. That is 100 steps per mm. I know how to send enough steps to draw straight lines. A line 50mm long will mean 50 x100 =5000 steps. Eg: …for 1 to 5000 do PORT[$78] := #4 . This will send 5000 steps to the X motor and so on. However I do not know any circle or ellipse algorithm. Could anyone help me with some Delphi code to send steps for a circle? I shall appreciate all help.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2010
    Posts
    68
    Rep Power
    5
    Hi
    did you try researching about drawing algorithms? Try. Here is the Bresenham algorithm for line and circle. You can try implementing it in Delphi.

    Dimiter.

IMN logo majestic logo threadwatch logo seochat tools logo