Spiral Pocket Circle Gadget

This forum is for users to submit their own gadgets to the community
Post Reply
DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Spiral Pocket Circle Gadget

Post by DVE2000 »

I kind of just did this one for fun. I know there's a spiral gadget already available, but this one is more concerned with using a tool and its stepover to create a spiral for either cleaning the surface a material with a spiral pattern instead of a 2D pocket, or to hog out all the material of a circle in a spiral pattern.

It allows you to create spirals that are going to be used for climb or conventional cut directions. The start and end points of the spiral are changed so that when you create a on-vector profile toolpath, the selection of climb or conventional cut is honored properly. The tool also creates the bounding circle around the spiral for visual effect, but the circle is not needed for actual cutting. The circles are also put on their own Layer.

What I think is really nice about the gadget is that you can select multiple spirals, run the gadget, and you can change all the parameters for the selected spirals at once (except for center x and center y). The old spirals are deleted, and new ones are created with the new parameters. If you select the outer/visual circles at the same time, they're also deleted and redrawn. You can selected whatever things you like before you run the gadget - only spirals and their associated circles will be affected.

You could do something like create a spiral, and then use the Array Copy tool to create a pattern. Seeing the spirals would still be all selected, you could rerun the gadget and change the parameters for all the spirals. Similar to the Circle tool, except you can have more than one spiral selected.
Capture.JPG
The arc tool for contours in the Lua SDK doesn't behave well. You can create spirals with lots of little straight lines (the way the original spiral gadget does it) or create them with Bezier curves. The Bezier approximation uses way less points, but the inner portions of the spirals are a bit off. It doesn't really matter though - the cutting overlap will take care of the little inaccuracies at the center of the spiral.

ToDo:
  • Creating ToolPaths automatically would be nice. I may get to it at some point
  • Grouped spirals are currently ignored
To install, download the zipfile, change .zip to .gadget and then double click the renamed file or open the file with Aspire/Vcarve Pro.

For programmers, I managed to figure out a few cool things that I haven't seen for other Gadgets. The first was being able to disable or change label texts when the dialog is first opened. I figured out how to use a JavaScript timer to call a function to read the bits of a hidden text box. The Lua script can set the value/bits of the text box. This allows the script to disable the centerx/y text fields if multiple spirals are selected. It also allows the script to change the text of the "Add" button to apply. It pretty much eliminates the race condition when the dialog is displayed. It goes: create dialog, add and set fields in lua, show dialog, timer times out in 1ms and then calls the JavaScript function, fields are read and the control elements are modified

I figured out how to do tooltips as well. I don't think I've seen those for any other Gadgets. For some fields, you get a useful little popup by the mouse with some additional info. May get annoying for users though.

I also put the entire dialog display in a loop. Hitting Enter instead of just closing the Gadget will Add/Apply and then the dialog is reopened. You close the dialog by hitting Escape or clicking the Close button. This makes it more like the Create Vector tool in Aspire/Vcarve.
Attachments
Spiral_Pocket_Circle.zip
(7.71 KiB) Downloaded 610 times

User avatar
jimwill2
Vectric Wizard
Posts: 612
Joined: Tue Aug 31, 2010 1:48 am
Model of CNC Machine: CaMaster Stinger w/recoil, FTC
Location: Parkville, Missouri

Re: Spiral Pocket Circle Gadget

Post by jimwill2 »

I downloaded your gadget and played with it a little... well done! Thanks.
Jim Williams

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Spiral Pocket Circle Gadget

Post by TReischl »

Hello DVE.

Neat gadget.

I have thought for a long time a spiral tool path would be very handy, especially for 3D work that is round in shape. So I downloaded and installed. It sort of works for what I had in mind. The hang up for what I would like to do is that if I spec a tool it leaves that amount around the periphery. Also noticed that it does not like ball nose end mills (of course, it is designed for pocketing not finish tool pathing in 3D).

Then it dawned on me! I spec'd a very small end mill, let it generate the path projected onto the 3d model, and voila!

What I really, REALLY like is the ability to control where the toolpath starts, inside or outside. I absolutely do not like that the normal version of "spiraling" starts in the middle. I like to start on the outside where I know the first cuts will be shallow most of the time.

Here is one I just did:
Capture.JPG
I selected a .007 diameter tool to control the amount of stepover then projected the spiral toolpath onto the 3D model. I like it!!! (yea, this one has a lot of wasted air cutting time because it is not actually round, but hey, the concept works great!)



So yea, this is a really handy gadget and I will be using it. Off I go to do a few more test runs on real models. Should work just fine now that I figured out not to try to tell it the actual size of the ball nose I will be using.

Edit: One of the really great things about this is that it ends the decelerate, step over, accelerate motion that results in a very slight mark on the work piece. Not to mention that it is a tad faster because of that.
"If you see a good fight, get in it." Dr. Vernon Johns

User avatar
scottp55
Vectric Wizard
Posts: 4704
Joined: Thu May 09, 2013 11:30 am
Model of CNC Machine: ShopbotDesktop 5.5"Z/spindle/VCP11.5
Location: Kennebunkport, Maine, US

Re: Spiral Pocket Circle Gadget

Post by scottp55 »

Thanks DVE2000 :)
Downloaded, but haven't played with it as this laptop is amazingly slow.

Ted,
Let us know how playing with it turns out :)
Haven't seen those marks on my work since Stepover Retract came out, but then my machine is small and tight.
DO remember sanding out that mark on a dozen Tiny Owls, before it came out though.
Looks interesting!! :)
scott
I've learned my lesson well. You can't please everyone,so you have to please yourself
R.N.

DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Spiral Pocket Circle Gadget

Post by DVE2000 »

You're welcome, guys!

Ted, the reason I came up with this is *exactly* because of the decelerate-stepover-accelerate motion of a normal pocketing toolpath. I'd been creating some Corian and fiberglass resin coasters, and the normal pocketing toolpath for resin cleanup leaves a lovely line of circles where the pocketing circles start and stop. I know I have to sand anyway, but that just makes it take a bit more effort.

It's really easy to allow other types of bits in the gadget - in fact I have all the other types in the code but they're just commented out. You could use a text editor and remove the comment (which is -- in lua) from the part of the code which has the allowed bits. It's line 292 in the code.

Gary

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Spiral Pocket Circle Gadget

Post by TReischl »

Thanks for that tidbit. I am a programmer but have never looked into doing anything in LUA. You might say that I have seen enough code to last the rest of my life! 8)
"If you see a good fight, get in it." Dr. Vernon Johns

DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Spiral Pocket Circle Gadget

Post by DVE2000 »

It’s a pretty simple language. I only learned it to be able to create Vectric Gadgets. It may be simple, but it’s powerful at the same time. The SDK has plenty of good examples. As do the existing gadgets.

User avatar
scottp55
Vectric Wizard
Posts: 4704
Joined: Thu May 09, 2013 11:30 am
Model of CNC Machine: ShopbotDesktop 5.5"Z/spindle/VCP11.5
Location: Kennebunkport, Maine, US

Re: Spiral Pocket Circle Gadget

Post by scottp55 »

Gary......Consider me Code Illiterate:(
Did open, but only in Notepad which didn't show Line#s.
Can you recommend a different program that Does show Line#, and pretty please tell me how to change the Line to include Tapered Ball Noses?
It would be VERY much appreciated!!
Played with it on a Dome/Dish, and liking the possibilities for Tiny 3D :)
Thanks!
scott
I've learned my lesson well. You can't please everyone,so you have to please yourself
R.N.

User avatar
Mark's Wood Chips
Vectric Craftsman
Posts: 201
Joined: Thu Mar 19, 2015 12:36 pm
Model of CNC Machine: ShopSabre 23 with Rotary
Location: Hubertus, WI 53033
Contact:

Re: Spiral Pocket Circle Gadget

Post by Mark's Wood Chips »

scottp55 wrote:Can you recommend a different program that Does show Line#
scott
Scott,

Look for "Notepad++"

Mark

DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Spiral Pocket Circle Gadget

Post by DVE2000 »

Scott, open Spiral_Pocket_Circle.lua with Notepad, hit ctrl-f and type in "ball" without the quotes. Hit Enter. Close the Find dialog. Your cursor will be on the correct line. Hit the Home key, use the arrow keys to get to the first dash, remove the double dashes with delete, and hit ctrl-s to save. You should be good to go.

This is what the line looks like before:

Code: Select all

  --dialog:AddToolPickerValidToolType("ToolChooseButton", Tool.BALL_NOSE)
And afterwards:

Code: Select all

  dialog:AddToolPickerValidToolType("ToolChooseButton", Tool.BALL_NOSE)
Last edited by DVE2000 on Thu Aug 01, 2019 4:24 pm, edited 1 time in total.

ger21
Vectric Wizard
Posts: 1592
Joined: Sun Sep 16, 2007 2:59 pm
Model of CNC Machine: Custom DIY
Location: Lake St Clair, MI, USA
Contact:

Re: Spiral Pocket Circle Gadget

Post by ger21 »

In Notepad, try View > Status Bar, and you'll get line numbers.
You may need to turn of Wordwrap in the Format menu.
Gerry - http://www.thecncwoodworker.com

User avatar
scottp55
Vectric Wizard
Posts: 4704
Joined: Thu May 09, 2013 11:30 am
Model of CNC Machine: ShopbotDesktop 5.5"Z/spindle/VCP11.5
Location: Kennebunkport, Maine, US

Re: Spiral Pocket Circle Gadget

Post by scottp55 »

Thanks all!! :)
May not get to it till tomorrow, BUT what a helpful forum for all!! :D
Thanks for the Idjit instructions Gary!!
scott
I've learned my lesson well. You can't please everyone,so you have to please yourself
R.N.

DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Spiral Pocket Circle Gadget

Post by DVE2000 »

This won’t work with version 10, unfortunately. They’ve added an additional argument to the AddToolPicker function. I opened a bug asking for a new version of the API. The one on the website is still for 9.5. Tech support replied that the new API should be out within the next couple of weeks.

I may try see if I can guess at the argument for now. Seems to be a required tool database number.

I’ve been working on enhancements to allow you to select any shape, and a spiral will be created to the diameter of the smaller of the X or Y lengths of the shape bounding box. This will easily allow spirals to be added to existing circles. I just need some final testing.

DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Update for Version 10

Post by DVE2000 »

I've been sitting on this for a good long while. When Vectric created the new tool database, they pretty much broke the ability to be able to update the toolpicker with saved tool information. I've had a couple of cases open, and the suggestion was to create automatic toolpaths, which is probably not what most people would want to do.

So, to work around this, I added text boxes for tool diameter and stepover. You can still use the toolpicker (but it's no good between sessions for remembering previous selections), but you have the ability to override values from the toolpicker(s) or to override what was saved with a spiral.

As I said above, you can also add a spiral to any existing circle now too. You just have to select it before you open the gadget. In fact, you can add a spiral to any shape, but the surrounding box is used, and it will still be a circular spiral.

Remember to change .zip to .vgadget and then just double click it. This won't work for versions before 10, unfortunately.

I'd forgotten about doing this fix, but kstrauss sent me a reminder about version 10...
Attachments
Spiral_Pocket_Circle.zip
(13.82 KiB) Downloaded 321 times

Post Reply