|
高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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").
|