Grid of Points - how to find corners?

Grid of Points - how to find corners? - Сообщения

#1 Опубликовано: 29.02.2016 12:21:20
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: Moderator

Hi All,

Need some conceptual ideas on how to find corners of a grid of points represented by XY coordinates. Any input is appreciated. Thanks!

DotGrid ID.sm (54 КиБ) скачан 41 раз(а).
#2 Опубликовано: 29.02.2016 13:24:24
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: Moderator

Wrote

Hi Alex,

Try this:DotGrid ID.sm (54 КиБ) скачан 52 раз(а).
I'm not sure that's your's expected answer.

Best Regards,
Ioan



Hi Ioan, thats a good start :-). My aplogies for not wording my request more clearly. I need to identify following points programmatically.
mn1kl.png
For any generic array of XY data there are (in my case always 4) corner points that I need to find and identify.

The issue that I faced is that for some of 4 corners the coordinates are not always MIN/MAX of the entire array... I have tried setting up a function based on MIN/MAX that does not work if a corner point is not defined by XY extremity value.

Really what i need is the concept, I can and will do the function myself (since I do not want to take much of anyones time).
#3 Опубликовано: 29.02.2016 13:27:40
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

An generic approach could be the Polygon triangulation.
However consider that a line build by points is straigth depending on the precision you use.


An idea could be to check if for a group of 3 points, the middle point lays on the segment between the other 2 points (or better: is close enough). In this way, you can check all the points considering each one the middle point of a group.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Опубликовано: 29.02.2016 15:52:31
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

My solution, based on this code

DotGrid_dist.sm (66 КиБ) скачан 74 раз(а).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Alexander O. Melnik 29.02.2016 16:30:00
#5 Опубликовано: 29.02.2016 16:17:34
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: Moderator

Wrote

@Alex,


I'm not sure that this is better or not. DotGrid_ID2.sm (116 КиБ) скачан 44 раз(а).
My idea is to keep trace for each min/max of each column


Best Regards,
Ioan



Wrote

My solution, based on this code

DotGrid_dist.sm (66 КиБ) скачан 74 раз(а).




Thank you very much guys, both codes identify the points correctly (and point out that my plot is not correct actually). You have just identified the most heavily loaded piles in a pile group, something that till now I always had to do by hand when automating per-pile demand calculation.

Ioan, your code will need a small tweak to identify points 16 & 17 instead of just 16.

Davide, it will take me sometime to digest the formula you are using; it seems to be quite general and applicable to any? point cloud, which is great!

#6 Опубликовано: 29.02.2016 16:28:56
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: Moderator

Wrote

@Davide,

Very interesting your solution.
But in fact your solution gives almost the same results as mine's - one position exception:
Alex sol.png

Now, it's Alex's turn to use or to unvalidate.

Best Regards,
Ioan



Both solutions seem to work for my purpose. Ioan's solution is simple, while Davide's has a potential to be very general, which I will test by feeding it some data

Frankly I am EXTREMELY thankful to both of you guys to take your time and help a less mathematically gifted dweller of this forum (not for the 1st time either).
2 пользователям понравился этот пост
ioan92 29.02.2016 17:00:00, Davide Carpi 29.02.2016 19:47:00
#7 Опубликовано: 29.02.2016 20:00:44
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Good

Wrote

Davide, it will take me sometime to digest the formula you are using; it seems to be quite general and applicable to any? point cloud, which is great!



The function looks if a point is "far" from the segment that connects the adjacent points near the one investigated, assuming last point is adjacent to the first (closed path); if you are looking in a perimeter, using sorted points and a correct tolerance parameter, this formula should be ok. If the matrix contains an array of piles/elements (meaning there are also inner elements, f.e. a 3rd row of piles in your example), this function can't be used (not directly).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#8 Опубликовано: 01.03.2016 02:59:11
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

This collection is much too weird for me
doing the effort of understanding. Whatever,
You can change the shape at will and preserve
finding the corners as you first asked for.

Forum Corners.sm (23 КиБ) скачан 54 раз(а).
#9 Опубликовано: 01.03.2016 12:13:14
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: Moderator

Wrote

This collection is much too weird for me
doing the effort of understanding. Whatever,
You can change the shape at will and preserve
finding the corners as you first asked for.

Forum Corners.sm (23 КиБ) скачан 54 раз(а).



Thanks, Jean
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений