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

yang686526 2009-05-06 04:51 PM

【转帖】linetype rendering 9simplification 0
 
linetype rendering (simplification ?)
linetype rendering (simplification ?)
hi!
i use the rendering framework (odgsbasevectorizeview, odgsbasevectorizedevice, etc.) to render the geometry in my home made viewer.
why is it that when i render small linetypes, then get rendered as continuous lines. fff">
i attached 2 files. you can see 5 lines at the bottom. the linetype scales go from 0.08 (top line) to 0.04 (bottom line).
line1.gif : a screenshot from autocad.
line2.gif : a screenshot from my home made viewer. as you can see, the smaller linetypes are renderer as continuous lines. the polylineout() method only sends me 1 straight line.
why is it happening ? it doesnt render like that in your examples (singledoc.exe, odmfcapp.exe, etc.).
mat
attached images
hi mat,
dd vectorization calls odgsview::linetypegenerationcriteria() to decide if linetype should be generated. dd generates ltp if total pattern length calculated in wcs >= ltp generation criteria. default implementation of linetypegenerationcriteria() returns value calculated from values passed into odgsview::setviewport() which defines target resolution.
you probably should override odgsbasevectorizeview::linetypegenerationcriteria( ) to return 0.0 or other reasonable value...
default dd implementation:
code:
double odgsbasevectorizeview::linetypegenerationcriteria() const
{
odgepoint2d pixelsperunit;
getnumpixelsinunitsquare(odgepoint3d::korigin, pixelsperunit);
pixelsperunit.x = fabs(pixelsperunit.x);
pixelsperunit.y = fabs(pixelsperunit.y);
double pixelsize = 1.0 / odmax(pixelsperunit.x, pixelsperunit.y);
return 2.0 * pixelsize;
}


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