Contour Generator
Pattern Generator
Function Editor
Tutorial

SecuriDesign for CorelDRAW/Corel DESIGNER

Function Editor is used to create definitions of new functions that can be used with Contour and Pattern Generators.

Functions are the basic building blocks of both contours and patterns and used widely throughout SecuriDesign. In many cases, well-designed function is the key to a good looking security element.

The Function Editor can be accessed in both Contour Generator and Pattern Generator on Functions tab of the dialogs:

This dialog shows a list of all functions available and allows you to modify a function's definition.

SecuriDesign employs Fourier Series to define functions. 

A Fourier Series is defined as:

F(t) = C + A1*Cos(wt) + B1*Sin(wt) + A2*Cos(2wt) + B2*Sin(2wt) + A3*Cos(3wt) + B3*Sin(3wt) + ...

So, a set of coefficients A1, B1, A2, B2,... defines a function. SecuriDesign allows to enter up to 20 first coefficients of the series. 

Every function in SecuriDesign has two components: vertical (Y) and horizontal (X). Each component is a separate Fourier Series. Y-component is used most of the time and it determines the vertical variations of contour or pattern curves. However X-component allows to create horizontal deviations that may result in different loops as shown on the screenshot above.

Thus a function definition in SecuriDesign contains two independent function X(t) and Y(t) that control horizontal and vertical deviations:

X(t) = Ax1*Cos(wt) + Bx1*Sin(wt) + Ax2*Cos(2wt) + Bx2*Sin(2wt) + ... + Ax20*Cos(20wt) + Bx20*Sin(20wt)

Y(t) = Ay1*Cos(wt) + By1*Sin(wt) + Ay2*Cos(2wt) + By2*Sin(2wt) + ... + Ay20*Cos(20wt) + By20*Sin(20wt)

The coefficients can be entered in the table ("Fourier Coefficients") on the dialog tab which shows 5 coefficients at a time. Four buttons below the table allows you to select the coefficient range you want to specify. First two columns in the table specify the Y-component of the function ("Y:Cos" column shows Ayn coefficients [the ones at Cosines], while "Y:Sin" column shows Byn coefficients [the ones at Cosines]). "X:Cos" and "X:Sin" have the same meaning but for X-component of the function.

The following controls are available on Functions tab of the macro dialogs:


Available Functions list

Shows the list of all functions available for the current document. Selecting a function from the list automatically updates the Fourier Coefficients table.


New

Pressing this button will add a new function to the list. The name of the new function is taken from the Name text box and all the Fourier coefficients are taken from the coefficient table.


Modify

When pressed, the currently selected function is updated with the data entered in the dialog


Delete

Deletes the currently selected function from the list.


Clear

Clears all the coefficient values.


Visual Editor...

This button invokes a Visual Function Editor module which gives the user an alternative way of defining a function. See the comments below.


Random...

Opens Random Function Generator dialog that allows to generate function definitions at random:

This dialog appears on top of the main dialog, however when Generate button is pressed, the function coefficients appear in the main dialog and the function preview is updated. Keep clicking the Generate button until you find the function you like, then click Close to dismiss the dialog.

The parameters in this dialog have the following meanings:

  • Max Harmonics Y: the maximum number of the Y-component coefficients that are generated by the function. The larger the number, the more vertical peaks resulting function will have.
  • Max Harmonics X: the maximum number of the X-component coefficients to generate. The larger this number, the more loops and other distortions in horizontal direction will appear.
  • Looping: specifies the strength of horizontal distortions. The larger this number, the more likely bigger loops and curls will appear on the function.

Experiment with these settings and you will understand what they affect pretty quickly. 


Import

Imports function descriptions from a function definition file (*.fn)


Export

Exports the selected function to a function definition file (*.fn)


Name

Provides the name for a function.


Fourier Coefficients

As explained above, this table provides the Fourier coefficients that define the function. Both X- and Y-components of the function are defined here.


Available for all documents

When checked, the function is stored globally and will be available next time you launch SecuriDesign. If this button is unchecked, the function description is saved in the current CorelDRAW document only. When you invoke SecuriDesign on another document, the function will not be available.


Preview Options

Allow to specify the function preview options.


Function Preview Window

Displays the current function. When you make changes to function definition, click the preview image to rebuild the function preview.


Visual Function Editor

Visual Function Editor allows you to define function using alternative method. The main Functions dialog allows you to enter Sine and Cosine coefficients. However the same Fourier series can be presented in a different way:

F(t) = C + A1*Sin(wt+f1) + A2*Sin(2wt+f2) + A3*Sin(3wt+f3) + ...

Which means that you can specify the amplitude of each harmonic and its phase offset. This is what Visual Function Editor offers:

The scroll bars allow you to change amplitude and phase of each harmonic and preview the function in real time. There is also one very important feature of Visual Function Editor - sampling a function definition from CorelDRAW document. You can draw a function (one period) as a curve and then have SecuriDesign convert the curve into a function definition.

If you cannot create the shape of a function as you want by playing with Fourier coefficients, try designing the function in CorelDRAW. Just draw a horizontal line, convert it to curve, add some nodes, and move the nodes vertically like shown on the following picture:

Then with a control shape (or shapes) selected for the contour or pattern effect, start SecuriDesign. Go to Visual Function Designer and click on the Eyedropper button. The dialogs will disappear and the mouse cursor will change. Click on the curve that you created before. The macro will read in the curve definition and perform Discrete Fourier Transformation which will yield all the coefficients necessary to approximate the curve shape:

Make sure that the curve goes from left to right without changing direction. The following illustration shows an invalid curve that cannot be converted into a function. The part of the curve highlighted in red goes in opposite direction as the rest of the curve (right to left):

If you try to pick a curve that cannot be used as a function definition, error message will be shown stating that.


< Previous: Envelopes Tab | SecuriDesign Home | Next : Tutorial >


[ SecuriDesign | Oberon Product Index | Oberon Home Page ]

Copyright 2014 by Alex Vakulenko. All rights reserved.
This page was last revised on 11/16/02.