mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +03:00
0030497: [REGRESSION] Mesh - wrong Poly_Polygon3D within local selection of located shape
The previous code has a condition to avoid processing the same faces if the face has a location. The similar condition should be applied during the edges processing. If not doing this, in the previous imlementation, IMeshData_Edge instances are created for all edges(even located), but edges of faces located are not filled with curves. As a result we had wrong local selection of edges. (cherry picked from commit 9e00d610b88e4f1778a5a55fe9c50d2665169d28)
This commit is contained in:
@@ -50,14 +50,11 @@ IMeshTools_ShapeExplorer::~IMeshTools_ShapeExplorer ()
|
|||||||
void IMeshTools_ShapeExplorer::Accept (
|
void IMeshTools_ShapeExplorer::Accept (
|
||||||
const Handle (IMeshTools_ShapeVisitor)& theVisitor)
|
const Handle (IMeshTools_ShapeVisitor)& theVisitor)
|
||||||
{
|
{
|
||||||
// Explore all edges in shape - either free or related to some face.
|
// Explore all free edges in shape.
|
||||||
TopTools_IndexedMapOfShape aEdges;
|
TopExp_Explorer aFreeEdgesIt (GetShape (), TopAbs_EDGE, TopAbs_FACE);
|
||||||
TopExp::MapShapes (GetShape (), TopAbs_EDGE, aEdges);
|
for (; aFreeEdgesIt.More(); aFreeEdgesIt.Next())
|
||||||
|
|
||||||
TopTools_IndexedMapOfShape::Iterator aEdgeIt (aEdges);
|
|
||||||
for (; aEdgeIt.More (); aEdgeIt.Next ())
|
|
||||||
{
|
{
|
||||||
const TopoDS_Edge& aEdge = TopoDS::Edge (aEdgeIt.Value ());
|
const TopoDS_Edge& aEdge = TopoDS::Edge (aFreeEdgesIt.Current());
|
||||||
if (!BRep_Tool::IsGeometric(aEdge))
|
if (!BRep_Tool::IsGeometric(aEdge))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -66,12 +63,11 @@ void IMeshTools_ShapeExplorer::Accept (
|
|||||||
theVisitor->Visit (aEdge);
|
theVisitor->Visit (aEdge);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Explore faces
|
// Explore all related to some face edges in shape.
|
||||||
TopTools_ListOfShape aFaceList;
|
TopTools_ListOfShape aFaceList;
|
||||||
BRepLib::ReverseSortFaces (GetShape (), aFaceList);
|
BRepLib::ReverseSortFaces (GetShape (), aFaceList);
|
||||||
TopTools_MapOfShape aFaceMap;
|
TopTools_MapOfShape aFaceMap;
|
||||||
|
|
||||||
// make array of faces suitable for processing (excluding faces without surface)
|
|
||||||
TopLoc_Location aDummyLoc;
|
TopLoc_Location aDummyLoc;
|
||||||
const TopLoc_Location aEmptyLoc;
|
const TopLoc_Location aEmptyLoc;
|
||||||
TopTools_ListIteratorOfListOfShape aFaceIter (aFaceList);
|
TopTools_ListIteratorOfListOfShape aFaceIter (aFaceList);
|
||||||
@@ -91,6 +87,40 @@ void IMeshTools_ShapeExplorer::Accept (
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TopExp_Explorer anEdgesExp (aFace, TopAbs_EDGE);
|
||||||
|
for (; anEdgesExp.More(); anEdgesExp.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge& aEdge = TopoDS::Edge (anEdgesExp.Current());
|
||||||
|
if (!BRep_Tool::IsGeometric(aEdge))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
theVisitor->Visit (aEdge);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Explore faces
|
||||||
|
aFaceMap.Clear();
|
||||||
|
|
||||||
|
// make array of faces suitable for processing (excluding faces without surface)
|
||||||
|
aFaceIter.Init (aFaceList);
|
||||||
|
for (; aFaceIter.More (); aFaceIter.Next ())
|
||||||
|
{
|
||||||
|
TopoDS_Shape aFaceNoLoc = aFaceIter.Value ();
|
||||||
|
aFaceNoLoc.Location (aEmptyLoc);
|
||||||
|
if (!aFaceMap.Add(aFaceNoLoc))
|
||||||
|
{
|
||||||
|
continue; // already processed
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Face aFace = TopoDS::Face (aFaceIter.Value ());
|
||||||
|
const Handle (Geom_Surface)& aSurf = BRep_Tool::Surface (aFace, aDummyLoc);
|
||||||
|
if (aSurf.IsNull())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Store only forward faces in order to prevent inverse issue.
|
// Store only forward faces in order to prevent inverse issue.
|
||||||
theVisitor->Visit (TopoDS::Face (aFace.Oriented (TopAbs_FORWARD)));
|
theVisitor->Visit (TopoDS::Face (aFace.Oriented (TopAbs_FORWARD)));
|
||||||
}
|
}
|
||||||
|
18
tests/bugs/moddata_3/bug30497
Normal file
18
tests/bugs/moddata_3/bug30497
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
puts "======="
|
||||||
|
puts "0030497"
|
||||||
|
puts "======="
|
||||||
|
puts ""
|
||||||
|
##################################################
|
||||||
|
# [REGRESSION] Mesh - wrong Poly_Polygon3D within local selection of located shape
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
pload XDE VISUALIZATION
|
||||||
|
testreadstep as1-oc-214-mat.stp s
|
||||||
|
|
||||||
|
vclear
|
||||||
|
vinit View1
|
||||||
|
vaxo
|
||||||
|
vdisplay s -dispmode 1
|
||||||
|
vfit
|
||||||
|
vselmode 2 1
|
||||||
|
vmoveto 150 201
|
Reference in New Issue
Block a user