A Much Faster F-Engrave (V1.40)
The latest version of F-Engrave includes major improvements to the v-carve calculation speed. The first is based on input from geo01005. He shared his work on his BLOG and in this YouTube Video. The added code that breaks up the design area into a grid and stores the grid locations that are within the tool diameter. The v-carve algorithm uses this data to skip over line segments that are farther than the max tool diameter from the current line segment. F-Engrave had previously skipped some segments but geo01005’s implementation was significantly (2 to 3 times) faster.
In addition to the code changes geo01005 also showed that using Psyco with F-Engrave was of great benefit. Psyco is no longer supported and is not compatible with the latest (or most commonly used) Python distributions. However, the speed improvements were significant enough (3 to 4 times faster) to convince me to downgrade to Python 2.5 for the windows executable distribution. I am sticking with Psyco rather than another JIT compiler (pypy, Jython, IronPython, etc.) because Psyco is easy to implement and compatible with Py2exe. I use Py2exe to generate the windows executable files.
The final speed improvement, which is turning off plotting, has been available for some time in F-Engrave. I have not pushed the use of this feature because the savings has only been a small percentage of the total v-carve time (depending on the design). With the other improvements included in V1.40 plotting has become a significant player in the total calculation time. Now turning off plotting can make the v-carve calculation 2 to 3 times faster (or significantly more depending on the design). I have added a check button to the calculation window so the plotting can be turned on/off, on the fly, during the v-carve calculation.
So if you are paying close attention you can see that all of these increases in speed build on each other (multiply not add) and result in a v-carve calculation 12 to 36 times faster than in the previous versions of F-Engrave.
I have also been digging into the code and fixing various minor bugs and adding some features to make aligning multiple v-carve files easier. Here are the highlights of the other changes:
- Changed Default Origin behavior (for DXF/Image files) to be the origin of the DXF file or lower left corner of the input image. (“Bot-Left” still provides the same functionality of the old “Default” setting)
- Added automatic scaling of all linear dimensions values when changing between units (in/mm)
- Fixed bug in clean up function in the v-carve menu. (the bug resulted in excessive Z motions in some cases)
- Fixed bug resulting in the last step of v-carving for any given loop to be skipped/incorrect.