Extract X,Y,Z coordinates to a curve w/ Python?

Hello!

I want to use Python to “draw” with a 3D printer using data output from a Processing sketch. The sketch draws X,Y with mouse movement and Z with time elapsed. This line will eventually be translated to gcode. This won’t follow a conventional shape>slicer>gcode workflow but rather line (curve)>gcode.

Each x,y,z coordinate in the text file will look like this :

x1,y1,z1
x2,y2,z2
...

How can I extract them and get a curve in Rhino?

Hello,

I think if you use this sample, replacing rs.AddPoints with rs.AddInterpCurve then you will get what you are looking for. (Not tested - let me know how you get on).

Best regards

Graham

Thank you so much! That looks promising. I will give that a try.