-
Notifications
You must be signed in to change notification settings - Fork 4
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
High-resolution screenshots #6
Comments
@elsapassaro would it be possible to add an "export PNG" button that calls something similar to the code above? (but avoiding that you get a iframe hiding everything, rather just letting the browser download the file). |
Also Chiara C. requested the option to download a (high-res) movie. This is not possible yet, but code was available in the original widget here (https://henriquemiranda.github.io/phononwebsite/phonon.html) [button "Export movie (GIF)"], so there is code to do it. |
as a follow up, I tried this function: function capturevideo(vibCrystal) {
let format = 'gif';
let options = { format: format,
//../../user_static/js/gif.js
workersPath: '../../user_static/js/',
verbose: true,
frameMax: vibCrystal.fps,
end: vibCrystal.captureend.bind(vibCrystal, format),
framerate: vibCrystal.fps,
onProgress: function( p ) { console.log('GIF progress: ' + ( p * 100 ) + '%'); }
}
vibCrystal.capturer = new CCapture( options );
vibCrystal.capturer.start();
} with the idea that then, one could run However, this does not work. I thought it was because some files ( I write this here because maybe it's just a small additional step and it works, but I don't manage to check it now. |
A requested feature is to have the possibility to get high-resolution screenshot of the displacements.
This could be implemented as a button.
For now, I report here a workaround to get such images (that can also be useful later for the implementation).
Open the tool with this direct URL. Then, load your structure and go to the page of the visualisation.
Open the browser Developers Tools. For instance, in Safari you first have to activate the menu (via Safari->Preferences->Advanced->Show Develop menu in menu bar), then select from the menu Develop->Show Javascript Console). In Chrome, instead, you can open the menu (three dots on the top-right of your browser), then More Tools->Developer Tools, and then choose the tab "Console" if not already selected)
In the Console, copy-paste this code to increase the number of segments to draw spheres from the default of 12 to 100:
v
is the global variable of type VibCrystal that controls the 3D visualiserCopy-paste this code in the console (adapted from here:
Set the various parameters (angle, vector length, amplitude, ...). Only at the end, pause the animation and possibly fine-tune the angle.
Finally, to take a screenshot, copy-paste the following code:
takeScreenshot(v, 2048, 1024);
v
as above is the VibCrystal object, the other two are the image resolutionClose/discard the Tab (not ideal, but this is for now just a workaround...)
The text was updated successfully, but these errors were encountered: