Wed, 09/24/2003 - 11:37

Forums:

Hi all!

can anybody give me a hint, how the orientation of an TopoDS_Edge is connected to the orientation of the underlying Geom_Curve?

i mean, no matter if the same edge is oriented forward or reversed, if i compute the underlying Curve with BRep_Tool::Curve, i get the same Geom_Curve, with the same parameters.

Thank you,

Robert

Wed, 09/24/2003 - 15:16

Hello Robert,

the TopoDS_Edge is related to the Topology (TopoDS_Face, TopoDS_Shell, ...) and the Geom_Curve is related to the underlying geometry of a topological object (TopoDS_Edge has a Geom_Curve, TopoDS_Face has a Geom_Surface,...). There is no orientation for Geom objects, but Topogolical objects need orientation for many differents purpose. I suggest you have a look at the documentation, the pdf file on Modeling Data User’ s Guide (modat50.pdf) and start reading at bullet 2.4.

Good Luck,

Francois.

Thu, 10/02/2003 - 14:59

hello francois,

thank you for your answer, but i am afraid i cannot benefit from it. i think i have explained well, what my problem is. i know in principle all the things described in the user guide, but i have the following problem:

we are working on integrating the occ kernel into our tetrahedral mesh generator NETGEN (http://www.hpfem.jku.at/netgen). for meshing the faces of a solid, i need to know if the face lies on the left or on the right of the underlying Geom_Curve of an edge bounding the face. i tried to use the TopAbs_Orientation i get from the edges, compounded it with the wire-orientation ... and so on, but i doesn't work properly all the time. So i want to know, how do i know if an edge is directed in the same direction as the underlying Geom_Curve?

any hints are welcome ...

thanks a lot

robert

-------------------------------------------------------

Dipl.-Ing. Robert Gaisbauer

Start-Project ''3D hp Finite Elements''

Institute for Computational Mathematics

Johannes Kepler University Linz

Altenberger Str. 69

A-4040 Linz, Austria/Europe

http://www.hpfem.jku.at

mailto:rg@jku.at

-------------------------------------------------------

Thu, 10/02/2003 - 16:25

Hello Robert,

I will try to explain what I've learn from developping a connector between OCC and Catia V5 (so we had to map the topology between Catia and OCC).

A TopoDS_Edge could have one 3D curve and several 2D curves, I say could have because it is optional, You only need one 3D curve or one 2D curve defined for a given TopoDS_Face. If you need those curves to be created, you could always use the package Shape Healing and force the create of those curves (2D, 3D or both).

So to have access to the orientation of a given edge for a face, you have to access that edge with the right class. Let me write a small example that might show you what I'm talking about.

// explore a shell compose of 2 faces that share one edge

TopoDS_Shell aShell=...;

TopoDS_Iterator faceIter(aShell);

for (;faceIter.More();faceIter.Next()) {

// take care only of the face

if (faceIter.Value().ShapeType()==TopAbs_FACE) {

// explore the wires of the face

TopoDS_Face aFace=TopoDS::Face(faceIter.Value());

cout << "Face Orientation:"<< (aFace.Orientation()==TopAbs_FORWARD ? "Forward" : "Reversed") <

Thu, 10/02/2003 - 18:59

hello francois!

thanks a lot for your fast and nice answer. i have found my mistake now with your help. i always thought i had to compound the orientations with the topoligical higher entities. this was completely wrong. i have seen in your program example, that you did not do that. so i tried the same, and now everything works out fine.

i can't imagine why i didn't try that on my own. ;)

so thanks again for your kind help

robert