Published August 27, 2025 | https://doi.org/10.59350/joaquinbarroso.6562

Using DensToolKitViewer to get the best viewpoint

In this tutorial, we shall prepare a figure using DensToolKitViewer 2.1.0 (or later) to select the viewing angle of the molecule, for whenever the default view isn't the optimal viewpoint or to get various for comparison. Installation and main controls were already covered in a previous post, as well as an update for ease of use.

We use the file N-N-dimethyl-Propen-1-amine.wfx which is located in the wffiles repo directory. In addition, as a working exercise, we will compute the critical points of this molecule.

We start by calling the help menu of the dtkfindcp program:

~$ dtkfindcp -h

After checking the options, we run the command:

~$ dtkfindcp N-N-dimethyl-Propen-1-amine.wfx -a -P -k -r -e -g

For dtkfindcp, options -P -k are used to render the N-N-dimethyl-Propen-1-amineRhoCP.png image and to keep the pov file, which is the PoVRay script; -a draws the atoms as transparent spheres; -g draws the gradient paths as sets of small spheres; -r computes the ring and cage paths (if needed), and -e performs an extended search. The above command produces the following figure (N-N-dimethyl-Propen-1-amineRhoCP.png):

In this case, the figure might be just what you need for your work (thesis, report, paper, etc.) However, let us suppose that for some random aesthetic reason you need to rotate the critical points image.DensToolKitViewer is DensToolKit's Graphical User Interface to visualize the critical points.

DensToolKitViewer looks like this:

The DensToolKitViewer GUI

Open the file N-N-dimethyl-Propen-1-amineRhoCP.cpx. You can do this either by pressing the 'Open Molecule' button, Clicking on 'File/Open Molecule…' menu, or Ctrl+O (Cmd+O in MacOSX). Notice that the wfx/wfn file must be in the same directory as the cpx file. This will open the molecule and display the following:

Default view for the output molecule

Rotate the molecule until you find a viewpoint that you like. You can use the mouse (dragging with left or right button), the sliders at the window's right, or input directly the angle values at the top of the sliders. In this tutorial we will set the angles to be xAngle=37, yAngle=156, and zAngle=131. You can take a snapshot directly using the 'Export Image' button, clicking 'File/Export Image…' menu, or typing Ctrl+Shift+E (or Cmd+Shift+E in MacOSX). You should get the following image:

While the above image is OK for a working image, one usually needs better quality images for presentations or scientific texts (including thesis, articles, reports, etc.) We can use the program dtkdrawer to make a PoVRay script. Run the following command:

dtkdrawer N-N-dimethyl-Propen-1-amineRhoCP.cpx -x 37 -y 156 -z 131

The options -x 37 -y 156 -z 131 are precisely what we needed to render the image as we liked it in DensToolKitViewer. The following image should be now present in your working directory (the image N-N-dimethyl-Propen-1-amineRhoCP.png created by dtkfindcp has been replaced):

You can also increase the image's resolution. For this, use the script dtkpov2png:

~$ dtkpov2png -w 2400 N-N-dimethyl-Propen-1-amineRhoCP.pov

Notice that the original image (N-N-dimethyl-Propen-1-amineRhoCP.png) is overwritten. We recommend to use multiples of 1200 when setting the resolution (-w 2400 option). The high resolution image is:

Last but not least, in case you need the image in other formats, we recommend using GraphicsMagick. For instance, to convert the png image to jpg format, use:

~$ gm convert -flatten N-N-dimethyl-Propen-1-amineRhoCP.png N-N-dimethyl-Propen-1-amineRhoCP.jpg

The above command produce the figure:

You can recover all posts regarding DTK from the Tags at the bottom or by clicking this link to the same destination.

This post was written by Prof. Juan Manuel Solano-Altamirano, the mail mind behind DTK and other adventures.

Additional details

Description

In this tutorial, we shall prepare a figure using DensToolKitViewer 2.1.0 (or later) to select the viewing angle of the molecule, for whenever the default view isn't the optimal viewpoint or to get various for comparison.

Identifiers

UUID
8ceffaf7-6c90-4ba8-9a4d-bc6f1696d70b
GUID
http://joaquinbarroso.com/?p=6562
URL
https://joaquinbarroso.com/2025/08/27/using-denstoolkitviewer-to-get-the-best-viewpoint/

Dates

Issued
2025-08-27T15:00:00
Updated
2025-08-27T15:00:00