. .
Page 1 of 2 12 LastLast
  1. #1
    Hi all,

    I'm trying to figure out a way of cropping a g-code. There are only G1 lines, lot of them, and I need to eliminate the lines that are falling out of a given shape in the XY plane. I do not care about safeZ for the returning or any fancy features, just eliminating the unnecessary movement outside of the workpiece.
    Generating a separate toolpath for each shape is time consuming... Not to be fooled by the simple appearance of the example, there is a lot of Z movement as well.

    Any help is greatly appreciated!

    Paul

    Click image for larger version. 

Name:	crop.jpg 
Views:	394 
Size:	68.6 KB 
ID:	19705

  2. #2
    Quote Originally Posted by paulus.v View Post
    Generating a separate toolpath for each shape is time consuming
    It shouldn't be, that is a really quick job in any competent CAM system, just use a tool path which supports a boundary or border to limit the cut area then add a boundary of the shape you need and POST the code for each shape,

    - Nick
    You think that's too expensive? You're not a Model Engineer are you? :D

  3. #3
    if you remember, here is why it is so time consuming... Now I have to generate separate toolpath for each triangle separately. I already have the toolpath for a surface big enough to include every shape I need, but now I need to eliminate the unnecessary movement.

  4. #4
    Yes, I guessed that it was related but generating the toolpath for a full surface then chopping up that toolpath simply isn't done, you chop up the surface then generate toolpaths for the parts or you cut the full surface then chop out the parts.
    If your CAD/CAM isn't capable of the above you might need to cut two or more copies of your full surface to be able to machine out your parts

    I don't think you realise just how complex a mathematical problem what you're asking for constitutes, it would need to

    1 Recognise which paths needed to be truncated and where
    and
    2 Calculate which truncated paths then need linking
    and
    3 Would need access to the surface data in order to know how to link them without gouging your part
    and
    4 Generate the paths to link paths
    and
    5 Insert the links into the modified truncated code

    The reason no one writes software to edit complex 3D toolpaths generated in another package within a boundary like this is because if they can do that they can write a CAM package that does the job properly in the first case and sell that to a mass market.

    Simply buy a CAM package that can do what you need, or provide enough information about what you're trying to achieve so the guys can analyse the full problem, not just the problem as you see it after reaching your own dead end.
    You think that's too expensive? You're not a Model Engineer are you? :D

  5. #5
    Quote Originally Posted by magicniner View Post
    I don't think you realise just how complex a mathematical problem what you're asking for constitutes, it would need to
    I do not see where it is the complexity. My g-code is a list of points defined by XYZ. I need to look at the the XY coord. of every line and compare with my shape. If the point is inside the shape keep the line, if it is outside delete it. That simple.

    To get an idea of what I'm doing, I have the shapes already cutout and I'm applying a surface texture on them. I need to eliminate the extra movement, cutting out air, around the shape.
    Last edited by paulus.v; 25-11-2016 at 03:24 PM.

  6. #6
    Quote Originally Posted by paulus.v View Post
    I do not see where it is the complexity. My g-code is a list of points defined by XYZ. I need to look at the the XY coord. of every line and compare with my shape. If the point is inside the shape keep the line, if it is outside delete it. That simple.

    To get an idea of what I'm doing, I have the shapes already cutout and I'm applying a surface texture on them. I need to eliminate the extra movement, cutting out air, around the shape.
    Which leaves you with a set of moves which don't join up and aren't linked ;-)
    Last edited by magicniner; 25-11-2016 at 03:26 PM.
    You think that's too expensive? You're not a Model Engineer are you? :D

  7. #7
    Quote Originally Posted by magicniner View Post
    Which leaves you with a set of moves which don't join up and aren't linked ;-)
    Doesn't matter. The moves are the dotted lines in my sketch. There will be a G1 move from the last point of one texture line to the first point of the next line. It will cut through air anyway.

  8. #8
    Quote Originally Posted by paulus.v View Post
    Doesn't matter. The moves are the dotted lines in my sketch. There will be a G1 move from the last point of one texture line to the first point of the next line. It will cut through air anyway.
    Sorry, I didn't realise it was so simple, I await your elegant software solution with bated breath, meanwhile the rest of the world does this in CAD/CAM
    You think that's too expensive? You're not a Model Engineer are you? :D

  9. #9
    In geometry, the term for what you want to do is 'clipping'
    Try a search for 'polygon clipping'
    It seems like a simple task but is made difficult by lots of tricky edge cases.
    If you can code in c++ or c# or Delphi i can recommend Angus Johnsons excellent freeware 'Clipper' http://www.angusj.com/delphi/clipper.php
    Cheers

  10. The Following User Says Thank You to Greeny For This Useful Post:


  11. #10
    Quote Originally Posted by Greeny View Post
    If you can code in c++ or c# or Delphi i can recommend Angus Johnsons excellent freeware 'Clipper' http://www.angusj.com/delphi/clipper.php
    Cheers
    That looks like a really useful bit of software written by someone with an understanding of the problems involved in truncating lines with a shape, but surely the problem with G Code is "Simple" ? :D

    - Nick
    You think that's too expensive? You're not a Model Engineer are you? :D

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. A little bit of G code help please!
    By njhussey in forum Programmers Corner
    Replies: 19
    Last Post: 16-11-2015, 03:36 PM
  2. Anyone got some 2.5D G-code please ?
    By dudz in forum Programmers Corner
    Replies: 5
    Last Post: 22-06-2013, 11:21 PM
  3. Cambium Code Web Tools – Parametric G-code Generation
    By CambiumMachines in forum Manufacturer News
    Replies: 0
    Last Post: 09-01-2013, 04:56 AM
  4. G Code help
    By moose007 in forum Programmers Corner
    Replies: 4
    Last Post: 22-05-2009, 11:39 AM

Bookmarks

Posting Permissions

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