Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize direction changes when milling #433

Merged
merged 5 commits into from
Jun 17, 2020
Merged

Conversation

eyal0
Copy link
Contributor

@eyal0 eyal0 commented Jun 17, 2020

When creating a euler path, rather than select the first choice each time, select whichever one keep the milling head travelling in the same direction as much as possible. So if the goal is to mill the red shape, rather than choose a route like the purple one, choose a route like the green one.

image

This fixes #417

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.07%) to 68.024% when pulling 242962f on eyal0:euler_curves into df24580 on pcb2gcode:master.

@eyal0
Copy link
Contributor Author

eyal0 commented Jun 17, 2020

I just looked at the am-test example and it's pretty exciting! Here's what it looks like without this change:

image

I count 6 right-angle turns and 2 u-turns.

Here it is after this change:

image

That's 5 right-angles and no u-turns. The amount of total backtracking is identical.

Notice that there is a jump at one point. pcb2gcode calculated that it would be faster to lift, g0, and lower over there rather than backtrack. In other case, though, backtrack was chosen. If I run pcb2gcode with --g0-vertical-speed=5in/min, then I've told pcb2gcode that lifting and lowering the tool with G0 is at 5inch/minute, instead of the default of 50in/min. This is much slower than the default so now backtracking becomes a better option and the jump to complete the shape is removed. Cool!

@eyal0 eyal0 merged commit f1d4438 into pcb2gcode:master Jun 17, 2020
@eyal0 eyal0 deleted the euler_curves branch June 17, 2020 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Euler paths attempt to avoid curves
2 participants