587,418 active members*
3,510 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2005
    Posts
    1778

    Using EMC2 with a Mac (GCodeCnv)

    I love emc2 but I hate having to go out in the garage when working on a part just to see if emc2 likes my gcode or not.

    So to make a long story short, I am working on a piece of software to run on my Mac that will read a DXF file and generate gcode for the machines in the shop.

    I actually have a version running. It currently generates gcode specifically for EMC2 (it uses o-words and emc2 subroutines). It currently only generates code for my mill (not my lathe). I have written a number of gcode subroutines and many of them will ultimately be used in wizards in the software. The only one that is currently being used as a wizard is for cutting holes. I generate a subroutine from the DXF input and have another subroutine that calls it repeatedly to cut to depth. The result is much shorter gcode output than some other software. Much easier to debug.

    It has a job setup window for setting parameters related to the particular job being run; a layer list for all of the layers in the DXf, and a Layer Edit that allows you to set certain variables by layer (for example you can change the depth of cut for each layer).

    You can also set a preference to set how close the ends of entities must be to be considered connected.

    I have attached a few screen shots to show what it looks like.

    It currently barfs on some large DXF files.

    Alan
    Attached Thumbnails Attached Thumbnails Screen shot 2009-11-12 at 3.14.47 PM.jpg   Screen shot 2009-11-12 at 3.17.16 PM.jpg   Screen shot 2009-11-12 at 3.19.43 PM.jpg  

  2. #2
    Join Date
    Jun 2005
    Posts
    55
    Nice Work!

    Need a beta tester?

    H.

  3. #3
    Join Date
    Apr 2005
    Posts
    1778
    Quote Originally Posted by henrikw View Post
    Nice Work!

    Need a beta tester?

    H.
    Probably will shortly.

    Alan

  4. #4
    Join Date
    Jan 2006
    Posts
    51
    Wonderful work!

    Wachara C.

  5. #5
    Join Date
    Apr 2005
    Posts
    1778
    I haven't totally solved the problem of dealing with large files but I did discover that it is something about their format that my program doesn't like. If I open the problem file with QCad (which it does without complaining) and resave the file then I can process it. Since QCad can open the problem file and I can't it must be in my read routines.

    Alan

  6. #6
    Join Date
    Sep 2004
    Posts
    149
    Alan,
    Could it be as simple as different line endings? I've had to put '\r\n' in for my line endings for the mac and '\n' for unix. It's usually easy to see what's going on by opening the file with vi.

    Dan

  7. #7
    Join Date
    Apr 2005
    Posts
    1778
    Quote Originally Posted by Dan Falck View Post
    Alan,
    Could it be as simple as different line endings? I've had to put '\r\n' in for my line endings for the mac and '\n' for unix. It's usually easy to see what's going on by opening the file with vi.

    Dan
    No, it is something else because I fixed the line endings problem a while back.

    I have been spending a bunch of time on cleaning up my code and testing. Hopefully, I didn't break too much while cleaning up. I just had a lot of little bugs that I wanted to fix before I let anyone else have a shot at it.

    Alan

  8. #8
    Join Date
    Sep 2006
    Posts
    1738
    Good stuff ACondit, you always helped me with EMC2, i'll be asking questions in the coming days. Need to re-set my coolant relays gain, can't them to work!


    -Jason

  9. #9
    Join Date
    Apr 2005
    Posts
    1778
    Quote Originally Posted by acondit View Post
    No, it is something else because I fixed the line endings problem a while back.

    I have been spending a bunch of time on cleaning up my code and testing. Hopefully, I didn't break too much while cleaning up. I just had a lot of little bugs that I wanted to fix before I let anyone else have a shot at it.

    Alan
    Well, I thought that I fixed the line endings problem. It turns out that I had just fixed it for files written on the Mac or Linux/Unix. It was still bombing on files written under windows 'crlf' endings. That is now fixed too.

    I still have a problem with certain entities in one DXF file. I handle LWPOLYLINE but not POLYLINE (Autocad DXF entity names). So the one DXF that I can't handle uses Polylines. I haven't decided what I want to do with that yet, it uses some slightly weird encoding and seems to have a lot of different types in it. Most of the DXF's are less that 200k but that one is 1.5mb. It looks almost like it has broken the curves into very short line segments rather than curves. That makes processing the file much slower in EMC2 as well. At some point I will have to bite the bullet and support that too, but for now I want to get everything else that I have written tested. In terms of machining speed it is better to use arcs to generate the DXF image than breaking the arc into very short line segments.

    Anyway size isn't a problem. I added some progress indicators so I can tell where I am in processing a file.

    Alan

Similar Threads

  1. EMC2
    By Jamy in forum LinuxCNC (formerly EMC2)
    Replies: 32
    Last Post: 08-18-2009, 05:03 AM
  2. 3D DXF EMC2 or 2D only?
    By klaymonster in forum LinuxCNC (formerly EMC2)
    Replies: 7
    Last Post: 01-14-2009, 11:22 PM
  3. EMC2
    By Jamy in forum Uncategorised CAD Discussion
    Replies: 2
    Last Post: 12-11-2008, 07:02 AM
  4. EMC2 HELP HELP HELP
    By Alwyn in forum OpenSource Software
    Replies: 2
    Last Post: 10-11-2008, 05:18 PM
  5. Emc2
    By sdantonio in forum Mach Mill
    Replies: 2
    Last Post: 02-05-2007, 09:26 PM

Posting Permissions

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