triming a nurbs surface
triming a nurbs surface
i can read the dwg joined here but :
in odamfcapp a quarter of torus appears
in my app the complete torus appears.
does it means i'm loosing some info
i've tried to understand getenveloppe() method but i don't know what i can do with lowbound and upperbound they are not lying in (uxv) space [0,1] x [0,1]
is it possible to have the full code of odamfcapp to see how these data are hold ? it will be nice to be able to track the reading code when having such a difficulty with a special entity.
philippe
attached images
hi,
as i see from picture, you draw full torus. but solid surface consist of full torus and trimming curves. it is not trivial task to cut piece of surface by trimming curves(loops). mfcapp used modelergeometry.drx library for it. it is possible to get geometry from oddbsolid object. it can return geometry like isolines or like shells (triangles). if you use opengl for viewing, you should push surface trimming loops to opengl.
the sources are available only for founding members.
trimming loop ?
thanks for this answer but could you tell me more about triming loops ?
i've made a search in oda help files. i did'nt find anything except odbrfacelooptraverser. but i don't know how to use it ...
what i did to explore an odbrbrep
1) use odbrbrepfacetraverser get a serie of odbrface
2) for each odbrface use getenveloppe to get a nurbs
3) trim it ... but i don't know how ? i have an access to a trimming api for nurbs in my kernel modeler. so i think i should be able to use trimming data if i can get them. are these trimming data hidden ?
philippe
brepfacetraverser - get enum of faces.
facelooptraverser - get enum of trimming loop for face
loopedgetraverser - get edges of loop
loopedgetraverser has getorientedcurve method (return pointer to newly created odgecurve3d object)
edge has getvertex1, getvertex2 (return start\end vertexes of edge)
also face, edge, loopedgetraverser has orientation flag = forward\reverse.
you can read arx help about br. ddt br and arx br are very similar.
oddbsolid and mesh
when you say :
"it is possible to get geometry from oddbsolid object. it can return geometry like isolines or like shells (triangles). if you use opengl for viewing, you should push surface trimming loops to opengl."
could you explain me more how to retrieve isolines or shells (triangles) ?
i've spent many hours to retrieve data from odbrface with poor result ...
i can't find a way to read complex data even with oda library. the mfc sample read them very well, i don't ... perhaps it's too complex for me.
i need at least just to visualize these models and i don't need the brep models to be recreated...
any help will be very appreciated.
philippe
attached files (39.4 kb, 9 views)
1. see satgeomtracer example. it return isolines and shells from *.sat file . you have similar task with oddb3dsolid object.
i think that you could call
od3dsolidptr psolid = ...
odsampleworldgeometry wirewd;
psolid->worlddraw(wirewd);
regentype() should return odacisrenderer::kshells for shells odacisrenderer::kisolines for isolines. also numberofisolines sholud return number of isolines
2. also we have brex sample. it show you how to use br* classes.
3. you can convert od3dsolid to oddbpolyfacemesh like in oneditacisconversion() (mfcapp sample) and get triangles from oddbpolyfacemesh.
od3dsolid -> oddbpolyfacemesh
dear alexander,
thank you for your answer but i've tried to explore all the way and i'me sure that i missed something :
1) where can i find satgeomtracer example ? i've tried to localize it without any success ?
2) brex sample. are too complicated for me. i've tried to look at them but there is no example that read a complex shape and explore trimmed nurbs. it usually loop face and edge... to display their coordinates.
3) the example i have found with oneditacisconversion() does not mention od3dsolid or oddbpolyfacemesh. it just seems to save an object in another format and this process is transparent while writing directly in database
this solution od3dsolid -> oddbpolyfacemesh would be a good solution to start with but i failed on that way too.
is there anything i did not installed ?
philippe
quote:
originally posted by philippe carret
dear alexander,
1) where can i find satgeomtracer example ? i've tried to localize it without any success ?
nonlibs.zip examples/satgeomtracer
quote:
3) the example i have found with oneditacisconversion() does not mention od3dsolid or oddbpolyfacemesh. it just seems to save an object in another format and this process is transparent while writing directly in database
philippe
code below from odamfcapp sample replaces all acis entities in model space with oddbpolyfacemeshes.
code:
void cdwgview:

neditacisconversion()
{
oddbdatabase* pdb = getdocument();
pdb->startundorecord();
oddbblocktablerecordptr pms = pdb->getmodelspaceid().openobject();
oddbobjectiteratorptr pentiter = pms->newiterator();
while(!pentiter->done())
{
oddbentityptr pent = pentiter->entity(oddb::kforwrite);
pentiter->step();
if (!pent.isnull()
&& (pent->iskindof(oddbregion::desc())
|| pent->iskindof(oddbbody::desc())
|| pent->iskindof(oddb3dsolid::desc())))
{
bool exchangexdata;
oddbobjectid replaceid;
oddbobjectptr pnewobj = pent->decomposeforsave(oddb::vac12, replaceid, exchangexdata);
if (!pnewobj.isnull())
{
pent->handoverto(pnewobj);
}
}
}
filltree();
}
sergey slezkin