A filter effect that plots the probability distribution of a quantum wave function.
This filter effect uses a quantum wave function algorithm to generate a plot of electron probability density. Ignoring its scientific value, the formula can be exploited for its aesthetic qualities. It can be used as an alternative to the radial gradient for generating more interesting shapes for example.
The rendering of the wave function is controlled by its parameters N, L and M. A Scale is also provided to deal with situations where the generated plot would otherwise be too large for its bounds.
The parameter values are clamped according to the rules N >= 1
, 0 <= L < N
, 0 <= M <= L
. Check that the values are assigned and clamped correctly if the wave function is not rendering as expected.
The WaveFunctionFX class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AspectRatio | INT | SVG compliant aspect ratio settings. | |||||||||||||||||||||
| |||||||||||||||||||||||
ColourMap | STRING | Assigns a pre-defined colourmap to the wave function. | |||||||||||||||||||||
An alternative to defining colour Stops in a wave function is available in the form of named colourmaps. Declaring a colourmap in this field will automatically populate the wave function's gradient with the colours defined in the map. We currently support the following established colourmaps from the matplotlib and seaborn projects: The use of colourmaps and custom stops are mutually exclusive. | |||||||||||||||||||||||
L | INT | Azimuthal quantum number. | |||||||||||||||||||||
This value is clamped by | |||||||||||||||||||||||
M | INT | Magnetic quantum number. | |||||||||||||||||||||
This value is clamped by | |||||||||||||||||||||||
N | INT | Principal quantum number. | |||||||||||||||||||||
This value is clamped by | |||||||||||||||||||||||
Resolution | INT | The pixel resolution of the internally rendered wave function. | |||||||||||||||||||||
By default the resolution of the wave function will match the smallest dimension of the filter target region, which gives the best looking result at the cost of performance. Setting the Resolution field will instead fix the resolution to that size permanently, and the final result will be scaled to fit the target region. This can give a considerable performance increase, especially when the filter is redrawn it will not be necessary to redraw the wave function if its parameters are constant. | |||||||||||||||||||||||
Scale | DOUBLE | Multiplier that affects the scale of the plot. | |||||||||||||||||||||
Stops | STRUCT [] | Defines the colours to use for the wave function. | |||||||||||||||||||||
The colours that will be used for drawing a wave function can be defined by the Stops array. At least two stops are required to define a start and end point for interpolating the gradient colours. If no stops are defined, the wave function will be drawn in greyscale. | |||||||||||||||||||||||
XMLDef | STRING | Returns an SVG compliant XML string that describes the effect. |
The following actions are currently supported:
Draw | Render the effect to the target bitmap. | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
Note that drawing the wave function will result in the N, L and M parameters being clamped to their valid ranges and this will be reflected in the object once the method returns. |
Aspect ratios control alignment, scaling and clipping.
Name | Description |
---|---|
ARF::MEET | Aspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible. |
ARF::NONE | Scale the viewbox to match the size of the viewport. Aspect ratio is not preserved. |
ARF::SLICE | Aspect ratio is preserved. The viewbox can extend beyond the viewport's edges on one axis. The viewbox is scaled up as much as possible. |
ARF::X_MAX | Align to the right. |
ARF::X_MID | Align to the horizontal center. |
ARF::X_MIN | Align to the left. |
ARF::Y_MAX | Align to the bottom. |
ARF::Y_MID | Align to the vertical center. |
ARF::Y_MIN | Align to the top. |