Detecting mesh inputs
mark at sidefx.com
Tue Sep 23 15:44:05 EDT 2003
On Tuesday Sep 23 at 12:16, Ryo Sakaguchi wrote:
> Hi list.
> How would I find out if an input
> is a mesh geometry?
I think the only way is to iterate over the primitives:
for (i = gdp->primitives().entries(); i-- > 0; )
prim = gdp->primitives()(i);
if (prim->getPrimitiveId() & GEOHULL)
fprintf(stderr, "Prim %d is a mesh\n", i);
else fprintf(stderr, "Prim %d isn't a mesh\n", i);
Of course, if you get polygons as input, they may be in mesh topology
or not. This is a tricky problem. You can make assumptions about how
the mesh was made and see if the p-soup matches your assumptions.
Otherwise, you can build a GQ datastructure and validate topology
information. Not a trivial thing.
mark at sidefx.com (Mark Elendt)
"So, are you going to have a busy week tomorrow?" - Jennifer Keating
More information about the Sidefx-devkit-list