CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 25, 2017, 23:16:37 pm


Login with username, password and session length


Pages: [1] 2 3 ... 14
  Print  
Author Topic: Collision Detector/Cutter Selector  (Read 36576 times)
dave benson
CNC Jedi
*****
Offline Offline

Posts: 771


View Profile
« on: February 25, 2015, 01:35:53 am »

Hi All
I've been playing around with a routine to detect whether a end mill of a certain size would cut a particular shape.
So right now the code is composed of two parts, The back end which uses brute force and violence to check if the cutter will cut the shape without overcutting any areas in that shape. And a more subtle front end which can be given a set of rules to follow when attacking the problem depending on what the operator wants to achieve.
Of course the more rules you give the routine the better it gets at solving them.
In the picture below you can see that the routine has correctly identified that the cutter tested
would not fit in the arcs or cannot cut the slot and has identified the areas with a circle that would cause a problem. however I want more information to be displayed and depending on the complexity  involved I would like to do this.
1. Add a profile mop to the shape.
2. Move only the uncut portions of the lines to another layer.
3. That way if you bounce up and down on the space bar you can easily see where the uncut portions of your shape occur. (I think Macbob suggested this somewhere and I like it)
4. perhaps display the volume of the area of uncut material left.
5. Maybe a few check boxes to turn on and off the rules so the user could fine tune it to their own needs.
So what I would like are some more suggestions for the rules that make up the (rule set)
ie. don't check straight lines or arcs over a certain radius.
or perhaps a file that you think might stump the routine NO 3D files as yet.
or maybe a better way to present the data to the user.
Dave. 


* Collisions.PNG (14.33 KB, 351x349 - viewed 149 times.)
Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7086



View Profile
« Reply #1 on: February 25, 2015, 02:11:32 am »

Neat, Daver!

I think a 'minimum tool diameter' spec would be beneficial.  You don't want the thing suggesting a 0.050" x 4" long tool, yet you might find a 0.0625" diameter x 0.5" to be acceptable for some jobs.  The routine wouldn't know your limits without your specifying them, and probably shouldn't "second-guess" the user, since some folks are willing to use inappropriate tools to do special tasks. (yeah... me, too! <G>)

Lloyd



Logged

"Pyro for Fun and Profit for More Than Fifty Years"
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3066



View Profile
« Reply #2 on: February 25, 2015, 09:03:12 am »

Dave, looks great.
1. I didn't see user selected 'tolerance' mentioined
2. Did you account for 'Roughing Clearance' and any other parameters that could affect the toolpath.
3. The circles showing problem areas should be a different colour and on a new layer.
4. Should it include drilling mop ?
5. It only needs to consider angles below 180 deg.
6. Does it need to convert everything to Polylines first ? or can it do circles, rectangles, etc.
7. Would it be easier if the shape was 'exploded'  first ?
« Last Edit: February 25, 2015, 09:19:14 am by EddyCurrent » Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 771


View Profile
« Reply #3 on: February 25, 2015, 12:29:39 pm »

Dave, looks great.
1. I didn't see user selected 'tolerance' mentioined
2. Did you account for 'Roughing Clearance' and any other parameters that could affect the toolpath.
3. The circles showing problem areas should be a different colour and on a new layer.
4. Should it include drilling mop ?
5. It only needs to consider angles below 180 deg.
6. Does it need to convert everything to Polylines first ? or can it do circles, rectangles, etc.
7. Would it be easier if the shape was 'exploded'  first ?

Hi Eddy
Now there's some food for thought, thanks for the input.

1. No I had not thought about the selected 'tolerance' only about if the cutter would fit all the way
around the shape without overcutting it. A finishing cut really, But once I have the math worked right this
would be easy to do.

2. No But I'll keep this in mind.

3. Yes agreed they should be, and I'll do this while the scrip is in it's infant stage for debugging.
 if it's decided that this is the best way to show the collisions.
I have also thought about hi-lighting the segment of line instead and putting that on a different layer which
would give you a road map of the uncut portions of the shape.

4. Perhaps a spiral milling mop check as well.

5. Yes only acute and obtuse angles for inside and outside milling of the shape and ignore straight lines
altogether one rule set  of the code already does this.

6. Yes I've tried both ways, and both have their merits for instance if you make your shape a polyline I
discovered that you use the CB builtin function (polyline.GetPerimeter)  so you don't have to calculate it
yourself.

7. For some shapes I  exploded the shapes and then operated on the arcs and curves then joined it back
up. For some I did not.

Just some thoughts on the need for this script. My workflow here mostly goes like this.

1. Create a parametric 3d model.
2. From that I produce a .dxf file and import it to cambam.
3. Perhaps fiddle with the geometry a bit and apply mops to it.
4. Do some rudimentary checks with "Show Cut Widths" and generate the gcode
5. Backplot the file (there are some ok free backplotters out there) I may do this many times.
6. If it's a new file I'll run it on the cnc mill with the z axis disabled just to check it's cutting where I expect it
to.

So to make a useful script you need a clear and coherent idea of what it is that you need the script for.

So what I would like is someone to say is
 "I use CB  this way with files like this and it would save me a lot of time or mistakes if  I had a script that
did this because......"

Of course I'm quite happy to write the script and put in features that I think someone might find useful
But it's always better to have a plan.

I'd love to do this in VS with C#  so I could use the debugger, but as it would be a plugin you need to set
CB as the start up program So if anyone's managed to do this please let me know.

Dave.



Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3066



View Profile
« Reply #4 on: February 25, 2015, 13:43:19 pm »

I generally draw my object as you say then import to CamBam as dxf or stl. When drawing though I always know the minimum radius and keep that in mind when it comes to creating mops in CamBam. There will be occasions when a file comes from someone else in which case it would be great to identify the largest diameter tool for the job. I could also find it useful when doing inlays or indeed anything that has been scanned and converted to polylines.
Sometimes it would be better to modify the drawing in the indicated problem areas so as to use a bigger tool. that implies two main criteria for me,

1. identify and report the largest tool size for the job
2. indicate problem areas on the drawing for a specified tool size

I'd love to do this in VS with C#  so I could use the debugger, but as it would be a plugin you need to set
CB as the start up program So if anyone's managed to do this please let me know.

I don't know exactly what you mean here but I thought this would do the trick; http://www.cambam.info/doc/api/CreatingAPlugin.htm
Just follow the steps, paste in the code, and it works first time for me.
« Last Edit: February 25, 2015, 13:59:00 pm by EddyCurrent » Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 771


View Profile
« Reply #5 on: February 26, 2015, 00:17:57 am »

Hi eddy
Sigh...where to start
I'm using VS studio express and when you start a new plugin there is no way to set the target framework
so you get the new .NET 4 reference assemblies  this ok though as you can manually set this once the project has been created but you need to set CB as the start up project also to use the debugger.
So after a long and convoluted process I got a plugin (that displays the drawing units) to run with CB, But no debugger.(so I got discouraged and gave up)
If you have managed to do this (use the debugger with your project) with VS Express for C#.
I'd dearly love to know how.
Dave.
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3066



View Profile
« Reply #6 on: February 26, 2015, 09:23:23 am »

Dave,
Now I see what you mean, I don't use the debugging function so it's never been an issue for me.
I found this; https://social.msdn.microsoft.com/Forums/vstudio/en-US/4eb67204-2e09-4ead-9fe4-49815ebb3602/cannot-debug-a-dll-in-the-gac-using-visual-studio-express?forum=vsdebug
It sounds like VS2010 Express is not good in this respect, I tried the advice given and it seems to work up to a point, worth trying anyway.
« Last Edit: February 26, 2015, 09:30:18 am by EddyCurrent » Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 771


View Profile
« Reply #7 on: February 26, 2015, 13:13:25 pm »

HI Eddy
Thanks for effort
So after reading the thread you pointed to and looking at he msdn docs again I found that you can't debug
in the way we want to with CB and VS express 2010, So I downloaded the new VS community version
and I like it as it's not crippled in the same way as VS2010 express.
And I've got this far I loaded up the shapes plugin and set the startup project as cambam  set the debug configurations as per the msdn docs from "How to debug from a .dll project" and what do you know
when I started the debugger cambam fired up and I was able to select the plugin and it operated fine
except the break point I set didn't work and when I hovered over it and  I got a message that no symbols were loaded for the file and to check my debug settings which I did, and I tried to place the symbols database file in several different places to no avail.
But this is a great improvement and I ready like the layout of the new version and I feel like I'm very close to making it work. (Famous Last Words Maybe)
It's late here now 12.30 am so I'll to try some more things tomorrow.
Dave.
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3066



View Profile
« Reply #8 on: February 26, 2015, 13:19:22 pm »

Dave,

What about this ? http://www.icsharpcode.net/OpenSource/SD/Default.aspx
Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 771


View Profile
« Reply #9 on: February 27, 2015, 00:29:16 am »

HI Eddy
Thanks for the link, Looks interesting and seems like a light weight alternative to VS studio 2013 community  (9 gb download) Shocked
I've just down loaded Armandos Pyrthon/C# project and used the 2013 debugger with that and everything worked fine.
I've got a few hours today to play around with 2013 so I'll fiddle with it some more to see if I can get it to work.
I think I'm pretty close and it's something simple that I need to do, as the debugger complains that there is symbol file loaded yet I can see it and its populated with data.
Dave
Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 771


View Profile
« Reply #10 on: February 27, 2015, 03:50:50 am »

HI All
Well Hooray for that, I've finally managed to get the debugger working with VS 2013 and a CB plugin so now I think things can proceed at a faster rate as I can see the data in the arrays that hold the polyline data.
Now I've got to investigate C# properly and this may take some time. But I'm finally on my way.
Dave.


* Debug Working Capture.PNG (99.79 KB, 1346x738 - viewed 139 times.)
Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 771


View Profile
« Reply #11 on: March 02, 2015, 10:01:01 am »

Hi All
Just a small update in the screen shot below I've added some general info drawing units and the file path
and on the first tab page there buttons, checkboxes and some radio buttons.
you can use the plugin in three different ways.

1. You can just Query a shape to see what exact size end mill will cut the shape without over cutting the shape. You can then manually add a mop and use the next closest size down endmill you have.

2. Or you can get the code to look up a list of endmills that you have (not everyone has all the incremental sizes on hand) and choose the next closest size down endmill in the list, and you also have the option of Creating a mop and adding the selected endmill to it.

3. Or you have an option of entering an endmill size to test with ability to display the collisions in three
different ways on a separate layer with circles, points or arcs.

I did have an idea for a rule that lets the user select only a portion of the shape to check
as this would save time and memory on large shapes.
I've also thought about using a user configurable rule set, But this might confuse a casual user and yield poor results for them.

I've had the software a couple of days now and it seems quite robust! (I have tried to break it) But its coughed and politely pointed out the error of my ways and moved on.....
And as the software seems to work well I thought I'd do my bit, and properly acquaint myself with the language so I downloaded three different tuts including one Eddycurrent pointed out which is good and went through them from start to finish and lucky I did, as C# is a bit different than C++ when working with arrays. which had already caught me out.
So in short things are moving on albeit slowly for the time being.
Dave.


* First screen.PNG (35.12 KB, 635x419 - viewed 133 times.)
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3066



View Profile
« Reply #12 on: March 02, 2015, 10:30:35 am »

Dave, that looks superb and appears to be comprehensive in it's functions, looking forward to trying it out.
Logged
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 1675



View Profile
« Reply #13 on: March 02, 2015, 11:47:41 am »

Me too Smiley
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2203



View Profile
« Reply #14 on: March 02, 2015, 12:50:02 pm »

+3 Grin
Logged
Pages: [1] 2 3 ... 14
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.131 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap