# Extracting points and using them in Grasshopper

Hi all, i’m trying to learn GH and was wondering if someone could explain the concept of how to extract certain points to draw curves through them, or do other operations. I have been reading about sets and indexes but can’t quite understand how i can tell GH I want certain points by their coordinates. Any suggestions are appreciated, thanks! The example attached is the essence of what i’m trying to do but will a lot more points. These are all in 2D, not 3D, which is why I’m assuming the coordinates would be only X,Y. Once I understand the 2D, I will attempt the 3D. Thank you.

You have two options:
1- Using Point parameter with Set Multiple Points option.

2- Using panel:

Points.gh (7.5 KB)

Well it’s hard to explain anything with only a screenshot. Best practise would be to extract geometry via data structure (certain tree branch & list item, guess that’s what you read about) and not by coordinates. Post your points for further help.

This example uses a grid, splits the data structure equally and uses relative items to get the points to draw lines through.

200719_2dpolywave.gh (8.0 KB)

Maybe the gh primer could also help you to understand data structures better: http://grasshopperprimer.com/en/1-foundations/1-5/0_designing-with-data-trees.html

thank you, the primer is very useful, there is a lot i need to learn and I am starting to make sense of the script you posted. What if it’s not a grid i’m working with but points off of curves that i now want to draw curves through by connecting points from different curves? Later I will want to skip some points, but for now i just want to understand how to organize the tree to exctact from it. I will keep reading the primer but any hints you might have would be helpful, thanks! extract points|647x500 extact points and draw curves.gh (12.2 KB)

You didn’t internalize the curves in the file, check here how to do that

I guess easiest way to get horizontal lines would be to filp the matrix like this (either with `Flip Matrix` component or `Path Mapper`)

`Relative Item` works too -there are a lot of different approaches that would solve this

thank you! the flip matrix is very good to know! I’m still trying to understand how the Path Mapper works by getting rid of the B in {A; B} (i) but can’t quite yet grasp that, will keep trying. Also i need to do more research in terms of working with trees in general to better understand the concepts. I’ll get there slowly one day!

Daniel or someone else, do you know why i’m getting double and triple and overlapping lines? I drew the lines in Rhino one after the other from bottom to top and then i trimmed them with a curve. It seems like GH is mixing up the order of the points. Thanks.

interpolate.gh (7.3 KB)

The curves aren’t in the right order, so I sorted the curves in y direction.
In this case there is no need to use path mapper. interpolate_ME.gh (5.8 KB)

ah magic! Sort List, thank you so much. Love this forum.

Hi again, I tried doing this a different way as it helps other items part of a larger script i’m working in. But the curves don’t sort properly at the top and i’m not sure why the last one changes direction and how i can fix that with GH. Can you please take a look? Thanks.

Divide Surface and Interpolate Verticals rev.gh (13.6 KB)

thank you. i see you flattened the curves and made them have the same orientation. Learning a lot from this forum, thanks!