Turtle Graphics on EleksDraw



  • Has anyone made a Turtle Graphic module the outputs to EleksDraw instead of the screen?

    I find some programs in Python that drive EleksDraw, but would like to have the ability to draw on EledsDraw with Turtle commands -- especially for drawing some of the fractal curves.

    Would be happy to have it in Python, but any of the major languages....


  • Developer of T2Laser Software

    @earlfurman T2Laser supports PLT (HPGL) format which is similar. It would not be that difficult to convert Turtle Graphics to G-code but you would still need a "sender" to get the code to the machine correctly. You could use T2Laser or something like GrblController for that but it wouldn't be an integrated solution.

    What is the reason for wanting to use Turtle Graphics rather than draw in Inkscape (which can run python scripts) or a similar program and then export the result as DXF which can already be loaded and sent to the machine with T2Laser or other software?



  • Two reasons:

    1. For students. Seeing the "turtle" drawing on the screen is one think, seeing the control over an actual machine is another, and a nice introduction to machine control.
    2. Frustration with moving a Hilbert curve, generated by Python turtle, from the screen to Inkscape to T2 to Eleksdraw. (by the way... thank you for T2: no more unhandled exceptions and after replacing the Nano no more hang ups). Low order fractal curves transfer well, higher order ones often have distortions.

    Have found pieces of Python code that drive the plotter, and a simple set of turtle commands would not be too hard to convert to G-code. Was just wishing someone had already done the job... Seems to require three parts: Communication, initial setup and control of the Eleksdraw, and the turtle-to-g-code library.

    Have not tried Python scripts within Inkscape. Thanks for the idea, will look into that.


  • Developer of T2Laser Software

    @earlfurman If you have an example of a file that doesn't load correctly, please send it to me and I will take a look. I have never had any issue with PLT files and most DXF files work as well. If there's distortion it may be due to complex splines, you can change the import settings to correct these in most cases.

    I would be interested to add any features that may benefit other users but would need to understand more. You can email if you like, my contact information is on my website.



  • The DXF file loads fine. I took a screen->BMP file of a level 8 Hilbert curve into Inkscape. There traced bitmap and produced DFX file. Loaded that into T2 where it said 37m long. T2 worked fine, but the ball point pen dried and clogged at about 25m.

    I suspect that it is my lack of skill using Inkscape for BMP->DXF conversions that is causing the DXF to not have good right angle corners and other artifices in the final plot. My long term goal is not to get screen captures into Eleks, but to control Eleks from python.

    In any case, have found places online where some work has been done using python to generate G code for plotters.

    My assumption is that I can send G code directly to the Eleks. There is a lot for me to learn. For example how to handle acceleration, velocities at corners, how to have an emergency stop. Am retired C++ windows programmer, but do NOT want this to become a "job", but remain a part time hobby.


  • Developer of T2Laser Software

    @earlfurman If you want you can send me a few examples of the turtle files. My understanding is it's very similar to a HPGL PLT file which T2Laser already loads so it would be easy to support this format.


Log in to reply
 

Looks like your connection to Offical Forum was lost, please wait while we try to reconnect.