Varcon: Open source parametric 3D surface modeler for Linux

Varcon: Open source parametric 3D surface modeler for Linux

Post by Eric Wilhel » Sat, 19 Jan 2002 09:50:41



The quest continues.

Varkon is not the answer for me, as it is not really suited to one-time
creation of unique items.  It is a very interesting program though, and
some of you programmers may find yourselves right at home with it.

Basically, you can draw the model, or you can program it.  Everything is
defined using their own object-oriented programming language.  It is
therefore analytical to a fault.

The benefit of this approach is that you can create thousands of parts
from one "application".  You lay out the geometry, either with a text
editor or with their (rather clunky) interface.  You can define variables,
make a few changes to the variables and have the entire model instantly
updated. You can also have modules (basically subroutines) which are
inserted into the main "application" and can be manipulated as entities.

This is a really good way to do things if you have several parts to make
which are basically the same, but have different dimensions.

Here's a brief example:

This is the main "application":

        LOCAL DRAWING MODULE t1();

        CONSTANT INT xmin=0;
        CONSTANT INT ymin=0;
        CONSTANT INT xmax=1200;
        CONSTANT INT ymax=1200;

        BEGINMODULE

        lin_free(#1,vec(xmin, ymin), vec(xmax, ymin));
         lin_free(#2,vec(xmax, ymin), vec(xmax, ymax));
        lin_free(#3,vec(xmax, ymax), vec(xmin, ymax));
        lin_free(#4,vec(xmin, ymax), vec(xmin, ymin));
        part(#5,box1(vec(100, 1100), 1000, 5));

        ENDMODULE

It is four lines making a rectangle.
The part is where the module is inserted.  The part could be like so:

        global geometry module box1(
        float x;
        float y;
        float z
        );

        vector lbb; ! left back bottom; origin
        vector lbt; ! left back top
        vector lft; ! left front top
        vector lfb; ! left front bottom

        vector rbb; ! right back bottom
         vector rbt; ! right back top
         vector rft; ! right front top
         vector rfb; ! right front bottom

        beginmodule

        lbb := vec (0, 0, 0);
         lbt := vec (0, y, 0);
         lft := vec (0, y, z);
         lfb := vec (0, 0, z);

        lin_free (#1, lfb, lbb: PEN=4);
         lin_free (#2, lft, lbt: PEN=4);
        lin_free (#3, lfb, lft: PEN=3);
         lin_free (#4, lbb, lbt: PEN=3);

        rbb := vec (x, 0, 0);
         rbt := vec (x, y, 0);
         rft := vec (x, y, z);
         rfb := vec (x, 0, z);

        lin_free (#5, rfb, rbb: PEN=4);
         lin_free (#6, rft, rbt: PEN=4);
         lin_free (#7, rfb, rft: PEN=3);
         lin_free (#8, rbb, rbt: PEN=3);

        lin_free (#9, lbb, rbb: PEN=2);
         lin_free (#10, lfb, rfb: PEN=2);

        lin_free (#11, lbt, rbt: PEN=2);
         lin_free (#12, lft, rft: PEN=2);

        endmodule

It looks promising if you are in manufacturing or scientific analysis.
It does not have solids, and it does not have an interactive 3D orbit
(though it does have a pop-up visualization window, you can't spin the
model into position and work on it from that view, you have to go through
a little more to define a custom viewpoint (i.e. write a few lines of
code)).  It does look like it has some powerful surface editing
capability, though I can't see that it does NURBS.

It might also be good for use in video-game programming to create various
background buildings of different sizes and other such repetitive tasks.

--Eric