Grasshopper

generative modeling for Rhino

# Sorting points

Hello i am trying to sort (this is a simplified version) at a later stage in a definition so that i can generate some polyline in either x or y direction.

Is there an easy way to sort these points? I have read various forum discussions on sorting but cant understand the sequence that i am getting which make them very difficult to work with.

I need simple rows as the output from a grid- how i can order these points - is there a easy way to do it?

Cheers!

Chris

Tags: Sort, list, point

Views: 1131

### Replies to This Discussion

Is there a way of sorting a grid of points not based on Euclidean co-ordinates?

It seems the sort points only works for a flat square grid so not sure if i can do achieve what im after.

I may have some solutions, but I would need to take a look at what your points look like first.

Hi Systemiq

I'm using part of the definition that Chris was using and have similar problem.

I have this output geometry to which I want to apply a pattern based on a rectangular grid

Do you know how I could achieve it?

I tried out your proposal in this discussion but somehow it didn't work for me

I think a solution might be to have the same grid as input geometry but no idea how to achieve that as I don't understand scripted part of the definition

do you know any solution to this problem?

maybe another way to bend a grid?

I attached the bending definition with pattern

Attachments:

The easiest solution is to create a surface from Kangaroo result, and remap your pattern on it, like in the attachment.

If you really want to sort the points output from Kangaroo, you can use their UV coordinates on that surface.

Attachments:

Thank you so much!

that's exactly what I need

Can you maybe explain a bit more how it works (I'm new to GH and still need to learn a lot) because I tried to apply your fix on a curved grid and it doesn't work anymore.

How can I adjust your part of the definition so it works every time I change the grid?

attached the new grid

Attachments:

Ah yeah, I forgot to add that the Map to Surface component needs a single surface.

With your new grid, the loft results in a Brep (polysurface) and the Map Surf can't use that.

To fix that, set the loft to Rebuild (right click O input in the Loft component-> Loft options-> Rebuild instead of Normal, and Count=100 for accuracy).

this is great!

Thanks once again!

Hello again Systemiq

I'm writing because I keep on working on my definition and keep on adjusting it for my project

I changed the plan of the grid (it's not a 10x10 square anymore) and again have a problem with applying my pattern on it

the output curve is ok but "map to surface" results in a mess

could u have a look?

Agnieszka

Attachments:

This seems to work but it is just some tinkering.

Attachments:

Hi Systemiq

(Sorry somehow can not reply to last post- so writing here again)

great! Thank you

but the grid is now rectangular

I changed it's parameters to set it to squares again and got an error

How can I fix it?

please refer to the attached image and file

Thanks!

Attachments:

The Eval component is given parameters outside of the curves.

Thanks Systemic

I'll try to figure this out

• View All