-
Notifications
You must be signed in to change notification settings - Fork 50
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
Vector field options in 2D with single colored arrows above #278
Conversation
…nction and in a single color.
@@ -844,7 +844,7 @@ thread_local double new_maxlen; | |||
void VisualizationSceneVector::DrawVector(double px, double py, double vx, | |||
double vy, double cval) | |||
{ | |||
double zc = 0.5*(bb.z[0]+bb.z[1]); | |||
double zc = (drawvector > 3)?(bb.z[1]):(0.5*(bb.z[0]+bb.z[1])); |
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.
Instead of additional options for v
, maybe it is better to add an input option lambda
(by default 0.5
) that can adjust the zc
value to (1-lambda)*bb.z[0]+ lambda*bb.z[1]
?
This is similar to how we handle e.g. level lines with F5 or rules positions with ~
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 do not know, I do not see much reason for an arbitrary position, I see only a reason for mid-plane and above. The second thing is that color. The other options (except the first one) use color coding, so the arrows are almost invisible (blended) when looking from above.
I changed the color of the arrows to gray as in 3D. Btw, mesh becomes also gray in 3D, which I do not know if it is a bug or feature 😅 and if we want to replicate that here. |
Sounds like a bug to me. 😄 |
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.
Looks good to me. @v-dobrev, do you approve?
This PR adds two options for visualization of vector fields. They are similar to the options 2 and 3, but the arrows are drawn above the function surface and in a single color (gray as the options 4 and 5 in 3D) instead of the placement on the mid-plane with colors encoding the values. The main purpose is visualization of 2D data, where the current options for visualization of vector fields draw arrows, which are partially hidden behind the surface and the arrows blend with the background when looking from top.
example 5:
![image](https://private-user-images.githubusercontent.com/4259064/335316716-ba11499a-7e81-4e54-bdc0-d54693e97de3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e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