几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】solid Hatch Tesselation Generated 1 Million Triangles (http://www.dimcax.com/hust/showthread.php?t=18628)

yang686526 2009-05-07 04:10 PM

【转帖】solid Hatch Tesselation Generated 1 Million Triangles
 
solid hatch tesselation generated 1 million triangles
solid hatch tesselation generated 1 million triangles
i got a strange problem: a small dwg generated over a million triangles during rendering. reason: there was a hatches with solid fill that had a high res curve outline. this hatch was tesselated into a million very narrow triangles.
the one parameter i found that could influence this was the kodgimaxdevforcurve in the myview::deviation call. for this particular drawing the odgsbasevectorizeview::deviation() will return "2.5e-005". this was definitively not appropriate for this drawing. setting it to 1.0 yielded acceptable resolution and number of triangles.
how is default for deviation kodgimaxdevforcurve calulated?
lets say i know the minimum length "l" of any curve segment in wcs. and i am rendering *model_space. what would be the formula for calculating an appropriate myview::deviation for kodgimaxdevforcurve?
-rune jorgensen
hi,
deviation is maximum distance between segment (l) inscribed into curve and appropriate chord.
could you elaborate a bit? from the manual:
"with respect to the current active viewport"
i am rendering *model_space and the model "viewport" is active, not any layouts. the projection is a standard "top" projection. the view center according to autocad is [14950.9 -11929.2] and width/height [129493.0 81547.7].
what formula do the toolkit odgsbasevectorizeview::deviation() apply that makes it end up with a kodgimaxdevforcurve of "2.5e-005" in this situation? what logic is used to determine a reasonable deviation?
-rune jorgensen

code:
double odgsbasevectorizeview::calcdeviation(const odgideviationtype , const odgepoint3d& pt) const
{
...
odgepoint2d pixelsperunit;
getnumpixelsinunitsquare(pt, pixelsperunit);
pixelsperunit.x = fabs(pixelsperunit.x);
pixelsperunit.y = fabs(pixelsperunit.y);
double deviation = (0.5 / odmax(pixelsperunit.x, pixelsperunit.y));
...
}
in other words it's half of pixel in world units.
pixel resolution is set by odgsdevice:nsize().

there we go! thats what i was looking for.
thanks!
-rune jorgensen


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