sorting helixes to make efficent path

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

sorting helixes to make efficent path

Post by Erich Schulz »

so I've just added a bunch of helix operations for my pin board project (thanks for the tips to add all the holes in one button click)
Screenshot from 2019-07-12 21-41-57.png
Screenshot from 2019-07-12 21-41-57.png (23.59 KiB) Viewed 1453 times
the next thing is how to sort operations...

ideally some kind "travelling salesmen" algorithm would be used, (eg https://developers.google.com/optimization/routing/tsp)
but failing that the sorting or x then y, or y then z would be good...

if not a full travelling salesman algorithm, and just a simple "x then y" it would be good if the y sort alternated ascending/descending so that the mill zig-zagged down the case

(although since someone has already published the TSP code then not sure if anyone would prefer a crudely sorted algorithm)
Attachments
pintable2.FCStd
(526.24 KiB) Downloaded 69 times
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: sorting helixes to make efficent path

Post by Russ4262 »

Erich Schulz wrote: Fri Jul 12, 2019 12:06 pm...
the next thing is how to sort operations...
...
Simple request. Basic solution is simple. I copied (X, Y) sorting instruction from Drilling Op into the Helix Op: PR #2337 [Path] PathHelix: Add simple x,y path sorting. This will provide a simple sort automatically.


More complex sorting I will leave for another time or another dev.


Thanks for the feedback.
Russ
Attachments
simple (X, Y) sort in proposed PR #2337 - same as Drilling Op
simple (X, Y) sort in proposed PR #2337 - same as Drilling Op
pintable2_A-1.png (161.43 KiB) Viewed 1440 times
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: sorting helixes to make efficent path

Post by Erich Schulz »

sounds great thanks Russ!

it doesn't look too hard to incorporate a full travelling salesperson algorithm into that function

when does that sort get implemented? is it only on the "reset" button press, or every time a geometry is added?

I wonder if anyone would ever need to set up the order in specific sequence
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: sorting helixes to make efficent path

Post by Russ4262 »

Morning, Mr. Schultz,
Looking at the FreeCAD repo on GitHub, it appears 0.19.17352 release builds are being created and posted today for users to download. Checking the commit history, the basic sort presented in PR#2337 is probably not included. It will be in the next nightly build that admin releases - probably a couple days to a week depending upon commit volume and other factors.


Erich Schulz wrote: Sat Jul 13, 2019 11:19 am it doesn't look too hard to incorporate a full travelling salesperson algorithm into that function
... is it only on the "reset" button press, or every time a geometry is added?
I wonder if anyone would ever need to set up the order in specific sequence
I'm not familiar with the traveling salesperson algorithm, but I am familiar with the idea - shortest, most efficient route to hit all towns on the list. At the moment, I don't think path sorting more than simple (X, Y) is a top focus for devs at the moment. The ability for the user to custom group base geometry features in many of the path operations, the ability to create multiple operations easily, and the fact that operations can quickly be reordered allows for a reasonable amount of path sorting - even if it means a little more work for the user. For these reasons, and perhaps others, I don't see devs doing much in the short-term with more complex sorting algorithm integration.

As for the basic sort, it is applied automatically anytime the operation as a whole is changed and recomputed.

Make sure your doorbell is working so you'll hear the delivery man with your Mach3.

Have a great day.
Russ
Last edited by Russ4262 on Sat Jul 13, 2019 3:17 pm, edited 1 time in total.
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: sorting helixes to make efficent path

Post by bill »

Sounds like you guys are getting things "Sorted Out" :lol: !

Time for a Cupper/or Mugger!

Woolshed still in operation?
Surfer's Paradise Grand Prix still happening or has it been moved?

And most of all; remember to Dodge, duck, dip, dive and dodge (movie: Dodgeball reference) from those Lorikeets!
Post Reply