Varkon.Org Home


Notes

Useful things from the mailing list, how to solve problems, etc.

The notes involving bugs apply only to the 1.18 versions.


Table of Contents:

Accessing Varkon's Fonts -- 1.18x ONLY
Desktop Icon Problem -- 1.18x ONLY
Implementation of NURBS Curves in Varkon
VECTOR variables

Accessing Varkon's Fonts -- 1.18x ONLY - - ToC

This problem has been resolved with the 1.19x releases.

Varkon has six built in fonts, but there's a bug that makes them unavailable. The font filename suffixes are lowercase, but they must be uppercase.

To fix this, cd to /etc/varkon/cnf/fnt, and ~/varkon/cnf/fnt, and change all the filenames from 'n.fnt' to 'n.FNT', where 'n' is the integer in the filename.

In Linux/Unix, cd to the fonts dirs, and run this on the command line:

for f in *.fnt;do NEW=`echo $f | sed 's/fnt/FNT/g'`;mv $f $NEW;done

(...and mind the quotes and backticks, too)


Desktop Icon Problem -- 1.18x ONLY - - ToC

This problem has been resolved with the 1.19x releases.

If your Varkon menus overlay a desktop full of icons, you can accidentally launch their applications: Varkon responds to mouse button "press" events, while KDE, and possibly others, apparently respond to "release" events. When you click a Varkon menu item, the menu will disappear or resize on the "press", and the mouse cursor is now over some desktop icon when the button is released, which will then launch that application. [Source]

You can work around this by having the Varkon application launcher open Varkon from inside a terminal window that covers either your Varkon work area, or the entire screen. The terminal window works as a shield preventing you from accidentally interacting with any desktop icons until Varkon closes.

In KDE, right-click the Varkon icon; select "properties"; select the "Application" tab; put

/usr/bin/varkon;sleep 1

in the "Command" box, and in the "Advanced Options" section, select "Run in terminal". Alternately, you could put something like

konsole --name Varkon --schema Linux.schema --vt_sz 80x25 -e /bin/sh -c "/usr/bin/varkon;sleep 1"

in the "Command" box, and don't fool with the "Advanced Options" stuff. This method gives you more control over the way the terminal is displayed. E.g. you can have the Varkon background terminal cover the entire desktop, without disturbing your default terminal settings.


Implementation of NURBS Curves in Varkon - - ToC

This paper describes the implementation of NURBS curves into the VARKON CAD system.

NURBS is an acronym for "Non Uniform Rational B-Spline" and is widely used in Computer Aided Design (CAD) to represent both curves and surfaces.

The document gives a background to the area of curves in Computer Aided Design, different curve types, their main properties etc.

This introduction is followed by a detailed explanation of the theory behind NURBS and the implementation in VARKON.

The theories and implementations of derivatives, normals and curvature are explained here as well as the calculation of an analytical offset curve.

The document can serve as an introduction to curves in Computer Aided Design as well as an example of what kind of problem one has to deal with when implementing geometric entities in a CAD system.

Implementation of NURBS curves into the VARKON CAD system


VECTOR variables - - ToC

In Varkon, the VECTOR data type is composed of two components. For a VECTOR named FOO, the components are floats named FOO.x and FOO.y.

You don't declare FOO.x or FOO.y, you only declare FOO.

So:

BASIC DRAWING MODULE Vectors();

VECTOR FOO;
STRING MESG*132;

BEGINMODULE

FOO:= vec(100,50);
MESG:="FOO: X = "+STR(FOO.x)+", Y = "+STR(FOO.y);
text(#1, vec(100,100),0, MESG);

MESG:="FOO: X = "+STR(FOO.x,4,0)+", Y = "+STR(FOO.y,4,0);

text(#2, vec(100,90),0, MESG);

ENDMODULE

--Regards to Gunnar Liden for proper example code.