Generate g-code from DAT

Hi guys…

Very green about the gills, but trying to get to grips with it all, it’s pretty ace…

I’m tinkering with a CNC drawing machine I’m working on with another project, and I wanted to try and build some software myself in touch designer to generate g-code.

I’ve managed to get a DAT with all the XYZ coordinates in it, and I know what format I want it all to be in, my question is how would I take that dat and turn it into lines of code?

See attached, it’s basically a table of XYZ values, and the code needs to read

G0 XNN.NN YNN.NN ZNN.NN F3000

Is there an easy way to do this?

Thanks in advance… apologies for x-posting with the FB group.

Nick
CNC001.toe (4.78 KB)

1 Like

take a look for Evaluate DAT

and/or Convert DAT and/or Substitute DAT and/or Script DAT.

Something like this?

GO X185.0 Y10.0 Z105.0 F3000 <CR> GO X185.0 Y0.0 Z105.0 F3000 <CR> GO X184.38 Y0.0 Z112.82 F3000 <CR> GO X182.55 Y0.0 Z120.45 F3000 <CR> GO X179.55 Y0.0 Z127.7 F3000 <CR> GO X175.45 Y0.0 Z134.38 F3000 <CR> GO X170.35 Y0.0 Z140.35 F3000 <CR> GO X164.38 Y0.0 Z145.45 F3000 <CR> GO X157.69 Y0.0 Z149.55 F3000 <CR> GO X150.45 Y0.0 Z152.55 F3000 <CR> GO X142.82 Y0.0 Z154.38 F3000 <CR> GO X135.0 Y0.0 Z155.0 F3000 <CR> GO X127.17 Y0.0 Z154.38 F3000 <CR> GO X119.54 Y0.0 Z152.55 F3000 <CR> GO X112.3 Y0.0 Z149.55 F3000 <CR> GO X105.61 Y0.0 Z145.45 F3000 <CR> GO X99.64 Y0.0 Z140.35 F3000 <CR> GO X94.54 Y0.0 Z134.38 F3000 <CR> GO X90.44 Y0.0 Z127.7 F3000 <CR> GO X87.44 Y0.0 Z120.45 F3000 <CR> GO X85.61 Y0.0 Z112.82 F3000 <CR> GO X85.0 Y0.0 Z105.0 F3000 <CR> GO X85.61 Y0.0 Z97.17 F3000 <CR> GO X87.44 Y0.0 Z89.54 F3000 <CR> GO X90.44 Y0.0 Z82.3 F3000 <CR> GO X94.54 Y0.0 Z75.61 F3000 <CR> GO X99.64 Y0.0 Z69.64 F3000 <CR> GO X105.61 Y0.0 Z64.54 F3000 <CR> GO X112.3 Y0.0 Z60.44 F3000 <CR> GO X119.54 Y0.0 Z57.44 F3000 <CR> GO X127.17 Y0.0 Z55.61 F3000 <CR> GO X135.0 Y0.0 Z55.0 F3000 <CR> GO X142.82 Y0.0 Z55.61 F3000 <CR> GO X150.45 Y0.0 Z57.44 F3000 <CR> GO X157.69 Y0.0 Z60.44 F3000 <CR> GO X164.38 Y0.0 Z64.54 F3000 <CR> GO X170.35 Y0.0 Z69.64 F3000 <CR> GO X175.45 Y0.0 Z75.61 F3000 <CR> GO X179.55 Y0.0 Z82.3 F3000 <CR> GO X182.55 Y0.0 Z89.54 F3000 <CR> GO X184.38 Y0.0 Z97.17 F3000 <CR> GO X185.0 Y10.0 Z105.0 F3000 <CR>

New Ops in sea-foam green.

project_cnc.tox (1.97 KB)

Thanks guys… this is exactly what I was after…

I’m only working on this project Thursdays/Fridays, so sorry for the delay in replying… don’t want you to think it’s not appreciated

I know have to send this to an arduino, so I’ll be checking out the op snippets for a bit… I’ll try and work it all out myself, thank you in advance if I need to return here.

ps love td. it’s ace. I’ve tried to get my head round processing, vvvv, and always failed because of the learning curve and/or resources available. This has not been the case with touch, so thank you again.

Hey Dogboy what type of CNC do you have? What version of G-code do you use? Where do you see Touch in the mix?

I just ordered an X-carve, and expect it in the next few weeks, it uses grbl.

I think Touch designer would be an amazing design studio for mathart to be toolpathed for a CNC. However using it as a gcode sender may be not the first project i’d try. I’d like to see some creative toe files for doing CNC cuts.

Homebrew TD Toolpath wishlists

Lithophane from TOP
Multisided Machining from SOP
Shape Nesting from SOP

I’m going to try out some commercial cnc software trials when it arrives and likely purchase something to get me started. I’d be glad to go collabo on touch designer programs, and use touch to create. Even if the G-code is different in the end, the process pipeline could be the same up until the G code

I’ll be back later to show my work and ask for help on the lithophane project, I have to go to work right now.

Hey guys,

Lithophane

I’ve made a table of a greyscale image. I would like to use this data in creating a depth map. The table’s column and row indices represent the x, y coordinates, and the value in cells represent the z(depth) coordinates.

To make this information meaningful to SOP creation, what do I need to do?

Can I somehow extract the colindex and/or rowindex, and place it into a matching table, then use the matching tables?

I think I want each rowindex, colindex, along with the present corresponding value aligned along a three channel tx ty tz CHop, converted to a SOP I just don’t know how to get there.

Here is the toe file and my sample image.
litho.zip (6.3 MB)


CNC To GCODE

I’ve made a network just to lay out my thoughts in creating a workflow for Touch designer to gcode. included are a number of subprograms like the lithophane one above. Also included is the gcode part from earlier in the thread. I’m putting this up here to show our members, and get support, but I may also link this post to some other forums. Hopefully I can attract some python/gcode talent from the CNC world that might be interested in helping this project along.

This is all conceptual, and there is much left undone so far. I’ve got about 6 weeks until my CNC arrives, by then I’ll know more about formatting gcode for my machine.

Here are some screenshots.