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

yang686526 2009-05-07 12:49 PM

【转帖】region creation problem
 
region creation problem
region creation problem
i am trying to create region by using the function oddbregion::createfromcurves( const odrxobjectptrarray& curvesegments,
odrxobjectptrarray& regions )
and suppose i pass two intersection circle in curvesegments then regions created is 0. why is this happening.
and if i create two close loops and passing the entity list to curvesegments then still i am getting only one region instead of 2 regions.
hi,
here is limitation. createfromcurves creates only one region for call. only first loop used from input curve array. and curves should be orderer in input array.
boolean operations with regions aren't implemented.
thanks for reply .. is there any other method to create region .
only acisin(...) from file or membuf. we use next trick also
code:
char buf[1000];
static const char* sat =
"700 6 1 0\n"
"16 autodesk autocad 17 asm 6.0.4.7009 nt 24 wed may 05 14:46:44 2004\n"
"1 9.9999999999999995e-007 1e-010\n"
"body $-1 -1 $-1 $1 $-1 $-1 #\n"
"lump $-1 -1 $-1 $-1 $2 $0 #\n"
"shell $-1 -1 $-1 $-1 $-1 $3 $-1 $1 #\n"
"face $4 -1 $-1 $-1 $-1 $2 $-1 $5 forward single #\n"
"color-adesk-attrib $-1 -1 $-1 $-1 $3 256 #\n"
"sphere-surface $-1 -1 $-1 0 0 0 %.17lg 1 0 0 0 0 1 forward_v i i i i #\n";
sprintf(buf, sat, radius);
sir actully my problem is that .. i have a collection of entities . like circle , line , poly line , spline and all that. i have to get all the closed regions .. like closed region created ny circle and circle or circle and line .. etc.. what could be the best possible way to do that .. thanks in advance
toolkit can help you only with region creation with described limitation. so you should implement functionality getallclosedloopsfromentities.
i am using dwg direct library .. not using any toolkit .. and what is this
getallclosedloopsfromentities() .. is this any oddb function ..
please clear it .. i am not getting any solution.
getallclosedloopsfromentities is not toolkit function. you should implement such functionality. toolkit hasn't it.
in my opinion
1. you have input array with entities.
2. you should implement functionality, which return to you closed loops from input array somehow. this is replacement of not fully implemented createfromcurves in toolkit.
3. use toolkit version of createfromcurves to get region for each loop from p.2.
4. you got array of regions.


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