几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】how to get vertex of polyfacemesh (http://www.dimcax.com/hust/showthread.php?t=16705)

yang686526 2009-05-06 02:50 PM

【转帖】how to get vertex of polyfacemesh
 
how to get vertex of polyfacemesh
how to get vertex of polyfacemesh
hi, all:
i know how to get all vertices of a polyfacemesh entity.
here is the code:
oddbpolyfacemeshptr ppoly;
..........................
oddbobjectiteratorptr piter = ppoly->vertexiterator();
for (; !piter->done(); piter->step())
{
oddbpolyfacemeshvertexptr pvertex =
piter->entity()->queryx(oddbpolyfacemeshvertex::desc());
if (!pvertex.isnull())
{
odgepoint3d point(pvertex->position());
..............................
}
else
{
oddbfacerecordptr pface =
piter->entity()->queryx(oddbfacerecord::desc());
if (!pface.isnull() )
{
for(int i = 0; i < 4; ++i)
int vertexindex = pface->getvertexat(i);
//how to get coords of these four vertices ????????????
}
}
}
"getvertexat()" function of "oddbfacerecord" class allows you to get
index of vertices for each polyface. how to use these indices to
get vertices ??? i need the coords of 4 vertices for each polyface
in order to draw it.
thanks in advance!
gary
you can get vertex coordinates into gepoint3d array iterating through oddbpolyfacemeshvertices and use indices to access values in your temporary array
sergey slezkin
quote:
originally posted by sergey slezkin
you can get vertex coordinates into gepoint3d array iterating through oddbpolyfacemeshvertices and use indices to access values in your temporary array
thank you for your answer, sergey!
one more question:
the index of vertex starts with 1 or 0 ???
thanks.
gary
vertex index starts with 1. negative value indicates that corresponding edge is invisible.
sergey slezkin


所有的时间均为北京时间。 现在的时间是 10:53 AM.