高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】unable To Create Hatch With Odgeline2d Loops
unable to create hatch with odgeline2d loops
unable to create hatch with odgeline2d loops
i'm having trouble writing hatches in certain cases. in particular, i can create a hatch with a loop containing odgecircarc2d's and odgeelliparc2d's, but not odgeline2d's.
i have made sure the four lines create a closed square by using the same odgepoint2d instance for the start and end points.
the following code results in -1 for figuretype in the dxf file, with no points, of course.
like i said, it works fine with circular arcs and elliptical arcs. this example code is pulled from dbfiller.addhatches(), which conveniently only users circles.
any pointers would be greatly appreciated. thanks!
edit: i'm using version 1.13.
code:
oddbhatchptr phatch = oddbhatch::createobject();
oddbobjectid solidhatchid = pblock->appendoddbentity(phatch);
phatch->setassociative(false);
phatch->setpattern(oddbhatch::kpredefined, "solid");
phatch->sethatchstyle(oddbhatch::knormal);
odgepoint2d llpoint(3.0,3.0);
odgepoint2d lrpoint(10.0,3.0);
odgepoint2d ulpoint(3.0,10.0);
odgepoint2d urpoint(10.0,10.0);
edgearray edgearray;
edgearray.push_back (new odgeline2d (llpoint,lrpoint));
edgearray.push_back (new odgeline2d (lrpoint,urpoint));
edgearray.push_back (new odgeline2d (urpoint,ulpoint));
edgearray.push_back (new odgeline2d (ulpoint,llpoint));
phatch->appendloop (oddbhatch::kdefault, edgearray);
last edited by marka; 28th october 2005 at 08:32 amfff">. reason: using version 1.13
odgeline2d is infinite line.
use odgelineseg2d.
sincerely yours,
george udov
thank you. that hadn't occurred to me.
|