-
Notifications
You must be signed in to change notification settings - Fork 11
Crystaltoolkit animation scene #730
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
Crystaltoolkit animation scene #730
Conversation
Thanks @minhsueh! I just made you admin for this repo. Feel free to merge and publish a release (or release candidate) when this PR and the accompanying CTK PR are ready. |
@tschaume Thank you! will do! |
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! Just some minor feedback.
}); | ||
} | ||
} | ||
console.log('new props'); |
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.
remove?
@minhsueh feel free to adress my comments as necessary and go ahead with merging this when you're ready. If the tests and build succeed on merge, a new package release should happen. I've already merged the accompanying PR in |
…inhsueh/mp-react-components into crystaltoolkit_animation_scene
Summary
Major changes:
Introduced
CrystalToolkitAnimationScene
to enable crystal structure animations. For eachObject3D
, the scene renders keyframes (position, scale, or quaternion ...) and performs linear interpolation between frames for smooth transitions.feature 1: Added the
animateType
field to interfaceSceneJsonObject
insimple-scene.ts
.This field can be either
"position"
or"displacement"
, specifying the physical interpretation of theanimate
data in each scene entry.feature 2: Support for generating multiple keyframes added to
buildAnimationSupport
inanimation-helper.ts
fix: Previously, the code only parsed the first two frames; this has now been corrected
testing: The page
/components/crystal-toolkit/pages/CrystalStructureAnimationViewer/CrystalStructureAnimationViewer.tsx
is used for testing with sample data, along with the scene files/components/crystal-toolkit/scene/phonon-animation-scene.ts
and/components/crystal-toolkit/scene/phonon-animation-position-scene.ts
.TODO:
BooleanKeyframeTrack
support for bond-breaking animations. Bonding is represented using two endpoints, typically derived frompymatgen.analysis.local_env.CrystalNN
andpymatgen.analysis.graphs.StructureGraph
. In cases where a bond breaks or reforms, the associatedObject3D
is toggled invisible to reflect the change visually.get_scene
fromStructureGraph
andSite
incrystal_toolkit.components.renderables
is used to generate animation data for atoms and bonds. A separate PR will be submitted to crystal_toolkit(Retain atom index info in _meta crystaltoolkit#470)Checklist
Local Testing
Run
npm start
and navigate tohttp://localhost:1234/crystal_animation