查看单个帖子
旧 2009-05-06, 10:12 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】polygonmesh

polygonmesh
polygonmesh
hi
i wanted to read a polygonmesh object in a dwg file in such a way so that
i can know which points are connected to which other.
currently i use a vertex iterator, but that doesn't tell me which vertices are joined to which other in the polygon.
is there any way by which i can get all the vertices as well as the knowledge of which vertex is linked to which other??
thanks
alex
quote:
originally posted by alex30
hi
i wanted to read a polygonmesh object in a dwg file in such a way so that
i can know which points are connected to which other.
currently i use a vertex iterator, but that doesn't tell me which vertices are joined to which other in the polygon.
is there any way by which i can get all the vertices as well as the knowledge of which vertex is linked to which other??
thanks
alex
alex:
each face is defined by three (if the last vertex is number zero) or four vertices.
so if we have a face 'a b c 0',
then a<->b, b<->c, and c<-> a
if we have a face 'a b c d',
then a<->b, b<-> c, c<->d, and d<-a)
you'll have to collect these connections in a suitable structure.
don't forget that a<->b is equivalent to b<-> a, and that, in general. each pair of connected vertices is connected twice.
hope this helps.
mjf wrote about polyface not polygon mesh.
polygon mesh is an array of mxn vertices. to draw a wireframe you need to connect each vertex with its neighbours in the row and in the column. mesh can be closed in m and/or n direction.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)