Madav Ramanuj
3rd July 2016, 12:38
Hi,
I'm working on a project where the program generate the QPainterPaths, later this path will be converted to GRBL commands and fed to the CNC machines.
I see from the QPainterPath source most of the paths of arcs, ellipse and curve are converted/drawn using cubic bezier curve by calling cubicTo.
Unfortunately GRBL provides commands for only arcs and lines.
So the bezier curve need to be converted/approximated in to set of arcs and lines before the bezier curve can be drawn by the machine.
So can someone please let me know how this can be achieved in Qt?
what I'm tying to achive is same as mentioned in these document.
Cubic bezier approximation
http://ac.els-cdn.com/S0377042796000568/1-s2.0-S0377042796000568-main.pdf?_tid=10054424-40cd-11e6-a0ac-00000aab0f26&acdnat=1467516196_4d834409d16fc84d0915fa82b6afe5bc
Quadratic bezier approximation
http://ac.els-cdn.com/0377042794903980/1-s2.0-0377042794903980-main.pdf?_tid=3f290ed0-40c2-11e6-887b-00000aab0f6c&acdnat=1467511550_a096d6d8d563c64111642e0e264dd6c7
I'm working on a project where the program generate the QPainterPaths, later this path will be converted to GRBL commands and fed to the CNC machines.
I see from the QPainterPath source most of the paths of arcs, ellipse and curve are converted/drawn using cubic bezier curve by calling cubicTo.
Unfortunately GRBL provides commands for only arcs and lines.
So the bezier curve need to be converted/approximated in to set of arcs and lines before the bezier curve can be drawn by the machine.
So can someone please let me know how this can be achieved in Qt?
what I'm tying to achive is same as mentioned in these document.
Cubic bezier approximation
http://ac.els-cdn.com/S0377042796000568/1-s2.0-S0377042796000568-main.pdf?_tid=10054424-40cd-11e6-a0ac-00000aab0f26&acdnat=1467516196_4d834409d16fc84d0915fa82b6afe5bc
Quadratic bezier approximation
http://ac.els-cdn.com/0377042794903980/1-s2.0-0377042794903980-main.pdf?_tid=3f290ed0-40c2-11e6-887b-00000aab0f6c&acdnat=1467511550_a096d6d8d563c64111642e0e264dd6c7