Grid of Points - how to find corners?

Grid of Points - how to find corners? - Messages

#1 Posted: 2/29/2016 12:21:20 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 KiB) downloaded 41 time(s).
#2 Posted: 2/29/2016 1:24:24 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

Hi Alex,

Try this:DotGrid ID.sm (54 KiB) downloaded 52 time(s).
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 Posted: 2/29/2016 1:27:40 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: 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 Posted: 2/29/2016 3:52:31 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

My solution, based on this code

DotGrid_dist.sm (66 KiB) downloaded 74 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Alexander O. Melnik 2/29/2016 4:30:00 PM
#5 Posted: 2/29/2016 4:17:34 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

@Alex,


I'm not sure that this is better or not. DotGrid_ID2.sm (116 KiB) downloaded 44 time(s).
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 KiB) downloaded 74 time(s).




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 Posted: 2/29/2016 4:28:56 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 users liked this post
ioan92 2/29/2016 5:00:00 PM, Davide Carpi 2/29/2016 7:47:00 PM
#7 Posted: 2/29/2016 8:00:44 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: 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 Posted: 3/1/2016 2:59:11 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 54 time(s).
#9 Posted: 3/1/2016 12:13:14 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 KiB) downloaded 54 time(s).



Thanks, Jean
  • New Posts New Posts
  • No New Posts No New Posts