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

converting to 2d
converting to 2d
i am reading a dwg file into a 2d application.
i want to just preserve the *appearance* of polygonmesh objects.
is there any api call available for flattening the 3d objects to 2d ??
note : if i just ignore the z dimension of the vertices then the figure appears distorted.
thanks
alex
you cannot just cut the z coordinate. the entities must be drawn on the view screen, which is not always parallel to the world coordinate system. i.e. you must project the entities to the dcs (display coordinate system).
to do this easily, you can derive classes from odgsvectorizedevice and odgsvectorizeview, then use the polylineout() or similar function.
you'll recieve then the drawing being "exploded" to line segments.
you should also take care of some filled areas (like hatches) if you need to support them (by using a shell() or polygonout() members.)
regards
chudomir
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)