A quick fix for PathDrilling

Here's the place for discussion related to CAM/CNC and the development of the Path module.
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

A quick fix for PathDrilling

Postby roivai » Sat Apr 29, 2017 7:36 am

Hi,

I tried to create a toolpath for drilling and realized there are some things broken in PathDrilling. Adding and removing the features to drill were completely commented out, so current behavior is that all holes of the Base feature bigger than the tool diameter are drilled. Based on commit comments, these issues are already known by sliptronic at least I guess?

Anyway, to get the path done I modified the PathDrilling so that I am able to remove objects from the list, otherwise it would be impossible to drill with two different tools, for example. Also, I enabled the "Find All" -button in the Task Panel so that it resets the object list to contain all holes in the base feature. Adding features felt like out of my skills, so I didn't touch that.

I dont know if that is useful to merge, testing of it is very limited and as there are still broken features, a bigger overhaul should be done. But if someone happens to need drilling feature right now, here is a commit I made:
https://github.com/pekkaroi/FreeCAD/com ... dd64f32a7d
User avatar
Kunda1
Posts: 5927
Joined: Thu Jan 05, 2017 9:03 pm

Re: A quick fix for PathDrilling

Postby Kunda1 » Sat Apr 29, 2017 11:45 am

Please add your Help > About FreeCAD > copy to clipboard
Since this looks like your modifying 0.16 code
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 5927
Joined: Thu Jan 05, 2017 9:03 pm

Re: A quick fix for PathDrilling

Postby Kunda1 » Sat Apr 29, 2017 12:31 pm

Also, feel free to checkout Path bugtracker: https://freecadweb.org/tracker/set_proj ... ct_id=4;15
And you're welcome submit PRs to https://github.com/FreeCAD/FreeCAD that way they have a higher chance of getting visibility and implemented. Cheers :)
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: A quick fix for PathDrilling

Postby roivai » Sat Apr 29, 2017 1:48 pm

Thanks for the comment, my repo branch was reset to master this morning, so it is 0.17.. Like I said, I don't feel like creating a pull request out of that, as it does not fix the functionality completely and quite frankly, I don't understand too much about how that PathDrilling even works, so I am quite sure there is something I missed.

Pekka

OS: Debian GNU/Linux 8.6 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10887 (Git)
Build type: Unknown
Branch: master
Hash: 67fc70dadae471cb3d77dcf5562b4a86ec79f95d
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0
User avatar
sliptonic
Posts: 1577
Joined: Tue Oct 25, 2011 10:46 pm

Re: A quick fix for PathDrilling

Postby sliptonic » Sun Apr 30, 2017 9:15 pm

roivai wrote:Hi,

I tried to create a toolpath for drilling and realized there are some things broken in PathDrilling. Adding and removing the features to drill were completely commented out, so current behavior is that all holes of the Base feature bigger than the tool diameter are drilled. Based on commit comments, these issues are already known by sliptronic at least I guess?
Yeah, you've stumbled into another half-finished area where my vision has out-paced my time. The problem I see is that drilling operations can sometimes have hundreds of locations. This really becomes apparent when we start working with Arch Panels Sheets. It's just not practical to ask the user to manually select and add them. On the other hand, drilling everything isn't right either. So, we need to automatically determine the set of drillable locations but give the user tools to effectively manage this list.

So my goal for this dialog is this:
  1. When creating the drilling operation, all drillalble locations bigger than the tool diameter are located and added to the list. DONE
  2. The user would never remove a location from the list but could disable items as desired THIS IS WHY FUNCTIONALITY IS COMMENTED OUT
  3. The list would be sortable by name and size. NOT DONE
  4. There would be a button to (de)select ALL
  5. Multi-select would be enabled so groups of locations could be selected by Ctrl+clicking, etc. NOT DONE
  6. A user can add a 'custom' location. This would allow picking a location on the canvas or entering the coordinates manually. NOT DONE
  7. Custom locations could be enabled and disabled like other locations. I haven't decided if they could be deleted though. NOT DONE
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: A quick fix for PathDrilling

Postby roivai » Mon May 01, 2017 6:16 am

Thanks for the explanation. I think your vision is really good!

One thing in my mind is that there should be a way to automatically detect not only holes that are bigger than the tool, but holes with certain diameter (with some tolerance of course). For example, if I have gazillion 5mm holes and 8mm holes in a plate, I could automatically generate two drilling operations, one for each hole size and not need to deselect the 8mm holes from the 5mm operation. Of course if the list is sortable, that is not a big improvement any more..

Implementing most of the things in your list could be in the reach of my skills and that could be a nice opportunity to study Path and FreeCAD in general, so I might give this a try, unless you ( or someone else) is working on this right now?

Pekka
User avatar
sliptonic
Posts: 1577
Joined: Tue Oct 25, 2011 10:46 pm

Re: A quick fix for PathDrilling

Postby sliptonic » Mon May 01, 2017 1:31 pm

roivai wrote: Implementing most of the things in your list could be in the reach of my skills and that could be a nice opportunity to study Path and FreeCAD in general, so I might give this a try, unless you ( or someone else) is working on this right now?
Awesome! I'll help any way I can. My FreeCAD time has been really limited lately and I've spent most of it playing with the new PathArea stuff and Arch panels so this would be a huge help.
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: A quick fix for PathDrilling

Postby roivai » Mon May 01, 2017 8:21 pm

I worked with this today, mainly fiddling with QT since it's been a while since doing that.. I came up with this kind of interface (I'm no UI designer at all :D ):
2017-05-01-230925_3840x1200_scrot.png
2017-05-01-230925_3840x1200_scrot.png (41.5 KiB) Viewed 886 times
Both columns are sortable, you can enable/disable features to drill with either by clicking the checkbox or selecting one or many rows and using buttons below the list.

I also copied the the sorting algorithm developed by m0n5t3r in the PathHelix for drilling and it seems to work really well.

Here's what I did:
https://github.com/pekkaroi/FreeCAD/com ... 64e8c17d01
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: A quick fix for PathDrilling

Postby bill » Tue May 02, 2017 2:35 pm

Does PATH:Drill Operation still have the ability to just drill a point; or is it all arc/hole/circle-based now? HMM?
Cant seem to generate a drill-path for the following:
The picture reflects the final part. The drill-points occur before any other machining!

Edit: I am trying to relieve these points with a pseudo-dogbone!
DBeffect.png
DBeffect.png (23.59 KiB) Viewed 852 times
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: A quick fix for PathDrilling

Postby roivai » Tue May 02, 2017 4:52 pm

bill wrote:Does PATH:Drill Operation still have the ability to just drill a point; or is it all arc/hole/circle-based now? HMM?
Cant seem to generate a drill-path for the following:
As far as I understand, that is not possible with the current implementation in master. And not with my version either. From sliptonic's list:
6. A user can add a 'custom' location. This would allow picking a location on the canvas or entering the coordinates manually. NOT DONE
would be the way to handle that. I am thinking that user could select the features (edges, points?) from the document and add those to the list of drilled points. I'll see if I can implement such a thing.

Edit: Typo