exploring brep
exploring brep
hi all
i am involved in a project where i have to display the geometric contents of a dwg file using opengl. i extracted some entities using your opendesign library. when using 3dsolid data i first converted the data to polyfacemesh. applying this way, we get a huge number of polyfacemesh data and the application becomes slower.
so i tried another approach-the brep one. i am new to using brep. i used the following approach.
1. get the brep of the solid.
2. travers the face record.
3. get the relevant surface entity.
here i am getting the sphere, cylinder, cone as i expected.
but when i draw a box in autocad file and read it i get some planes. now question is how to draw the same box here with the help of these planes.
also how to draw a individual plane entity that we get form face.
is it the correct approach to draw a solid entity.
kindly help me in this respect.
with regards.
anirban talukdar
hi,
dd has some examples about brep - odbrex, satbrepsample, satconverter, satgeomtracer. odbrex may help with brep traversing functionality.
box consist of 6 planes. each plane trimmed with 4 edges. each edges limited with 2 vertexes - start\end.
odbrface::getsurface() return odgeplane object for single box plane. it is unlimited plane. odbrfacelooptraverser and odbrloopedgetraverser return to you non\one\more trimming loops. this is only one trimming loop for single box plane. it is 4 edged square.
if you didn't use polyfacemesh convertion, you can draw solids like enum of isolines (like in satgeomtracer).
the simples way to draw something is draw all edges from brep, but full sphere hasn't trimming edges - so you got nothing.
also you can decrease number of triangles by changing of triangulation params (mfcapp\tools\options\triangulationparams). for example if you add next code to cdwgview:

neditacisconversion, it change normaltolerance to 45.
odrxgetmodelergeometrycreatorservice(); // for command registration
getdocument()->executecommand("modelerproperties normaltolerance 45 finish");
relationship between plane/edge edge/vertex
yes sir..
i got the point. but after getting the plane how to get the relationship which edge is connected to which plane and which vertices are coonected to which edges..
that is the problem i am exactly facing. also write me about loop in brep.
with regards
anirban
well, odbr classes are very similar to arx acbr*. autocad has full documentation about.
about relationship... for example edge <> vertexes...
odbredge loop;
....
odbrloopedgetraverser letr;
letr.setloop( loop )
while( ! letr.done() )
{
odbredge edge;
edge = letr.getedge();
.....
odbrvertex vertex1, vertex2;
edge.getvertex1( vertex1 );
edge.getvertex2( vertex2 );
.....
letr.next();
}
it was connection from loop->edge->vertexes
next point is odbrvertexedgetraverser... it return enum of edges connected to vertex. single vertex in box connect with 3 edges. it was vertexes->edge and you shoud use
odbredgelooptraverser to got edge->loops connection.
travesing problem.
sir
there are so many ways you can travers a brep. each traverser may have different purpose. we can use any one of the traverser to perform the task.
here i have to display the breps(i mean solids). so sir what will be the best way to travers it.
if you use the no of traversers you can have the following lists..
1. odbrbrepcomplextraverser
2. odbrbrepedgetraverser
3. odbrbrepfacetraverser
4. odbrbrepshelltraverser
5. odbrbrepvertextraverser
6. odbrcomplexshelltraverser
7. odbredgelooptraverser
8. odbrfacelooptraverser
9. odbrloopedgetraverser
10. odbrloopvertextraverser
11. odbrshellfacetraverser
12. odbrvertexedgetraverser
13. odbrvertexlooptraverser
we can use odbrfacelooptraverser traverser from which we can have a collection of faces, from which we can have a surface. by getting the surfacetype we can get the information of the surface. a surface may be any one of the following..
1. odgetorus,
2. odgeexternalboundedsurface,
3. odgeellipcylinder,
4.odgeplanarent,
5. odgecone,
6. odgecylinder,
7. odgeexternalsurface,
8. odgeellipcone,
9. odgeoffsetsurface,
10. odgenurbsurface, and
11. odgesphere
and if we are able to draw these surfaces...is it will be suffice to draw the brep. sir kindly let me know whether i am correct or not.
if not kindly write me a good approach..
kindly write to me..
with regards..
anirban talukdar
last edited by atalukdar; 23rd february 2006 at 04:04 amfff">.
i think, that using of odbrbrepfacetraverser, odbrfacelooptraverser, odbrloopedgetraverser will be optimal for brep drawing.
odbr classes return next odge surfaces :
1. odgetorus,
3. odgeellipcylinder,
5. odgecone,
6. odgecylinder,
8. odgeellipcone,
10. odgenurbsurface, and
11. odgesphere
** odgeplane
also odbr has getsurfaceasnurb method, it convert ge* surface to odgenurbsurface. it can be useful for opengl.
// and if we are able to draw these surfaces...is it will be suffice to draw the brep.
the situation - you need to draw cylinder. generally, it has two trimming loops - upper\lower circles. odgecylinder is just tube with center, radius, normal. it is unlimited in both directions. so it is not enough to draw only cylinder - you should trim it by upper\lower circles.
thanks
thank you sir, it seems i got the solution of the problem.
thank you again.
anirban