From 598f4391a80728bb4748744278dc8274cc49576f Mon Sep 17 00:00:00 2001 From: gka Date: Thu, 10 Sep 2015 17:11:05 +0300 Subject: [PATCH] 0026644: ShapeUpgrade_UnifySameDomain - strange behavior Made modification to get valid shape after operation ShapeUpgrade_UnifySameDomain for non-manifold input shape Test case for issue CR26644 --- .../ShapeUpgrade_UnifySameDomain.cxx | 14 ++---- tests/bugs/heal/bug26644 | 46 +++++++++++++++++++ 2 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 tests/bugs/heal/bug26644 diff --git a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx index 60ef5a3f01..346bf432d4 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx @@ -1072,23 +1072,17 @@ static void putIntWires(TopoDS_Shape& theFace, TopTools_SequenceOfShape& theWire void ShapeUpgrade_UnifySameDomain::UnifyFaces() { - //Handle(ShapeBuild_ReShape) myContext = new ShapeBuild_ReShape; - TopoDS_Shape aResShape = myContext->Apply(myShape); - + // creating map of edge faces + TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces; + TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces); // processing each shell TopExp_Explorer exps; for (exps.Init(myShape, TopAbs_SHELL); exps.More(); exps.Next()) { TopoDS_Shell aShell = TopoDS::Shell(exps.Current()); - - // creating map of edge faces - TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces; - TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces); - + // map of processed shapes TopTools_MapOfShape aProcessed; - //Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape; - Standard_Integer NbModif = 0; Standard_Boolean hasFailed = Standard_False; Standard_Real tol = Precision::Confusion(); diff --git a/tests/bugs/heal/bug26644 b/tests/bugs/heal/bug26644 new file mode 100644 index 0000000000..bd6400f26b --- /dev/null +++ b/tests/bugs/heal/bug26644 @@ -0,0 +1,46 @@ +puts "========" +puts "OCC26644" +puts "========" +puts "" +####################################################################### +# ShapeUpgrade_UnifySameDomain - strange behavior +####################################################################### + +restore [locate_data_file bug26644_input.brep] a + +# 1 +checkarea a 158.466 1e-1 0.01 + +nbshapes a -t + +vinit +vsetdispmode 1 +vclear +vdisplay a +vfit +vdump ${imagedir}/${casename}_1.png + +# 2 +unifysamedom r a +f +e -b + +checkshape r f + +checkarea a 158.466 1e-1 0.01 + +set nbshapes_expected " +Number of shapes in shape + VERTEX : 32 + EDGE : 50 + WIRE : 23 + FACE : 23 + SHELL : 3 + SOLID : 3 + COMPSOLID : 0 + COMPOUND : 1 + SHAPE : 135 +" +checknbshapes r -ref ${nbshapes_expected} -t -m "Shape Upgrade" + +vclear +vdisplay r +vdump ${imagedir}/${casename}_2.png -- 2.39.5