Object definition A typical definition of an object isobj objId = object(parameters); objId = object(parameters);where object stands for one of the keywords listed below. The first parameter is usually radius (defined in meters!) of a bounding sphere of the primitive. Note that the scene has similarly its size defined in meters.Most object definitions have two forms, with object color as the last parameter. If the color is not defined, White is used as default. If the grid is monochromatic, the color parameter is ignored.
Most of the object definition keywords end with 3D, 2D or 1D, which means that the primitime is a solid, a surface or a line model respectively.
- sphere3D(radius, color);
- sphere3D(radius);
- A solid sphere voxelized as an implicit solid.
- sphere2D(radius, color);
- sphere2D(radius);
- A sphere surface voxelized as a parametric surface.
- torus2D(MajRadius, MinRadius, color);
- torus2D(MajRadius, MinRadius);
- A toric surface voxelized as a parametric surface. MajRadius defines size of the torus, while MinRadius its thickness.
- supertorus2D(MajRadius, MajPar, MinRadius, MinPar, color);
- supertorus2D(MajRadius, MajPar, MinRadius, MinPar);
- A supertoric surface voxelized as a parametric surface. MajRadius defines size of the torus, while MinRadius its thickness. MajPar and {\MinPar} define shape:
- par < 1: Rounded corners
- par = 1: Circular
- par < 2: Convex (Sharp corners)
- par = 2: Square
- par > 2: Concave (Sharp corners)
- supersphere2D(MajRadius, MajPar, MinPar, color);
- supersphere2D(MajRadius, MajPar, MinPar);
- A supersphere. See supertorus2D for parameter description.
- moebius2D(radius, width, color);
- moebius2D(radius, width);
- A Moebius strip.
- impOctahedron3D(radius, color);
- impOctahedron3D(radius);
- Octahedron voxelized as an implicit solid.
- impCube3D(radius, color);
- impCube3D(radius);
- Cube voxelized as an implicit solid.
- tetrahedron3D(radius, color);
- tetrahedron2D(radius, color);
- tetrahedron1D(radius, color);
- tetrahedron3D(radius);
- tetrahedron2D(radius);
- tetrahedron1D(radius);
- A Platonic tetrahedron. This and also the remaining Platonic solids can be voxelized in three ways:
- tetrahedron1D: A wire frame model
- tetrahedron2D: A polygonal model
- tetrahedron3D: A solid model, defined as intersection of halfspace primitives.
Note that size of the polygonal and solid versions are different: the polygonal appears to be bigger. This is due to the fact that its walls are represented by surface primitives, which cannot be represented with zero thickness in a volume grid. This the the 'thickness'. This comment holds, of course, for all 2D and 1D primitives.
- octahedron3D(radius, color);
- octahedron2D(radius, color);
- octahedron1D(radius, color);
- octahedron3D(radius);
- octahedron2D(radius);
- octahedron1D(radius);
- A Platonic octahedron.
- hexahedron3D(radius, color);
- hexahedron2D(radius, color);
- hexahedron1D(radius, color);
- hexahedron3D(radius);
- hexahedron2D(radius);
- hexahedron1D(radius);
- A Platonic hexahedron.
- icosahedron3D(radius, color);
- icosahedron2D(radius, color);
- icosahedron1D(radius, color);
- icosahedron3D(radius);
- icosahedron2D(radius);
- icosahedron1D(radius);
- A Platonic icosahedron.
- dodecahedron3D(radius, color);
- dodecahedron2D(radius, color);
- dodecahedron1D(radius, color);
- dodecahedron3D(radius);
- dodecahedron2D(radius);
- dodecahedron1D(radius);
- A Platonic dodecahedron.
- extModel("file_name");
- extModel enables to read description of complex models defined by some simple primitives. Currently, the external models support only two types:
- triangle(x1,y1,z1)(x2,y2,z2)(x3,y3,z3);
- which enables to read triangular models and
- sphere x y z r
- which reads spheres.
The third command is for color definition:
- color = r g b;
- where the values are in the range 0..255.
New primitives can easily be added in the vxtLoadSimpleModel function (vxtModels.cpp). The strange syntax was influenced simply by that I had some programs for creation of such files. There is only one primitive per line allowed. All lines, which do not start with triangle, sphere or color are ignored.
Creating triangular models
The easiest way is to download a model you like from the web and to convert it to a format, stupid enough to be read by the 'extModel' command. E.g., I do it in the following way:
- Download a model from 3DCAFE. The recommended format is dxf.
- Using Crossroads (for Windows only), convert the file to the Megahedron format, which can be then read by the 'extModel' command.
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de