-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Survey: Adjust grid line direction after polygon clip #3856
Conversation
const QLineF& line = lineList[i]; | ||
QLineF adjustedLine; | ||
|
||
if (line.angle() > 180.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that the flipped lines would have an angle of 180.0°, which means they wouldn't be flipped back.
And if you change it to >=, this statement restricts the choice of grid angles to [0° - 180°), as otherwise the segments are flipped. Instead I would propose to alter the check to something like
if (fmod(fabs(line.angle() - gridAngle), 180.0) >= 90)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not really what this code does. It's just ordering the endpoints of the parallel grid lines (P1, P2) such that the vectors of the lines are all pointing in the same direction. The lines themselves stay the same, only the endpoints are flipped. This way when you connect the turn around from the end of one parallel line to the beginning of the next the connection is always on the edge of the polygon instead of possibly traversing the center of the polygon as shown in the image.
I think it's correct, unless I'm misunderstanding your point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more piece of information. The entry point for the survey is still not yet implemented and at this point is arbitrary based on polygon intersection. This endpoint flipping code will affect it as well. But the user themselves really needs control over it. That is NYI at this point. I'm not expecting them to set grid angle to adjust that. Or at least not at this point, since I haven't thought that much about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found a good approach is to let the user set an initial heading via a radial control. That affords them the ability to intuitively optimize fixed wing survey plans for prevailing winds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that also says that grid angle also informs initial entry point. I was thinking that wasn't the case, but I can see now how it may be. What's the concensus on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more complex than my simple statement. I'm going to craete a new discussion for this so we an continue there.
Affect on grid is to specific to details of polygon to test
Survey area grid entry discussion is here: #3864 |
Fix for #3798