Android Question Text to GCode CNC Machine

Discussion in 'Android Questions' started by fernando.oliboni, Jul 27, 2018.

Similar threads

B4A Tutorial CharSequence / CSBuilder Tutorial
B4A Tutorial Integrating Firebase Services
B4A Question Astream_NewData
B4A Question B4A and OpenGL to simulate a 3DPrinter
Share My Creation CNC_SHEET
  1. fernando.oliboni

    fernando.oliboni Member Licensed User

    Hi, I need to create an app that transforms texts into GCodes. Example: upload_2018-7-27_8-22-8.png

    Can someone help me?

    Thank you
     
  2. marcick

    marcick Well-Known Member Licensed User

    what do you mean ? Gcode is a text file, I don't understand the question.
     
    ilan likes this.
  3. DonManfred

    DonManfred Expert Licensed User

    I don´t think that i saw any library for it. You need to write your own conversion routines.
    Check the Documentation of the CNC Machine on how they are build.
     
  4. fernando.oliboni

    fernando.oliboni Member Licensed User

    like this for example,

    I want to write the text in the app and send it to my machine which will have an arduino in control
     
    Peter Simpson, Alex Guerrero and ilan like this.
  5. fernando.oliboni

    fernando.oliboni Member Licensed User

    Yes I know. I have to write the codes, but I do not know how to transform a letter into an object and work with the points of that object.
     
  6. DonManfred

    DonManfred Expert Licensed User

    Again: You need to check the Documentation on how the Commands must be build.
     
    Peter Simpson and Filippo like this.
  7. Filippo

    Filippo Expert Licensed User

    A GCode has nothing to do with objects, it is pure text.
    Here is a part of Gcode:
     
  8. fernando.oliboni

    fernando.oliboni Member Licensed User

    upload_2018-7-27_9-22-15.png
     

    Attached Files:

  9. fernando.oliboni

    fernando.oliboni Member Licensed User

    I know how to write an NC code for machines, what I need is to transform a user-entered text of the app into Gcode. To do this, I need to find the points of the letters, I need to find the coordinates of the points of the letters that were typed.
     
  10. marcick

    marcick Well-Known Member Licensed User

    It' s crazy job. Nobody do it. Any CAM software will do it for you, with any font you like ....
     
  11. Sandman

    Sandman Well-Known Member Licensed User

    Everybody in this thread has answered your initial question. It seems this is the question you should have asked from the very beginning.

    I'm not aware of an android based solution where you can convert characters to actual coordinates, perhaps somebody else in the forum knows more about this.

    If we for the moment assume it's not possible, one working solution could be including a svg file per character in your app. The user types in YOLO and you grab the files Y.svg, O.svg and L.svg and offset them according to a pre-generated character width file.

    Of course, if that's the route you're interested in, there's nothing stopping you from skipping the svg step entirely and just have GCode coordinates instead. One thing that might be interesting with svg though is the ability to preview the output using the svg library from @agraham.
     
  12. fernando.oliboni

    fernando.oliboni Member Licensed User

    Google Play has an app that does this: "Text to CNC". B4A can not do?
     
  13. marcick

    marcick Well-Known Member Licensed User

    Sandman gave you the solution. Use a cad/cam software and generate a text file for each characters.
    I use this solution because I can quickly generate serial number (But I just need chars from 0 to 9) without modifying the source design and build gcode everytimes.
    You just need to adjust the distance from each characters (after a "I" you need less distance for example).
    But is a fixed height and font solution.
     
  14. fernando.oliboni

    fernando.oliboni Member Licensed User

    I want to generate on my cell phone, so I'm asking here in the forum. Other solutions I know and I already have.
     
  15. tigrot

    tigrot Well-Known Member Licensed User

    Write blocks to engrave each letter. Output them in a file. Then send to CNC. No need for special functions.
     
  16. fernando.oliboni

    fernando.oliboni Member Licensed User

    If it were that easy, I would have done it
     
  17. Sandman

    Sandman Well-Known Member Licensed User

  18. ilan

    ilan Expert Licensed User

    if you have already the gcode for each letter you just need to create a map with the letter as the key and the gcode output string as the object. then if the user want to engrave "B4X" just out put that string from the map.

    i am a CNC programmer for almost 12 years, if you need any help in gcode let me know.

    (some parts i did lately)

    20170119_113359.jpg 20180726_170923.jpg 20180726_170932.jpg
     
    Peter Simpson, Beja, jimmyF and 5 others like this.
  19. ilan

    ilan Expert Licensed User

    the only thing you will need to calculate is the new X location after each letter. it should not be hard at all to do that. so just keep a map of all letters and their GCode and then always calculate the new X Position after each letter so you know how much to move to the left and start the new letter. you can use also a code module for that and use types that will hold a string and a letterWidth amount. string is the gcode and letterWidth is the amount to move after that letter was engraved.

    EDIT: if i think about it, it would be really interesting to create such a lib for b4x :)
     
    Last edited: Jul 27, 2018
    Peter Simpson and Johan Hormaza like this.
  20. Johan Schoeman

    Johan Schoeman Expert Licensed User

    The last photo on the right is part of a polymer extrusion die....?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice