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 / Duplicates by MapShapesAndAncestors

Duplicates by MapShapesAndAncestors

Duplicates by MapShapesAndAncestors
Nikolai 2013/04/18 11:30
Hi guys.
Thanks for the super work

I am trying to access faces sharing a single vertex of a box. I get 6 faces. Same with edges.

For completeness, the vertex is the nearest in the box when I am getting distance between two boxes (see the pict). Everything works and faces are correct but they are each duplicated in the list. So the list has 6 of them. Is it a bug?

const TopoDS_Shape& shapeObjectThis= ...;
const TopoDS_Shape& shapeObjectOther = ..;

BRepExtrema_DistShapeShape extr( shapeObjectThis, shapeObjectOther);

BRepExtrema_SupportType typeSupp; = extr.SupportTypeShape2(0);

TopoDS_Shape shSupport = extr.SupportOnShape2(0);

if(typeSupp == BRepExtrema_IsVertex)
     TopoDS_Vertex tdsVtx = TopoDS::Vertex(shSupport);

     TopTools_IndexedDataMapOfShapeListOfShape mapIncidence;
     TopExp::MapShapesAndAncestors(shapeObject, TopAbs_VERTEX, TopAbs_FACE, mapIncidence);
     Standard_Integer iThis = mapIncidence.FindIndex(tdsVtx);          
     TopTools_ListOfShape& list = mapIncidence(iThis);
     Standard_Integer n = list.Extent();               //6 !

Thank You
You have to be logged in to download the attached file
Nikolai 2013/04/18 11:32
Correction: Indecies are actually 1:
BRepExtrema_SupportType typeSupp; = extr.SupportTypeShape2(1);
TopoDS_Shape shSupport = extr.SupportOnShape2(1);
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