Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Shape factory
Shape gallery
What's new
System requirements
Download Center
Public license
Getting started
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
Home / Developer Corner / Forums / Usage issues / Help with Neighbor faces and common edge

Help with Neighbor faces and common edge

Help with Neighbor faces and common edge
Game Milky 2013/04/03 12:23

Dear Forum supervisors and users,

I want to extract the neighbor faces and the common edges of my model (shape). I try to use TopExp::MapShapesAndAncestors(shape, TopAbs_EDGE, TopAbs_FACE, myMap); but not successful, I tried as follow:

TopTools_IndexedDataMapOfShapeListOfShape myMap;
      TopExp::MapShapesAndAncestors(shape, TopAbs_EDGE, TopAbs_FACE, myMap);
Standard_Integer aNbE=myMap.Extent();
      for(int j=1; j<=aNbE; j++)
            const TopoDS_Edge& aE=TopoDS::Edge(myMap.FindKey(j));
            const TopTools_ListOfShape& LF=myMap(j);
            Standard_Integer aNbF =LF.Extent();
            if (aNbF>=2)
            const TopoDS_Face& Face1 = TopoDS::Face(myMap.FindFromIndex(1).First());
            const TopoDS_Face& Face2 = TopoDS::Face(myMap.FindFromIndex(2).Last());
            Handle(Geom_Surface) surfaceA = BRep_Tool::Surface(Face1);
            Handle(Geom_Surface) surfaceB = BRep_Tool::Surface(Face2);

Have no compiling error but, doesn't give a correct result! Any error in using this class!

Any suggestion??

Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map