Functions | |
HC_KEY | Generate_Shell_From_Geometry (HC_KEY geom, const char *options) |
HC_KEY Generate_Shell_From_Geometry | ( | HC_KEY | geom, |
const char * | options | ||
) |
Creates a Shell from an analytic definition of an object, according to the tessellation options specified.
geom | - Key to the geometry from which the shell should be generated. The geometry types supported include Spheres, PolyCylinders, Cylinders and NURBS Surfaces. |
options | - String containing the tessellation options for the geometry. |
In many cases developers would rather have the tessellated version of some primitives supported by HOOPS (spheres, polycylinders, and NURBS surfaces). In addition to providing the tessellated form of the given primitive, the shell returned to the user by this function will include any LODs that may have been associated with the primitive, as well as any of the vertex level attributes (coloring, texture coordinates and normals).
The tesselation option varies for cylinders, spheres and NURBS surfaces. For cylinders, tessellation sets the number of faces that should be used during the rendering of a cylinder at each LOD level, where the first integer corresponds LOD level 0 (no simplification): the standard cylinder that is generated during insertion. The second (optional) integer corresponds to LOD level 1, etc. Special values are 0 to trigger drawing a line (using edge visibility), or -1 to trigger drawing nothing at all. A sample tessellation string for a cylinder might look like this:
const char *opts = "cylinder=(72, 12, 0)";
For spheres, the first integer tesselation sets the number of faces that are generated around the sphere's equator during a call to Insert_Sphere(). A valid tessellation string for a sphere might look like this:
const char *opts = "sphere=(16, 12, 0)";
You can also set tessellation for NURBS surfaces. Options include maximum facet deviation and maximum facet angle. You can learn more about options for NURBS surface tessellation in the Set_Rendering_Options()'s nurbs surface options. The following is a sample tessellation string for NURBS surfaces:
const char *opts="nurbs surface = (maximum facet angle = 5, maximum facet width = 0.5)";
Tessellation settings that are not provided will be filled in with default values. Unlike Show_Shell(), tessellation options will not be pulled out of the old geometry's owning segment.
For spheres, cylinders, and polycylinders, the LODs generated will be determined solely by the values in the tessellation settings. Level of detail options (see Set_Rendering_Options()) will play no role here.