Grasshopper

algorithmic modeling for Rhino

Hello !!

I have a collection of 2d points and I would like to snap (align) them to a pre-defined grid. I want to kind of "resample" points by repositioning them to the closest point of a grid.

There are many techniques when using a few points but I could not find a quick way for large amounts...

I have been trying with the PanelingTools, weighted attractors etc. But... no :)

Thank you very much !

Views: 1857

Replies to This Discussion

attach files, images, examples, ect.

Thanks Michael.

I am willing to move the red points to the grey ones in an efficient way.

For each given red point I should find the closest grey point and move the red point toward it. But I have many grey and red points... (see first pict)

The red and grey points both belong to a different grid.

I used ptWeight (weighted attractors) from the PanelingTools. Their example uses a bitmap image to generate weights (see second pict). But you should have the same size for both grids (Gd + W).

Closest Point works...

Attachments:

Thanks very much !!!!

I was looking for a more efficient way because 'Closest Point' looks at all points and not its neighbors or something like this. I was looking for a 'snap to grid'.

But thanks very much ! I will use the brute force technique with 'Closest Point' for the moment. No problem.

If you want to snap to a world axis aligned rectangular grid, you can perform some simple rounding math on each point.

Attachments:

This is it indeed ! Super great !

Thank you very much for your help !

Great idea, thank you!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service