cgv
|
convenience mesh class which makes accessing the stl data more easy More...
#include <stl_reader.h>
Public Member Functions | |
StlMesh () | |
initializes an empty mesh | |
size_t | num_vrts () const |
returns the number of vertices in the mesh | |
const TNumber * | vrt_coords (const size_t vi) const |
returns an array of 3 floating point values, one for each coordinate of the vertex | |
size_t | num_tris () const |
returns the number of triangles in the mesh | |
const TIndex * | tri_corner_inds (const size_t ti) const |
returns an array of 3 indices, one for each corner vertex of the triangle | |
const TIndex | tri_corner_ind (const size_t ti, const size_t ci) const |
returns the index of the corner with index 0<=ci<3 of triangle ti | |
const TNumber * | tri_corner_coords (const size_t ti, const size_t ci) const |
returns an array of 3 floating point values, one for each coordinate of the specified corner of the specified tri. More... | |
const TNumber * | tri_normal (const size_t ti) const |
returns an array of 3 floating point values defining the normal of a tri | |
size_t | num_solids () const |
returns the number of solids of the mesh More... | |
TIndex | solid_tris_begin (const size_t si) const |
returns the index of the first triangle in the given solid | |
TIndex | solid_tris_end (const size_t si) const |
returns the index of the triangle behind the last triangle in the given solid | |
const TNumber * | raw_coords () const |
returns a pointer to the coordinate array, containing num_vrts()*3 entries. More... | |
const TNumber * | raw_normals () const |
returns a pointer to the normal array, containing num_tris()*3 entries. More... | |
const TIndex * | raw_tris () const |
returns a pointer to the triangle array, containing num_tris()*3 entries. More... | |
const TIndex * | raw_solids () const |
returns a pointer to the solids array, containing num_solids()+1 entries. More... | |
StlMesh (const char *filename) | |
initializes the mesh from the stl-file specified through filename | |
bool | read_file (const char *filename) |
fills the mesh with the contents of the specified stl-file | |
convenience mesh class which makes accessing the stl data more easy
|
inline |
returns the number of solids of the mesh
solids can be seen as a partitioning of the triangles of a mesh. By iterating consecutively from the index of the first triangle of a solid si
(using solid_tris_begin(si)
) to the index of the last triangle of a solid (using solid_tris_end(...)-1
), one visits all triangles of the solid si
.
|
inline |
returns a pointer to the coordinate array, containing num_vrts()*3
entries.
Storage layout: x0,y0,z0,x1,y1,z1,...
NULL
if no coords exist.
|
inline |
returns a pointer to the normal array, containing num_tris()*3
entries.
Storage layout: nx0,ny0,nz0,nx1,ny1,nz1,...
NULL
if no normals exist.
|
inline |
returns a pointer to the solids array, containing num_solids()+1
entries.
Storage layout: s0begin, s0end/s1begin, s1end/s2begin, ..., sNend
NULL
if no solids exist.
|
inline |
returns a pointer to the triangle array, containing num_tris()*3
entries.
Storage layout: t0c0,t0c1,t0c2,t1c0,t1c1,t1c2,...
NULL
if no tris exist.
|
inline |
returns an array of 3 floating point values, one for each coordinate of the specified corner of the specified tri.
StlMesh mesh
: