javaandroidg-codecnc

Convert string text to GCode


I need to create an app (using Android Studio) that generates CNC code to operate a 3D printer. It takes a String as input.

I've found a couple libraries in Python and Javascript that does this, but as I don't have time to translate whole libraries to Java, can you recommend any libraries that does that for me? If there are no open-source options, can you recommend any guide to help me develop this conversor?


Solution

  • What we ended up doing:

    1. App asks for a String as input;
    2. String is converted to a bitmap and then saved as a .png;
    3. .png is loaded and converted to a .svg file. We used this repo: https://github.com/jankovicsandras/imagetracerandroid
    4. We developed a parser to convert a .svg to g-code.

    It worked but it's not the best solution, we're looking to implement something that runs python in Android, as there are many pythons that do all the work already, but that's how we've done it and it's working by now.