Pannel configuration for export Code with Concatenate

Hello, I cannot correctly export 4 points created from the Pannel. It shows me the coordinates with braces.
{0.0, 0.0, 0.0}
{50.0, 0.0, 0.0}
{50.0, 50.0, 0.0}
{0.0, 50.0, 0.0}

with Concatenate:
x0.0Y0.0Z0.0
x50.0Y0.0Z0.0
x50.0Y50.0Z0.0
x0.0Y50.0Z0.0

This Gcode does not pass for a printer.

I want to have this to export Gcode correctly with Grasshopper:
0.0.0
50.0.0
50.50.0
0.50.0

Do I have to modify an option in Pannel or in Rhino?
I am in MM for the scale. thank you

Are you looking for something like this?


GCode.gh (3.9 KB)

Hello, it will not work because I need to add other functions in Concatenate. (G1 + F1800 + E50)
Is it possible to correct the error with my script? Why does the panel display {0.0, 0.0, 0.0} with curly braces? Is this related to data trees ?

Hi Frederic -

when you pass information into a Panel, you are turning it into formatted text.
You should probably just not just the Panel and go straight from the Point parameter to the Deconstruct component.

Then again, it’s not completely clear to me exactly what you want… You don’t have the curlies in your final panel anyway…
-wim

Hello, I saw this example in a book that I want to reproduce. Everything looks good except the display in the pannel …

Hi Frederic -

Yes, but as your first image shows, that doesn’t matter. The Deconstruct component understands that this is a list of points and the final outcome is as in the example from the book (with some differences in formatting).

What I fail to understand here is what your expected result is. You write:

And then you write:

So, why are you inserting X, Y, and Z into this?
-wim

Hello, the script can be used in a 3D printer if you then modify the Gcode. I added a space in front of the Y and the Z. I’m just having trouble understanding why Grasshopper adds .0 behind the generated values. Is it possible to have whole numbers?

Hi Frederic -

From a quick check, it seems that Grasshopper 0.9x in Rhino 5 behaves like that on my system. Grasshopper 1 seems to strip these trailing zeros.

You could simply feed these through a Integer parameter to force them into whole numbers.
This is on Rhino 5:

Note: You should probably check for the specific machine that you are using, but, generally, G-code doesn’t mind trailing zeros, so there is no need to jump through hoops trying to get rid of them.
-wim

I am actually in 0.9, which explains this difference.
The Gcode works in both cases.
Everything is clearer now and thank you very much for your example.