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

[Plugin] PocketTool (out of bounds bug fixed)

Discussion in 'Other Sketchup related softwares/plugins' started by TigerPilot, May 29, 2010.

  1. TigerPilot

    TigerPilot Well-Known Member

    Offline
    Messages:
    1,578
    Trophy Points:
    48
    *I split this off from another thread. Basically, I (Kwok aka kyyu) was asked to look a bug in the pocket tool where the lines were places outside the bounds of the face. I was able to fix it by modify the plugin. Get it here, 5 posts down: viewtopic.php?f=103&t=2064#p20015

    The orginal plugin by toba was posted here: viewtopic.php?f=101&t=302&p=6975#p6975
    **************************************************************************************************************************


    How about tackling the pocket plugin. It has a bug, when I use it. Here is the problem.

    Draw a vertical line. Any length will do but let's say one inch.
    Draw a second vertical line below it. Again, any length and it doesn't have to be exactly bellow it. I can be to one side.
    Connect the two lines on one side and then on the other side. You now have a face. Use the pocket tool and, on my computer, the pocket lines are out of the face on one side.
    You have to do it as described above, since that is how I make most of my pockets. If you make it a continues line, the pocket tool works right.
     
  2. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Yoram,

    I'll have a look at it. I can reproduce the problem.

    Hay, don't get me wrong it trying to make the plugin writing sound too easy. I just want to give encouragement to people. It does take alot of time to get started.

    -Kwok
     
  3. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    There is alot going on in the pocket plugin, so I can't tell exactly where the problem is. But fixing your face, so the plugin works, is easy enough. Took about 3 hours of work, total. Give this plugin a try. Just select the face and use the right click context menu ("Reorder Edge Loop - pocket fix") -Kwok

    [deleted]
     
  4. cncmachineguy

    cncmachineguy Member

    Offline
    Messages:
    133
    Trophy Points:
    16
    Location:
    Odenton MD
    Hey Kwok, is there a way to combine the 2 so when we hit the pocket plugin, it will call the reorder edge loop then continue with the pocket?

    Then it would be a 1 step kinda deal. ;)
     
  5. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    You can default to the "pocket tool" at the end of the "reorder edge loop" plugin, like the way I default to the "move tool" in my "Slots 4 Tabs" plugin. Or you could write a simple plugin to call both in series. For example:

    Attached files ky_Pocket_test.rb (417 B)Â
     
  6. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Yoram,

    Ok, good news. I think I figured out what is wrong with the pocket tool and fixed it. :) Had to completely rewrite one of the methods. Test it out and see if everything is working. The old and new file can't be in the plugin folder at the same time, so I would just append a ".txt" suffix and it won't load. I also included the sketchup files, I used for testing. -Kwok





    Attached files Pocket testing.skp (9.3 KB)Â PocketTool (fixed).rb (7.6 KB)Â Reorder Outer Loop_2.skp (10.4 KB)Â
     
  7. 3DMON

    3DMON Moderator Staff Member

    Offline
    Messages:
    2,380
    Trophy Points:
    38
    Location:
    Sebastian, Florida
    Hey Kwok I just got a chance to play around with it a little and it works a lot better.
    Thank you for looking into this.

    Thanks to Yoram also for asking because it was something that bugged me too, lol.

    I've found myself recently using the phlatscript inside tool because the offset algorithm is so awesome. I do an inside cut line then phlatten it and do the inside cut tool again and so on. Its time consuming but it works pretty good on shapes the pocket tool will not do correctly.
    Now that the pocket plugin is working better I will use it a lot more.
     
  8. TigerPilot

    TigerPilot Well-Known Member

    Offline
    Messages:
    1,578
    Trophy Points:
    48
    Perfect, Kwok, you've nailed it. Thanks
     
  9. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Thank you Kwok :) I was doing the same thing as Shaun to get a nice looking pocket and it took a while to get it right, so this will be a big help.
    Mark and Trish
     
  10. RJGritter

    RJGritter New Member

    Offline
    Messages:
    23
    Trophy Points:
    0
    Sorry, I know this is an old thread, but I'm having one little issue with this plugin. I have an airplane that has some milled pockets that are little triangles, with 1/32" radius corners. I want to use my 1/16" bit to mill these, and I did a slight mod to the PocketTool to do milling patterns for that size bit. But... it fails to draw the offset lines around the border of the pocket. It draws the zig-zag, but not the border. Experimenting with it, it seems like you have to set the bit diameter to half the real value (and half the value of the drawn radius) to make it work.

    It's almost like it fails the border if the offset contour radii are smaller than the bit radius, but that shouldn't be necessary, if the true outer contour radii are equal to the bid radius. Has anyone already tackled this problem?

    I had that problem on a few other pockets with larger radii for a .25" dia end mill, but I didn't realize exactly what the problem was. Is there an easy fix for this? It's gonna be a TON of work to redraw the whole airplane with 1/4" and 1/16" radii to work around this bug.

    Thanks!

    RJ
     
  11. RJGritter

    RJGritter New Member

    Offline
    Messages:
    23
    Trophy Points:
    0
    I should add to that... when you hover over the face that you want to pocket, it "previews" the offset contour correctly as well as the zig-zag. Then, when you actually click on it, it only fully draws the zig-zag, and the offset contour just disappears.
     
  12. RJGritter

    RJGritter New Member

    Offline
    Messages:
    23
    Trophy Points:
    0
    Here's the rudder for the airplane I'm working on.

    Attached files [​IMG]
     
  13. Flashsolutions

    Flashsolutions Active Member

    Offline
    Messages:
    1,123
    Trophy Points:
    38
    Location:
    Leesburg, Florida
    Wow! Nice work on the pocket plugin! We have needed this for quite some time. :doubleup:
     
  14. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Hi RJ,

    Offset has always been a problem in general, not just in this plugin. Actually, if you zoom in on the corners of the offset lines preview, you will probably see it's not right. That's why it can't form a face, which is actually what it's trying to do, not making edges. I tested making the edges instead, but some were missing, so no easy fix.

    My advice would be, not to draw in the radius corners. You should get the same results, since milling automatically gives you the radius of the bit.

    -Kwok
     
  15. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Ok, I figured out how to get the offset edges to show like in the preview, even if there is a problem. You can give this new version a try:

    Warning: This is not a fix and could lead to problems further down the chain, like when adding centerlines and generating gcode. It just makes the bad edges that were rejected somehow by the workings of sketchup. So don't consider it an improved version. My advice is not to use it, but instead make sure you drawing is drawn properly. Use at you own risk!

    [file deleted]
    I deleted the file, so unsuspecting people won't start using it, thinking it's the next improved version.
     
  16. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Nice Kwok thanks for look at this again! Just downloaded and going to give it a try
    Mark and Trish
     
  17. xtremeRCpilot

    xtremeRCpilot Member

    Offline
    Messages:
    736
    Trophy Points:
    16
    Location:
    Cleveland, Ohio
    WOW RJ, why all those micro triangles? Looks cool!! :D
     
  18. Flashsolutions

    Flashsolutions Active Member

    Offline
    Messages:
    1,123
    Trophy Points:
    38
    Location:
    Leesburg, Florida
    Still not working well for rounded areas... Pocketing is a tough nut to crack.

    Attached files PocketTest.skp (2.8 MB)Â [​IMG]
     
  19. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Mark and All,

    I've added a warning above. My advice is not to use the new version, but instead make sure you drawing is drawn properly. I probably should have called it something else, besides add a "2". It's not improved. What was requested, was to create the missing outline which was shown in the preview, but not created by sketchup. It just makes the bad perimeter lines that sketchup, in it's wisdom, choose to reject! And can likely lead to other problems, later in the process. Like adding centerlines and the gcode. Personally, I would never use it.

    -Kwok
     
  20. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    I see, sorry about that Kwok :oops: I will change the announcement. My fault :)
    Mark and Trish
     
  21. RJGritter

    RJGritter New Member

    Offline
    Messages:
    23
    Trophy Points:
    0
    Kwok,

    Thanks for making this mod for me. I see what you're saying now, that the preview does not actually draw the offset properly, though it appears to from normal use.

    I ended up just taking the time to do manual offsets on all the files. It's only for two airplane designs, so it wasn't that big a deal... later on down the road, I'll have more time to find a better solution. I'll probably be experimenting with a couple other programs to do the pocketing.

    I'm not a big fan of the fact that the pocketing tool draws X-axis lines for the interior of the pocket, when the X-axis is the weaker axis of the roller design machine. I'm not seeing much skew, but I suspect it would be even closer to perfect if the pocketing didn't make the machine cycle back and forth on the X axis many hundreds of times. If the interior lines were "vertical" or Y-axis lines, the Y axis would get the workout while the X would make much shorter movements.

    Does anyone see what I'm saying here?

    RJ
     
  22. TigerPilot

    TigerPilot Well-Known Member

    Offline
    Messages:
    1,578
    Trophy Points:
    48
    RJ, I think the pocket tool does just what you want, y-axis lines. Mine does. I've checked it out just now, just to be sure. But if you don't like the line orientation, just rotate the drawing 90° and make the pocket then rotate the drawing back and the pocket lines are oriented the other way.
     
  23. RJGritter

    RJGritter New Member

    Offline
    Messages:
    23
    Trophy Points:
    0
    Hmm, interesting, mine definitely makes horizontal lines in Sketchup which results in X-axis movement on the machine. You're right of course, I should have rotated the drawing... just didn't think of it soon enough :roll:
     
  24. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    And also, if you don't make the small corner radius in the triangles (just leave the point), then the offset should work fine.
     
  25. dz1sfb

    dz1sfb Member

    Offline
    Messages:
    116
    Trophy Points:
    18
    All I can say is Wow! and Thank you! Worked very nice on rectangular pockets with radii in the corners. Generated the zig zag and perimeter clean up cut.
     

Share This Page