1. Hey guyz. Welcome to the All New Phlatforum!



    Sign Up and take a look around. There are so many awesome new features.

    The Phlatforum is a place we can all hang out and

    have fun sharing our RC adventures!

  2. Dismiss Notice

Cut optimization

Discussion in 'SketchUcam Help' started by davdue, Aug 3, 2017.

  1. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    I have been playing around with SketchUcam while I wait for the school year to start. I am going to build a Joes 2006 CNC and plan on using the school's 48" X 96" router to cut out the parts. I have laid out the parts on a 47" X 97" piece of 1/2" MDF. It appears the generated code is jumping around all over the sheet. There are several places where the tool path goes from one spot to another spot on the material over a long distance. I can't really tell the order of the tool paths. Is there a way to see/know what that is? It seems like to me that the most efficient cut would be to start in the lower left of the piece and cut each part out and then go to the next one cut it out and so forth. How does SketchUcam process the cuts? Attached is a screen shot and my current SketchUp file. Thanks
     

    Attached Files:

  2. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    Hi
    Sketchup presents the shapes to SketchUcam in some sort of 'edited order', but it is not predictable.
    SketchUcam cuts internal shapes before external shapes, it figures that out by itself.
    The cut optimizer finds the closest corner on the next shape from the last shape, so at least that traverse is minimized, but since Sketchup actually gives us the shapes in a random order we are stuck with that
    UNLESS
    the shapes are grouped
    Groups cut in group order, and group order can be set using the group reorder tool
    http://swarfer.github.io/sketchucam/sketchucamtoolbar.html#toolreorder
     
  3. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    PS: if you want to impress the people at school you should read the whole manual, Knowledge is Power (-:
     
  4. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    ah, I note you have drilled holes as well. Note that holes are already grouped and the order gets messed by editing.
    instead of trying to set the order for all the holes and all the parts, you can do one of two things
    1. ungroup all the holes. This allows the optimizer to cut them in a pretty good order, per part, which works well for holes.
    2. group the holes within a part, then group that group in with the rest of the part. This minimizes travel to within the part.
    an alternative is to use the '2 drawing' method and drill all the holes with a real drill bit in the first drawing (or gcode file), then swap to the milling cutter and do all the cutting on the second drawing. This works very well since milling cutters are not good at drilling.

    This video shows how it is done
     
  5. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    I split the holes up into different SketchUp files like you suggested. The inside/outside cuts look fine. I have a trial version of CutViewer Mill and it shows them the same as the SketchUp model, but the two plunge holes files do not look at all in the right positions or even the right number of holes. Can someone look at my files and see if I have done something wrong.
     

    Attached Files:

  6. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    Looks fine to me when I overlay them in CAMotics, in terms of registration, but there are some holes missing from the right hand side because you have the holes overlayed over horizontal lines.
    upload_2017-8-8_9-50-17.png you can see a black horizontal line overlaying the purple hole 'cutline', you need to remove that horizontal black line from all those holes OR you can select the hole and rotate it a bit so the purple line is not horizontal. This is well documented in the manual, Sketchup stuffs up holes if they overlay horizontal lines (because of it's built in 'merge these lines' functionality), the grouping partially solves it, but I have spent hours trying to solve this and so far the only real solution is to follow the instructions that say don't overlay a horizontal line with a hole.

    Now, I know you put those lines in so that you could align the plunge hole tool to the center of the line.
    What you need to do is insert that line at an angle, from any of the OTHER vertices of the drawn circle, just not the horizontal ones.
     
  7. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    Be aware that if you have something like this
    upload_2017-8-8_10-0-5.png
    you will get TWO drilled holes, one at the center of the plunge hole, and one at the intersection of the cutline and the inner circle.
     
  8. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    by the way, I see you have fractional inches selected in Sketchup. Sketchup has various bugs related to small fractional inches where it does some odd rounding of values below 1/16".

    For best future joy you should swap to decimal inches and make sure you have enough precision to display the numbers properly.
    for example you need 5 digits to display 1/32" properly as 0.03125

    In any sketchup edit box where you enter a number, even when you have decimal inches selected you can still enter fractional inches and it will interpret it correctly.
     
  9. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    In the Outliner you can select all the holes very easily (select all 'Group' entries) then right click and select 'Explode'.
    now when the Gcode is generated you will get a much more optimal toolpath.
    upload_2017-8-8_10-12-52.png
     
  10. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    If I erase the horizontal lines I have drawn after I use the plunge hole tool does that fix the two drilled holes problem?

    I am not following you on the explode holes suggestion. What do you mean the "outliner" is this a SketchUp or SketchUcam function?
     
  11. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    if fixes the 'no drilled holes' problem
    part of Sketchup
    upload_2017-8-8_16-6-9.png <--- outliner
     
  12. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    Thanks for your help swarfer. I understand now and that works great. I moved on to another set of parts using the same techniques I have learned from you. One of the parts in this cut has hex shaped pockets. Every time I click on the hex face SketchUp locks up. I finally used the inside cut tool and changed the material thickness to the depth of the pocket desired. This should work but I am concerned if the cut will be good enough using a 1/4" end mill. I'm not even sure if this part needs this pocket but I know that some bearing blocks, made out of HPDE, will need it later. Can you figure out why SketchUp locks up for me or does it do it for you too? Attached are the whole layout model and just the hex pocket (0.150" deep) model. This model has the inside cut on it currently.
     

    Attached Files:

  13. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    Can you 'save as' Sketchup 2016 version please, I am now on leave and my home laptop will not run Sketchup2017
     
  14. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    I have the same problem with my laptop and I was out of the office yesterday. Here are the two files saved in SketchUp 2016.
     

    Attached Files:

  15. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    It looks like there is some kind of internal error in your file. Certianly SketchUcam has no problem encoding small hexagons if I draw them in a new file.

    One big problem with your file is that one of the pieces in not FLAT as defined for SketchUcam.
    That big central part above the big 3 bottom parts is not flat on the Z plane. remove all the cutlines, then triple click the part, then right click and select Phlatboyz|Phlatten.
    After that you will need to carefully select and delete all those little vertical lines around the holes.

    To encode those hexagons I have had success doing one at a time.
    select the pocket tool
    hold down CTRL
    click ONE of the hexagons.
    save the file.
    add a line across the center of the pocket cut, set it to 'fold cut'
    save the file.
    repeat until it freezes, kill Sketchup, start again (-:
    I will post a file just now when I get the laptop up.
     
  16. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    So I messed around with cleaning up things and still get a lockup. So I started a completely new model and used the polygon tool and if I don't use CTRL it will lockup every time but if I do it is fine. There must be something in the zig zag calculation that is freezing up SketchUp. No matter what I do in my model it locks up. I guess I will need to get the exact locations of the hex pockets determined and start a new model. There appears to be problem somewhere in that model. I have these hex shapes drawn in a different area with a separate safe area. I am going to try one more thing. I will erase all the lines that aren't flat on the other safe area and see if that fixes it.

    Nope that didn't fix it. Another try to delete all the other lines without saving it and I will see how that works.

    That didn't work either. I erased everything else except for lines I drew across the hex for location. Then I used the polygon tool to draw a 6 sided polygon with a radius of 0.28865. Then I used the pocket tool at 30% depth and clicked on one hex while holding down the CTRL key. After that I can't zoom or move anything and if I click on the title bar it says not responding.
     
    Last edited: Aug 11, 2017
  17. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    From scratch model didn't work either. Here is the model without any cut lines added to it.
     

    Attached Files:

  18. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    Well I figured out the scratch model. I had to erase construction lines that I used to locate the hex polygons before I use the pocket tool. It works fine with both the boundry and the zigzag. I also had to use 1/8" bit rather than 1/4"
     

    Attached Files:

  19. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    I spent hours with this over the weekend. The result is the discovery that the code that creates the offsets from the shape you are hovering over has a bug (not my code) that manifests when the shape dimensions are similar to the bit size.
    So, a <=12mm wide hex (or rectangle) will fail with a 6mm bit because the first inserted offset is too small to offset again, which happens the moment you move the mouse over the recently inserted cut.

    Since I cannot fix the offsetter, I have created code to detect the size and prevent the offsetter even being tried when the internal shape is too small.

    I have attached the modified file. You need to replace your existing file with this one.
    click Tools|PhlatBoyz|Display profiles folder
    search that folder for the filename 'PhPocketTool.rb' and replace the ones you find with the one attached here (with Sketchup closed of course!)

    This might not be a perfect fix yet, but it works for me so far.
     

    Attached Files:

    3DMON and TigerPilot like this.
  20. davdue

    davdue New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    Kansas
    Thanks that worked great.
     
    swarfer likes this.

Share This Page