-
Notifications
You must be signed in to change notification settings - Fork 141
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
New feature: Arc filter #8
Comments
I've recently added arc fiter to my fork of bCNC: https://github.com/Harvie/bCNC/blob/master/lib/bpath.py See these two methods:
Currently it only works only for flat 2D toolpaths (no Z coordinate support). But i think it can make you understand basic principles of arc fitting. It's quite easy: 1.) You take two lines and try to approximate where their orthogonals intersect each other and how far this intersection is. That gives you parameters of arc: center, radius and CW/CCW direction. Also i use similar algorithm to fit/merge lines with very small tolerance before i start fitting arcs, that's especially important when arcfiting STL slices and other shapes, where one line can be split to two as result of triangulation. So basicaly you need three basic building blocks: 1.) method to merge lines that are almost parallel In 3D you will also need to check if the Z ramp is constant. Eg. if first line is 10mm long in XY plane and travels -3mm in Z direction, you have to make sure that when you add another 30mm (XY) segment, it will travel another -9mm in Z. So the ramp angle remains constant. |
An arc-filter in python, developed for slic3r:
http://wiki.linuxcnc.org/cgi-bin/wiki.pl?LinesToArcs
If this algorithm is good, it should be converted to c++, extended to handle all planes (XY, XZ, YZ), and added to opencamlib.
The text was updated successfully, but these errors were encountered: