Helix machining for circular holes
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Helix machining for circular holes
Right now, it doesn't work with freecad-daily :
Traceback (most recent call last):
File "/usr/lib/freecad-daily/Mod/Path/PathScripts/PathHelix.py", line 472, in Activated
toolLoad = PathUtils.getLastToolLoad(obj)
'module' object has no attribute 'getLastToolLoad'
Can I get some comments on https://github.com/m0n5t3r/FreeCAD/comm ... 7f7bb67f01? it mostly fixes the problem (I just lifted and adapted the code from the recent dogbone dressup fix, I don't know much about freecad internals); the only issue I have with it is the fact that the tool controller property doesn't seem to be saved or passed around correctly, which leads to annoying prompts if there are several tools defined.
And 2 nitpicks: is it possible to 1) make it sort the holes in a way that makes sense [1], and 2) not lift the tool after every spiral?
[1]
Traceback (most recent call last):
File "/usr/lib/freecad-daily/Mod/Path/PathScripts/PathHelix.py", line 472, in Activated
toolLoad = PathUtils.getLastToolLoad(obj)
'module' object has no attribute 'getLastToolLoad'
Can I get some comments on https://github.com/m0n5t3r/FreeCAD/comm ... 7f7bb67f01? it mostly fixes the problem (I just lifted and adapted the code from the recent dogbone dressup fix, I don't know much about freecad internals); the only issue I have with it is the fact that the tool controller property doesn't seem to be saved or passed around correctly, which leads to annoying prompts if there are several tools defined.
And 2 nitpicks: is it possible to 1) make it sort the holes in a way that makes sense [1], and 2) not lift the tool after every spiral?
[1]
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Helix machining for circular holes
I'll try to take a look but I'm traveling right now so it might be a bit. There should only be prompts if there are multiple tool controllers in the job and you don't have one selected in the tree when you create the operation. Those prompts would be appropriate since the operation has no way of knowing which tool controller to use.m0n5t3r wrote:Right now, it doesn't work with freecad-daily :
Traceback (most recent call last):
File "/usr/lib/freecad-daily/Mod/Path/PathScripts/PathHelix.py", line 472, in Activated
toolLoad = PathUtils.getLastToolLoad(obj)
'module' object has no attribute 'getLastToolLoad'
Can I get some comments on https://github.com/m0n5t3r/FreeCAD/comm ... 7f7bb67f01? it mostly fixes the problem (I just lifted and adapted the code from the recent dogbone dressup fix, I don't know much about freecad internals); the only issue I have with it is the fact that the tool controller property doesn't seem to be saved or passed around correctly, which leads to annoying prompts if there are several tools defined.
And 2 nitpicks: is it possible to 1) make it sort the holes in a way that makes sense [1], and 2) not lift the tool after every spiral?
[1] Screenshot from 2017-03-30 03-26-11.png
My longer term goal is to combine helical hole and Path Drilling into a single 'circular hole tool' This would have a better UI for sorting holes, filtering by size, enabling and disabling groups of holes, etc. The user would then choose which method to apply to all the selected holes; helical, drilling, or some other method. Unfortunately, I just haven't had time to finish it.
Part of that effort was to implement a very basic Traveling Salesman Problem solver for more efficient routing. If someone wants to pick up the ball and run with it, I'll push what I have now to a branch on my repo and help where I can. It shouldn't be too hard to finish.
Re: Helix machining for circular holes
I got that, but I think I'm adding the tool controller to the wrong object somewhere, because the selection dialog pops up every time I want to edit the PathHelix (and if adding with multiple holes already selected it would ask once for each hole AFAIR, but I added a check to see if it's already set and now it just asks once and ignores whatever you select after the first time for reasons I don't understand / haven't had time to dig into).sliptonic wrote: Those prompts would be appropriate since the operation has no way of knowing which tool controller to use.
Re: Helix machining for circular holes
[edit: pull request URLs]
I created a pull request for the tool controller fix, and I took a stab at job sorting this morning.
I would say this is an improvement over the image I posted previously:
I think this method (nearest neighbor weighted by the distance to one axis) is good enough for machining purposes; I'm no computer scientist, though, my theoretical knowledge of algorithms has quite a lot of holes in it (pun not intended)
I created a pull request for the tool controller fix, and I took a stab at job sorting this morning.
I would say this is an improvement over the image I posted previously:
I think this method (nearest neighbor weighted by the distance to one axis) is good enough for machining purposes; I'm no computer scientist, though, my theoretical knowledge of algorithms has quite a lot of holes in it (pun not intended)
Re: Helix machining for circular holes
Ha, Ha, Ha, ... so funny!m0n5t3r wrote: I think this method (nearest neighbor weighted by the distance to one axis) is good enough for machining purposes; I'm no computer scientist, though, my theoretical knowledge of algorithms has quite a lot of holes in it (pun not intended)
"Order is everything!"
Big step in the right direction/improvement; slip* will probably appreciate the help! And very timely at that; was just about to mill this part. This make it easier to plan for clamp-down of this part!
Re: Helix machining for circular holes
I think it is good to have a well defined algorithm. Although it is easy to fool the next neighbour algorithm it is on the other side easy to support in case it ever gets necessary, e.g. by dividing the drilling job in two separate tasks. If the order is left e.g. to the somewhat arbitrary order that is provided by the OCC numbering of faces and edges nothing can be done.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Helix machining for circular holes
Bill, some of the vertical moves seem to be rapid moves and some seem to be normal. Can you find a reason for that?bill wrote: was just about to mill this part. This make it easier to plan for clamp-down of this part!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Helix machining for circular holes
It is not purely nearest neighbor, it's a bit modified by adding the X coordinate to the distance; this improves things dramatically because it adds ... gravity to the algorithm (nearest neighbor tends to wander and make funny paths if there are several neighbours at the same distance, like in the rectangular grid I tested initially).chrisb wrote:I think it is good to have a well defined algorithm. Although it is easy to fool the next neighbour algorithm it is on the other side easy to support in case it ever gets necessary, e.g. by dividing the drilling job in two separate tasks. If the order is left e.g. to the somewhat arbitrary order that is provided by the OCC numbering of faces and edges nothing can be done.
Re: Helix machining for circular holes
Thank you m0n53r for this fix, it seems that it got merged just a few moments ago. One thing I noticed when testing this is that if you play around with those Absolute start height and Absolute final height -settings and accidentally end to situation where the start height < finish height for example and the "job" that gets into your sorting algorithm is empty, the whole FreeCAD freezes, so I quess your sort_jobs function never returns or something. I got rid of that by simply:
There is still something fishy about setting those absolute heights, but I think that has been the case for a long time and it has nothing to do with your fix.
Pekka
Code: Select all
if len(drill_jobs) > 0:
drill_jobs = self.sort_jobs(drill_jobs)
Pekka
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Helix machining for circular holes
Cool! Nice feature m0n5t3r. It's great to go away for a few days, come back and find new features. I should leave more often.
Perhaps you'll consider abstracting your method out, moving it to PathUtils, and implementing it for Drilling as well.
Perhaps you'll consider abstracting your method out, moving it to PathUtils, and implementing it for Drilling as well.