Skip to content
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

Added animations for some electromagnetic phenomena #376

Merged
merged 13 commits into from Feb 18, 2021

Conversation

SunTzunami
Copy link
Member

I made some basic animations using FURY that render some electromagnetic phenomena like-

  1. Propagation of an an electromagnetic wave.

em_wave

  1. Helical motion of a charged particle under the influence of a combined magnetic and electric field.

helical_motion

@SunTzunami SunTzunami changed the title added animations for some electromagnetic phenomena Added animations for some electromagnetic phenomena Feb 13, 2021
Copy link
Member

@Nibba2018 Nibba2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @SunTzunami , thanks for the PR. I liked your examples and would recommend you to rename the folder as electromagnetic_phenomena instead of the current case refer to skoudoro 's review below. Also prepend your file names, both python scripts and window.record png files with viz_ in order to help index the generated doc(scripts and png files should have the same name).

Apart from that, according to the right hand thumb rule, I think the direction of your charged particle should be anti-clockwise instead of it being clockwise (correct me if I am wrong).

Also I have mentioned some minor changes to fix the formatting below.

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @SunTzunami,

Really Nice tutorial, Good Job!

Can you remove this subfolder (Electromagnetic Phenomena). Just let your demo in the examples folder for now. We will reshape the whole documentation later.

Also, it would be good to have those demos with the line actor instead of the point actor.
Can you try it?

# changing with time


def update_coordinates(k, w, t, d):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, you should avoid to have 1 letter as a variable name. Even if it is really nice that you describe them above. Can you update the whole file with the correct name. Thank you!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the variables. Thank you!

Comment on lines 43 to 48
u = 0.09
a = 0.004
t = 0
dt = 0.09
w = 0.1
d = 0.002
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as above


###############################################################################
# end is used to decide when to end the animation
end = 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For doc generation, can you make it shorter. thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you meant that I reduce the value of end? I reduced end from 1000 to 300.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and thank you

@pep8speaks
Copy link

pep8speaks commented Feb 17, 2021

Hello @SunTzunami! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-02-18 10:49:00 UTC

@SunTzunami
Copy link
Member Author

SunTzunami commented Feb 17, 2021

Hi @Nibba2018, @skoudoro! I really appreciate the feedback. Thank you!
@Nibba2018, I made the changes to the comments as you instructed and renamed the files too. The path of the particle will be clockwise (I think the confusion arose because I forgot to mention that it's positively charged). I've attached a screenshot of a physics textbook which has a similar concept-
helical_path

@skoudoro, I renamed the variables and made their names more descriptive. I tried using line actor for the animation but could only implement it for the helical motion animation.

@Nibba2018
Copy link
Member

@SunTzunami Yeah my bad, clockwise direction is correct.

@skoudoro
Copy link
Contributor

Thank you for the update.

Could you just explain what was your issue with line actor when you tried to implement it in viz_emwave_animation.py?

@skoudoro
Copy link
Contributor

Also, Could you create a PR with your gif files in this repo: https://github.com/fury-gl/fury-communication-assets?

Thank you @SunTzunami

@SunTzunami
Copy link
Member Author

SunTzunami commented Feb 18, 2021

Thank you for the update.

Could you just explain what was your issue with line actor when you tried to implement it in viz_emwave_animation.py?

Hi @skoudoro ! Thanks for the review! I didn't know how to update coordinates for line actor (in EM wave animation) I then spent quite some time figuring out how to update coordinates for line actor. It works now. :)
The idea of using line actor was nice @skoudoro. It looks very nice now. Thank you!
Also, there was an error in the EM wave animation (the direction of the arrow was opposite to what it should be). I rectified it.
I'll create a PR with the gifs (with new animations that use line actor).

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, Thank you for the update and for using the line actor.

+1 for merging. Is it good for you too @Nibba2018?

@Nibba2018
Copy link
Member

em
Isn't the direction of the arrow in the opposite direction?

Copy link
Member

@Nibba2018 Nibba2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there was an error in the EM wave animation (the direction of the arrow was opposite to what it should be). I rectified it.

i guess you haven't pushed these changes. @SunTzunami

@SunTzunami
Copy link
Member Author

SunTzunami commented Feb 18, 2021

Also, there was an error in the EM wave animation (the direction of the arrow was opposite to what it should be). I rectified it.

i guess you haven't pushed these changes. @SunTzunami

@Nibba2018 I did it. PTAL. I changed the camera's location too.

Earlier-
em_wave

Now-
em_wave

@Nibba2018 Nibba2018 merged commit eb56d81 into fury-gl:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants