VARKON Version 1.16 1998-09-24

### Geometric modeling basics

There are numerous ways of creating and using geometry in VARKON. Basic geometric entities are points, lines, arcs, curves, surfaces, coordinate systems and transformations. All entities are created using one of several methods. A line for example, starting in X=0, Y=0, Z=0 and ending in X=100, Y=0, Z=0 could be created the following way...
lin_free(#1,vec(0,0,0),vec(100,0,0));
The method lin_free indicates that the line is free to go between any 2 positions in 3D space. In this case the function vec(x,y,z) is used to express the positions. Other methods are lin_ang, lin_offs, lin_proj, lin_tan1, lin_tan2 and lin_perp. The #1 following the first left parenthesis is the unique identity we give the line. Suppose now we want to create a line parallel to #1...
lin_offs(#2,#1,50);
lin_offs creates a new line (#2) offset to an old line (#1) at a given distance (50). All modeling operations are relative to a currently active coordinate system. BASIC is the default system but any number of local coordinate systems can be created at any time and activated in any order. The following two statements...
csys_1p(#3,"My_system",vec(25,0,0),0,0,30);
mode_local(#3);
creates a new coordinate system (#3) in X=25, Y=0, Z=0 rotated 30 degrees around the Z-axis and gives it the name "My_system". mode_local activates the system. The XY-plane in the active coordinate system is used as the active plane for all operations where a 2D plane is needed. lin_offs for example always creates a new line placed in the active XY-plane. If the original line doesn't lie in the active plane then the new line is made parallel to the projection of the old line into the active plane.
All wire frame entities have a sense of direction. #1 above starts in (0,0,0) and ends in (100,0,0). Many modeling operations depend on this. lin_offs for example uses the sense of direction to decide on what side of the old line to place the new line. If you stand in the starting position of #1 looking towards its end then the right side of the line is treated as positive and the left side as negative. A distance of plus 50 then places the new line on the right side while a distance of minus 50 places the new line on the left side.

The sense of direction for a wireframe object is also used as its parametric directions. Lines and arcs always have parameters that range from 0 to 1. Their parametrisation is true arclength meaning that a value of 0.5 for example is always the position half way along the entity. Curves have native parametrisation ranging from 0 to the integer number of segments they have. A curve with 5 segments will have a parameter that ranges from 0 to 5.

Surfaces and b_planes have two parametric directions, U and V ranging from 0 to some integer number equal to the number of patches in that direction. A surface with 2 X 5 patches in U and V will have a parameter U that ranges from 0 to 2 and V that ranges from 0 to 5. B_planes only have one "patch" and their parametrisation is always 0 to 1 in both directions.
The idea of an active coordinate system with its XY-plane and entities with identity and direction is a powerful feature of MBS that helps in making geometric programming simple and concise.

VARKON Homepage | Index