Draw G-Code by Hand (Interested) ?? - Page 3


Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 71

Thread: Draw G-Code by Hand (Interested) ??

  1. #41
    Registered
    Join Date
    Sep 2004
    Location
    USA
    Posts
    412
    Downloads
    0
    Uploads
    0

    Default

    New version works great..... except it's upside down. = P~

    I was doing it right, I guess the previous one that I downloaded didn't work.

    *shrugs*

    Need to be able to specify a canvas size now. When I import pictures, the canvas size changes, but I can't adjust or reset it. I.e. Tracing different elements from multiple pictures.

    Either way, cool program.

    Thanks



  2. #42
    Member
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    1220
    Downloads
    0
    Uploads
    0

    Thumbs up

    Switcher
    Your new version is looking really good.
    I found when drawing I couldn't afford to let the left mouse go else it would generate a G00, Z and Feed change. If this could be disabled somehow on occassions when the user wished. I personally would be quite happy to add these onto the code after doing the drawing but that may not suit everybody.
    Just my 2 cents worth. Thank you for the good work.
    Kiwi.



  3. #43
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    New version works great..... except it's upside down. = P~
    Deviant, I'll check into that. I plan on doing a overhaul on the scale of the drawing.


    --------------------------------------------------------------------------------------------------

    Switcher
    Your new version is looking really good.
    I found when drawing I couldn't afford to let the left mouse go else it would generate a G00, Z and Feed change. If this could be disabled somehow on occassions when the user wished. I personally would be quite happy to add these onto the code after doing the drawing but that may not suit everybody.
    Just my 2 cents worth. Thank you for the good work.
    Kiwi.
    Kiwi, I can work that in, maybe a MessageBox, or a CheckBox asking you to add that specific "Z" lift off.


    It will be a few days before I can get to this stuff.

    Last edited by Switcher; 05-11-2014 at 05:28 PM.


  4. #44
    Registered
    Join Date
    Aug 2006
    Location
    US
    Posts
    281
    Downloads
    0
    Uploads
    0

    Default

    A suggestion for this would be to make something that could import an EPS file. I've done this a few times and it's a pain but it's doable. EPS files are just vector coordinates but tons of good programs write these (Illistrator, Corel Draw, Flash). The format is pretty easy to figure out just opening them with notepad. The hardest part is dealing with Bezier curves. Instead of circles or arcs, all non-straight lines are made with Bezier curves. So you will likely need to calculate them into a bunch of small lines. The only thing I haven't found a good way of handling is an easy efficient way to set the tool height. You could edit it point by point, but that would be a pain.

    If you're interested I can post the code to do most of the work (meaning the EPS import).



  5. #45
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    If you're interested I can post the code to do most of the work (meaning the EPS import).
    Sounds interesting, post the code, I'm curious.

    Last edited by Switcher; 05-11-2014 at 05:28 PM.


  6. #46
    Registered
    Join Date
    Aug 2006
    Location
    US
    Posts
    281
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Switcher
    Sounds interesting, post the code, I'm curious.


    Jerry
    OK, here's what I could dig up quickly. It's in VB6 but shouldn't be hard to port to .NET.

    Code:
    Sub import_Click()
        CommonDialog1.Filter = "EPS (Lines Only)|*.EPS"
        CommonDialog1.ShowOpen
        FileName = CommonDialog1.FileName
        If FileName = "" Then Exit Sub
        Open CommonDialog1.FileName For Input As #1
        temp = ""
        startsave = 0
        While Not EOF(1)
            Line Input #1, lot
            lot = Trim(lot)
            If lot = "%%EOF" Then startsave = 3
            If startsave = 2 Then
                linetype = Right(lot, 1)
                If Len(lot) > 2 Then lot = Left(lot, Len(lot) - 2)
                '******* move
                If LCase(linetype) = "m" Then
                    epstype(x) = "m"
                    cutcur(numcuts, 0) = x
                    If x > 0 Then cutcur(numcuts - 1, 1) = x - 1
                    epsname(numcuts) = "Task #" + Str(numcuts)
                    numcuts = numcuts + 1
                    eps(x, 0) = Left(lot, InStr(lot, " ") - 1)
                    eps(x, 1) = Right(lot, Len(lot) - InStr(lot, " "))
                    mainx = eps(x, 0)
                    mainy = eps(x, 1)
                    x = x + 1
                End If
                '******* line
                If LCase(linetype) = "l" Then
                    epstype(x) = "l"
                    eps(x, 0) = mainx + Val(Left(lot, InStr(lot, " ") - 1))
                    eps(x, 1) = mainy + Val(Right(lot, Len(lot) - InStr(lot, " ")))
                    mainx = eps(x, 0)
                    mainy = eps(x, 1)
                    x = x + 1
                End If
                '******* Curve
                If LCase(linetype) = "c" Then
                    x1 = mainx
                    y1 = mainy
                    x2 = mainx + Val(Left(lot, InStr(lot, " ") - 1))
                            lot = Right(lot, Len(lot) - InStr(lot, " "))
                    y2 = mainy + Val(Left(lot, InStr(lot, " ") - 1))
                            lot = Right(lot, Len(lot) - InStr(lot, " "))
                    x3 = mainx + Val(Left(lot, InStr(lot, " ") - 1))
                            lot = Right(lot, Len(lot) - InStr(lot, " "))
                    y3 = mainy + Val(Left(lot, InStr(lot, " ") - 1))
                            lot = Right(lot, Len(lot) - InStr(lot, " "))
                    x4 = mainx + Val(Left(lot, InStr(lot, " ") - 1))
                            lot = Right(lot, Len(lot) - InStr(lot, " "))
                    y4 = mainy + Val(lot)
                    For per = 0.2 To 1 Step 0.2:'This will break the curve down into steps of .2 - or 5 segments.  This was done for speed and should probably be more like .02 for a smoother curve.
                        epstype(x) = "l"
                        eps(x, 0) = xsp(xsp(xsp(x1, x2, per), xsp(x2, x3, per), per), xsp(xsp(x2, x3, per), xsp(x3, x4, per), per), per)
                        eps(x, 1) = ysp(ysp(ysp(y1, y2, per), ysp(y2, y3, per), per), ysp(ysp(y2, y3, per), ysp(y3, y4, per), per), per)
                        mainx = eps(x, 0)
                        mainy = eps(x, 1)
                        x = x + 1
                    Next
                    epstype(x) = "l"
                    eps(x, 0) = x4
                    eps(x, 1) = y4
                    mainx = eps(x, 0)
                    mainy = eps(x, 1)
                    x = x + 1
                End If
    
            End If
            If lot = "%%EndSetup" Then startsave = 1
            If lot = "IP" And startsave = 1 Then startsave = 2
        Wend
        If x > 0 Then cutcur(numcuts - 1, 1) = x - 1
        x = x - 1
        Close #1
    End Sub

    And you need at least these two functions to ease up the Bezier conversion:

    Code:
     
    Function xsp(x1, x2, p) As Integer
        xsp = ((x2 - x1) * p) + x1
    End Function
    
    Function ysp(y1, y2, p) As Integer
        ysp = ((y2 - y1) * p) + y1
    End Function




  7. #47
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    This is an updated version "Sketch2Code v1.35".


    ".NET Framework"

    http://www.microsoft.com/downloads/d...displaylang=en


    .

    Attached Files Attached Files
    Last edited by Switcher; 09-17-2006 at 11:02 PM.


  8. #48
    Klaus Karner
    Guest

    Default Gcode Drawing.

    Dear Sr - Maddam.

    My name is Klaus Karner , and im trying to make program that allow me to draw a CNC file.

    i just did somesthing with Vb 2005 , i can draw almost every line , and some arcs.

    do you know where i can obtain information about it.

    thanks

    Klaus+



  9. #49
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    Klaus,

    Sorry, I didn't see your post sooner.

    This link might help you with VB.net GDI+ code.

    http://www.java2s.com/Code/VB/2D/Catalog2D.htm



    .



  10. #50
    Registered frankg521's Avatar
    Join Date
    Aug 2006
    Location
    USA
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default Realy kool

    Hey Switcher ur program is very well written i dint have any thing to simulate yet but it looks really kool

    Frank



  11. #51
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    Thanks,

    I have a lot more work to do, before the program is finished.

    Maybe I'll finish it some day soon?




    .



  12. #52
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    Just to let everyone know, I hope to have an updated version of "Sketch2Code" sometime today.

    The (freehand) g-code should be more efficient.

    I traced a small image (outline), before it produced over 4000 lines of g-code, Now I've got that same image down to less than 450 lines of g-code.

    This version will still be the "Microsoft .NET Framework Version 1.1", after that future versions will be "Microsoft .NET Framework Version 2.0" (I'm trying to stay caught up with MS).


    .



  13. #53
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    This is version 1.37 of "Sketch2Code", it should produce more efficient g-code than all versions before.



    Note:
    You will need the "Microsoft .NET Framework Version 1.1" (or later) before you can run this program.
    http://www.microsoft.com/downloads/d...displaylang=en
    .

    Attached Files Attached Files
    Last edited by Switcher; 07-22-2007 at 11:57 PM.


  14. #54
    Registered
    Join Date
    Dec 2006
    Location
    USA
    Posts
    839
    Downloads
    0
    Uploads
    0

    Default

    Way cool! I just downloaded your latest. I know you already stated you would keep working on this one, but keep working on this one. I see a winner with this program. I have got to build me a mouse-pin or something just to play with this. I will have to go through my junk box, might just be something that can make this work. Hum, I wander what a joystick would be like ? Probably a little to uncontrollable.



    BTW, is there a way to copy/paste the background image down as your drawn lines ?



    Jess



  15. #55
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    Jess,

    It's been a while since I last worked on Sketch2Code. I always have so much going on.

    You can open a background image & draw/trace on top of the image ( Image / Open Background Image ).



    .

    Attached Thumbnails Attached Thumbnails Draw G-Code by Hand (Interested) ??-skcode1-jpg  
    Free DXF - vectorink.com


  16. #56
    Registered
    Join Date
    Jul 2006
    Location
    USA
    Posts
    887
    Downloads
    0
    Uploads
    0

    Default

    Switcher,
    I just found this thread and read all 5 pages with wonder and amazement. I have not yet downloaded your software yet, but I will! This idea has some very promising potential!!!!!!! Please do not give this idea up.

    I have a tablet and I draw on it from time to time. Only foreseeable problem is that I draw in chicken scratch. Many small lines to create the element of one line. Its how I have always done it. Is your software going to see each little line as one entity?

    Attached Thumbnails Attached Thumbnails Draw G-Code by Hand (Interested) ??-bike-purple-jpg   Draw G-Code by Hand (Interested) ??-dalejr-jpg   Draw G-Code by Hand (Interested) ??-draw3-jpg   Draw G-Code by Hand (Interested) ??-planes1-jpg  



  17. #57
    Registered vlmarshall's Avatar
    Join Date
    Mar 2006
    Location
    usa
    Posts
    474
    Downloads
    0
    Uploads
    0

    Default

    Switcher, this program looks great! You don't know how many hours I've spent, at work and at home, printing grid lines over existing artwork, and transfering points with a CAD program.



  18. #58
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Fixittt View Post
    Switcher,
    I just found this thread and read all 5 pages with wonder and amazement. I have not yet downloaded your software yet, but I will! This idea has some very promising potential!!!!!!! Please do not give this idea up.

    I have a tablet and I draw on it from time to time. Only foreseeable problem is that I draw in chicken scratch. Many small lines to create the element of one line. Its how I have always done it. Is your software going to see each little line as one entity?


    Fixittt,

    I don't have a tablet so I'll answer your ? the best I can.

    The way the program works is:

    1) Hold the Left mouse button, to move the "Z-axis" down into the material (this needs to be done the entire length of each individual line).

    2) Draw your line, this will be your "X" & "Y" movement, while cutting.

    3) Release the Left mouse button, to retract the "Z-axis" (Z will be above material (SAFE) for RAPID moves).

    4) Repeat the above steps for the next lines.


    So as far as you working with your Tablet, I would think that anytime you touch the surface of the Tablet, would be the equivalent of me pressing & holding the Left mouse button.


    I'm interested to know your results.


    NOTE:
    Always simulate & dry run the g-code, as this program is not finished.


    .

    Free DXF - vectorink.com


  19. #59
    Registered
    Join Date
    Oct 2004
    Location
    USA
    Posts
    742
    Downloads
    0
    Uploads
    0

    Default

    Switcher,

    Have you tried the e-pen or I-pen with this program?

    It is a hand held pen that functions as a mouse for signing documents, etc.

    I ordered 2 ea. of these, and plan to try it on your software.

    Jerry



  20. #60
    Member Switcher's Avatar
    Join Date
    Apr 2005
    Location
    United States
    Posts
    3634
    Downloads
    0
    Uploads
    0

    Default

    I've only used my PC mouse with this program.

    Is this the same pen here that your trying?

    Keep us posted , on how the e-pen/I-pen work, for you.

    Thanks,


    .

    Free DXF - vectorink.com


Page 3 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Draw G-Code by Hand (Interested) ??

Draw G-Code by Hand (Interested) ??