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

yang686526 2009-05-07 05:09 PM

【转帖】oo Large Min Max Extents
 
too large min max extents
too large min max extents
dear all,
i am working on a project which uses odvectorizex, and odreadex example projects as a base for retreiving/ reading the autocad (dwg/dxf files) objects from the database.
the problem with odvectorizex is that it handles the hatch objects in polylinproc, polylineout ... functions. so i cant diffrentiate between a polyline and a hatch object (can i..?). so i used the dump() function of class oddbhatch_dumper class, for reading hatch objects. and applied a filter in odvectorizex that it should not vectorize the objects of type acdbhatch.
but in odreadex, the returned min max extents of some hatch objects are too large. and are out of bound. the worst thing is that the vertex values of these hatch objects are also too large so i cant calculate min max extents from their vertex values.
but if i allow same hatch objects to be vectorized in odreadex, their extents are very much normal.
in odvectorizex i read the extents like this
================================================== ======================
void exsimpleview::draw(const odgidrawable* pdrawable)
{
oddbobjectptr pent = oddbobject::cast(pdrawable);
if (eok == pdrawable->getgeomextents(ext))
{
minpt = ext.minpoint();
maxpt = ext.maxpoint();
}
}
================================================== ===========================
and in odreadex i read extents like this
odgeextents3d extents;
if (eok == phatch->getgeomextents(extents))
{
minx.x = extents.minpoint().x;
minx.y = extents.minpoint().y;
minx.z = extents.minpoint().z;
maxx.x = extents.maxpoint().x;
maxx.y = extents.maxpoint().y;
maxx.z = extents.maxpoint().z;
}
any suggestions are most welcomed..!!
hi,
it will be very helpful if you can prepare small test file for vectorizeex sample to reproduce the problem.
i have attached a test file. i managed to work this file fine... with odvectorizex... the problem is with objects of type acdbhatch ......
in odreadex fff">dump() function related to hatch objects. the min max extents and the vertices are too large...
attached files (167.5 kb, 1 views)

hi,
hatches from your file have huge extents around 3e+6. such values are stored inside hatch entities in the file. so it is valid that readex returns huge extents. readex dump entity. but vectorizeex dump entity geometry after transformations, clipping and so on.
may be you can add some flag inside void exsimpleview::draw(const odgidrawable* pdrawable). at this point you know that pdrawable is dbhatch and all geometry will be from hatch.


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