Hi there.
I am a beginner who has just started using ghpython. My question is, what code should I write using ghpython to input a list of coordinates and output a polyline curve? I would like to know a sample code for this.
Also, please let me know where beginners can find useful information.
otamesi.gh (10.4 KB)
Setting Python aside for a moment, you will need a “flat” list of points to make a polyline curve.
Working with data trees is a little harder in Python.
You can simplify the way you are parsing G-code like this:
otamesi_2024Jan10a.gh (15.4 KB)
If you want to use Python, first page
and Rhincommon reference (sure it for C# not sure it is the same in Python ?)
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry
There you go (see Polyline
and PolylineCurve
for reference):
240110_otamesi_AHD.gh (13.1 KB)