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

polylines and plineproc in vectorizer
polylines and plineproc in vectorizer
not sure, but if i made no mistake, where is a problem with the plineproc:
in the attached drawing are two polylines (originally 'old' 2dpolylines from autocad 13 or so).
one polyline has widths, but plineproc 'ignores' the width, the pointer to the database polyline even so.
and all polylines have wrong coordinates, it seems, that the coordinates are in the entity coordinate space, the database polyline has the real coordinates.
i added the following test code in the exgssimpledevice :: plineproc from exgssimpledevice.cpp:
code:
oddbpolylineptr pline = lwbuf.getdbpolyline();
odgepoint2d pt_2d_from_lwbuf;
lwbuf.getpointat(0, pt_2d_from_lwbuf);
odgepoint3d pt_3d_from_lwbuf(odgepoint3d(pt_2d_from_lwbuf.y, pt_2d_from_lwbuf.y, 0));
pt_3d_from_lwbuf.transformby(*pxform);

odgepoint3d pt_from_dbobject;
pline->getpointat(0, pt_from_dbobject);
//the oddbpolylineptr points are ok, but the odgipolyline seems to have
//coordinates in the entity coordinate space
//
//applying xform does not matter
//////////////////////////////////////////////////////////////////////////
double sw_from_lwbuf, ew_from_lwbuf;
lwbuf.getwidthsat(0, ew_from_lwbuf, sw_from_lwbuf);
double sw_from_db_object, ew_from_db_object;
pline->getwidthsat(0, sw_from_db_object, ew_from_db_object);
//the widhts for the "disc-like" polyline are always zero, for both polylines
woho
attached files

it is plineproc with constant width. you can obtain constant width by odgipolyline::getconstantwidth(). in case it is zero, you should use odgipolyline::getwidthsat() to get width that is not constant.
sincerely yours,
george udov
in what cases do we get a non-constant width for a segment? can we directly create something in autocad which shows this behavior or is this a feature of the vectorizor?

i don't think it is distinguishable in autocad gui is it a const-width or value-width polyline.
in dxf there are groupcode 43 (lwpolyline)...
sincerely yours,
george udov
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)