几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】converting to 2d (http://www.dimcax.com/hust/showthread.php?t=15487)

yang686526 2009-05-04 06:16 PM

【转帖】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


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