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

yang686526 2009-05-07 03:56 PM

【转帖】simple Hatch Problem
 
simple hatch problem
simple hatch problem
odgepoint2darray vertexpts;
odgedoublearray vertexbulges;
oddbblocktablerecordptr precord;
precord = current_block_id_.safeopenobject(oddb::kforwrite);
oddbhatchptr phatch;
phatch = oddbhatch::createobject();
odgevector3d normal(0.0, 0.0, 1.0);
phatch->setnormal(normal);
phatch->setelevation(0.0);
phatch->setpattern(oddbhatch::kpredefined, "solid");
phatch->sethatchstyle(oddbhatch::knormal );
phatch->setassociative( false );
//populate the vertex points and bulges from our data:
//point1: -68.181599, 52.303400
//point2: -1.116669, 50.842521
//point3: -1.116669, 0.081812
//point4: -65.909121, 0.081811
for( n=0; n < our_point_array.size(); n++)
{
vertexpts.push_back( our_point_array[n] );
vertexbulges.push_back( 0 );
}
// make sure start and end points are coincident
if( vertexpts.first() != vertexpts.last() )
{
vertexpts.push_back( vertexpts.first() );
vertexbulges.push_back( 0 );
}
//and it crashes hard here:
phatch->appendloop(oddbhatch::kexternal, vertexpts, vertexbulges);
i'm using the 1.14 libraries, where am i going wrong?
i've upgraded to the 2.2 libraries, and the problem still exists. am i the only one unable to create a hatch using this method? my next course of action is to convert my polygon points to edge pointers. any advice is appreciated.
ray
you need specify polyline flag in looptype parameter:
code:
phatch->appendloop(oddbhatch::kexternal | oddbhatch::kpolyline, vertexpts, vertexbulges);
sergey slezkin
thank you,
that solved the issue.


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