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

yang686526 2009-05-07 04:07 PM

【转帖】smooth Oddbpolygonmesh 9polymeshtype0
 
smooth oddbpolygonmesh (polymeshtype)
smooth oddbpolygonmesh (polymeshtype)
is it possible to create a polygon mesh of type different then ksimplemesh
using dwgdirect?
in the code below i attempted to create a smooth mesh,
something like a cylinder. but got a box result in.
code:
oddbblocktablerecordptr pps = pdb->getmodelspaceid().safeopenobject(oddb::kforwrite);
oddbpolygonmeshptr ppgmesh = oddbpolygonmesh::createobject();
pps->appendoddbentity(ppgmesh);
msize = 4;
nsize = 2;
ppgmesh->setmsize(msize);
ppgmesh->setnsize(nsize);
appendpgmeshvertex(ppgmesh, -2, -2, -8);
appendpgmeshvertex(ppgmesh, -2, -2, 8);
appendpgmeshvertex(ppgmesh, -2, 2, -8);
appendpgmeshvertex(ppgmesh, -2, 2, 8);
appendpgmeshvertex(ppgmesh, 2, 2, -8);
appendpgmeshvertex(ppgmesh, 2, 2, 8);
appendpgmeshvertex(ppgmesh, 2, -2, -8);
appendpgmeshvertex(ppgmesh, 2, -2, 8);
ppgmesh->makemclosed();
ppgmesh->setpolymeshtype(oddb::kcubicsurfacemesh);
how do i create a cylinder a right way?
hi,
currently dd does not calculates fit vertices (oddbpolygonmesh::converttopolymeshtype() is not implemented). so you have to append both control and fit vertices instead of simple ones. don't forget to set proper surface density (setnsurfacedensity() and setmsurfacedensity()).
btw: i failed to create smooth quadratic mesh in autocad using points from your sample code as control ("too few vertices").


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