GNU Astronomy Utilities - Tasks: task #15578, Function to find if polygon...
You are not allowed to post comments on this tracker with your current authentication level.
task #15578: Function to find if polygon vertices are sorted anti-clockwise
Submitter: | Mohammad Akhlaghi <makhlaghi> | ||
Submitted: | Sat 21 Mar 2020 09:02:30 PM UTC | ||
Should Start On: | Sat 21 Mar 2020 12:00:00 AM UTC | Should be Finished on: | Sat 21 Mar 2020 12:00:00 AM UTC |
Category: | Libraries | Priority: | 5 - Normal |
Item Group: | Enhancement | Status: | None |
Privacy: | Public | Assigned to: | sks_15 |
Percent Complete: | 100% | Open/Closed: | Closed |
Effort: | 0.00 |
Jump to the original submission
Sun 29 Mar 2020 04:21:56 PM UTC, comment #22: |
Mohammad Akhlaghi <makhlaghi> |
Sun 29 Mar 2020 05:04:13 AM UTC, comment #21: The code is pushed here. Please have a look:-) |
Sachin Kumar Singh <sks_15> |
Sun 29 Mar 2020 02:05:12 AM UTC, comment #20: Everything looks nice! Your tests were also very good :-).
|
Mohammad Akhlaghi <makhlaghi> |
Sat 28 Mar 2020 10:47:54 PM UTC, comment #19: All the requirements are done and the code is pushed here. Documentation for the `gal_polygon_to_counterclokwise` is added and the bugs regarding size_t are fixed. Names are changes in `is` functions. See the test cases in `tests/during-dev.sh`. |
Sachin Kumar Singh <sks_15> |
Sat 28 Mar 2020 08:53:09 PM UTC, comment #18: Thanks, this explains it ;-).
|
Mohammad Akhlaghi <makhlaghi> |
Sat 28 Mar 2020 08:05:29 PM UTC, comment #17: It seems that the algorithm won't work for intersecting polygons. At most it may tell when it is mostly clockwise(see last and second last paragraphs here). Also, it suggests no such algorithm is possible for intersecting polygon due to its characteristics.
|
Sachin Kumar Singh <sks_15> |
Sat 28 Mar 2020 06:01:59 PM UTC, comment #16: I mistakenly posted the comment in task #13658 (comment 31). Please see it there and reply here ;-). |
Mohammad Akhlaghi <makhlaghi> |
Sat 28 Mar 2020 04:39:03 PM UTC, comment #15: Here is the region file containing the vertices of the polygon. |
Sachin Kumar Singh <sks_15> |
Sat 28 Mar 2020 04:38:00 PM UTC, comment #14: Added debugging procedures is inserted and the previous requirements are done here. Documentation will be pushed in(probably) next commit when everything works fine.
|
Sachin Kumar Singh <sks_15> |
Thu 26 Mar 2020 06:46:59 PM UTC, comment #13: Some small points:
|
Mohammad Akhlaghi <makhlaghi> |
Thu 26 Mar 2020 06:12:18 PM UTC, comment #12: The required changes are made and pushed here. The document is not changed yet.
|
Sachin Kumar Singh <sks_15> |
Wed 25 Mar 2020 11:43:03 PM UTC, comment #11: Some points:
|
Mohammad Akhlaghi <makhlaghi> |
Wed 25 Mar 2020 08:01:58 PM UTC, comment #10: I've added the 'gal_polygon_to_counterclockwise' in polygon.c. Required changes were also done on 'gal_polygon_iscounterclockwise', but the documentation for neither of those is updated. I'll do so after the review and testing. I've tested the individual parts of the function separately but wasn't able to test it on the whole. I've provided comments showing the working of the individual parts of code.
|
Sachin Kumar Singh <sks_15> |
Wed 25 Mar 2020 05:35:40 PM UTC, comment #9: Yes, this is the correct way to put an array into a `gal_data_t' container. Just note that you aren't converting (copying the data into another allocated space) when you use this method.
|
Mohammad Akhlaghi <makhlaghi> |
Wed 25 Mar 2020 02:22:41 PM UTC, comment #8: If I need to use `gal_permutation_apply`, I need to use `gal_data_t` as input. Should I use
to make `temp` a temporary store the vertices `v` to be reversed. What should be the value of minmapsize and is this the correct way to convert `double*` to `gal_data_t*`? I plan to make a `permutation` array having the reverse indexes than the clockwise vertices and then using `gal_permutation_apply(temp, n)` to reverse that order.
|
Sachin Kumar Singh <sks_15> |
Tue 24 Mar 2020 10:55:05 PM UTC, comment #7: I was just looking a little close into it and came up with the Curve orientation wikipedia page. Had you looked into it? Its solution also seems to be nice (and possibly more generic?).
|
Mohammad Akhlaghi <makhlaghi> |
Tue 24 Mar 2020 08:02:20 AM UTC, comment #6: I think for non-convex polygons this should do as, for example, if the figure is intersecting this might lead to +ve value or 0 (as the case you suggested). But still, I need to find any edge cases.
|
Sachin Kumar Singh <sks_15> |
Tue 24 Mar 2020 12:02:52 AM UTC, comment #5: It would also be good if you add the URL of that reference page to the comments of the function, it can help people understand/debug/expand it better ;-). |
Mohammad Akhlaghi <makhlaghi> |
Tue 24 Mar 2020 12:00:30 AM UTC, comment #4: Thanks a lot Sachin, this is a very clean commit and I enjoyed reading the `git log -1 -p' :-).
|
Mohammad Akhlaghi <makhlaghi> |
Mon 23 Mar 2020 12:38:25 PM UTC, comment #3: The function for the same is pushed in the `task-is-sorted' branch here. Documentation for the same is also added. Please test it and review. |
Sachin Kumar Singh <sks_15> |
Sun 22 Mar 2020 08:02:06 PM UTC, comment #2: That webpage has such a complete explanation! It seems promising, try it out and if it works, add it as a new function in the `polygon' libraries, maybe called `gal_polygon_issorted'? |
Mohammad Akhlaghi <makhlaghi> |
Sun 22 Mar 2020 05:49:27 PM UTC, comment #1: The winding number method seems to be a good fit for this and is also easy to implement. This should do it:-) |
Sachin Kumar Singh <sks_15> |
Sat 21 Mar 2020 09:02:30 PM UTC, original submission:
When dealing with polygons it can be useful to know if the input set of vertices are sorted counter-clockwise or not. This is particularly the case for concave polygons where there is no unique sorting (see the discussion in task #13658).
|
Mohammad Akhlaghi <makhlaghi> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 7 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2020-03-29 | makhlaghi | Percent Complete | 0% | 100% | |
Assigned to | None | sks_15 | |||
Open/Closed | Open | Closed | |||
2020-03-28 | sks_15 | Attached File | - | Added ds9.reg, #48693 | |
2020-03-24 | sks_15 | Assigned to | sks_15 | None | |
2020-03-23 | sks_15 | Assigned to | None | sks_15 | |
2020-03-21 | makhlaghi | Carbon-Copy | - | Added -email is unavailable- |
Powered by Savane 3.13-f8d8.
Corresponding source code
Thanks Sachin, it has been merged into the master branch and pushed to the main repository.
I also used them implemented in the Crop program and it now works much more reasonable, that has also been pushed. In that commit, I also polished the functions and the documentation a little ;-).
I am marking this task as complete :-D.