mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0033298: Modeling Algorithm - Offset operation gives wrong result
Process only those images of the faces, if one if them has anInsideEdges/anInsideVertices and the other is not.
This commit is contained in:
parent
a011359b8a
commit
9f338a00a1
@ -5225,7 +5225,6 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
|
|||||||
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
|
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
|
||||||
if (!pEOrigins)
|
if (!pEOrigins)
|
||||||
{
|
{
|
||||||
theMEUseInRebuild.Add (aE);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5393,6 +5392,29 @@ void BRepOffset_BuildOffsetFaces::FindFacesToRebuild()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
//function : mapShapes
|
||||||
|
//purpose : Collect theVecShapes into theMap with setted theType
|
||||||
|
//=======================================================================
|
||||||
|
template<class Container>
|
||||||
|
static void mapShapes (const Container& theVecShapes,
|
||||||
|
const TopAbs_ShapeEnum theType,
|
||||||
|
TopTools_MapOfShape& theMap)
|
||||||
|
{
|
||||||
|
for (const auto& aShape : theVecShapes)
|
||||||
|
{
|
||||||
|
for (TopExp_Explorer anExp(aShape, theType); anExp.More(); anExp.Next())
|
||||||
|
{
|
||||||
|
theMap.Add(anExp.Current());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IntersectFaces
|
//function : IntersectFaces
|
||||||
//purpose : Intersection of the faces that should be rebuild to resolve all invalidities
|
//purpose : Intersection of the faces that should be rebuild to resolve all invalidities
|
||||||
@ -5715,7 +5737,10 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
TopoDS_Compound aCBE;
|
TopoDS_Compound aCBE;
|
||||||
aBB.MakeCompound (aCBE);
|
aBB.MakeCompound (aCBE);
|
||||||
//
|
//
|
||||||
TopExp_Explorer aExp (aCBInv, TopAbs_EDGE);
|
// remember inside edges and vertices to further check
|
||||||
|
TopTools_MapOfShape anInsideEdges;
|
||||||
|
TopTools_MapOfShape anInsideVertices;
|
||||||
|
TopExp_Explorer aExp(aCBInv, TopAbs_EDGE);
|
||||||
for (; aExp.More(); aExp.Next())
|
for (; aExp.More(); aExp.Next())
|
||||||
{
|
{
|
||||||
const TopoDS_Shape& aE = aExp.Current();
|
const TopoDS_Shape& aE = aExp.Current();
|
||||||
@ -5724,6 +5749,15 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
if (aMEFence.Add (aE))
|
if (aMEFence.Add (aE))
|
||||||
{
|
{
|
||||||
aBB.Add (aCBE, aE);
|
aBB.Add (aCBE, aE);
|
||||||
|
if (!myEdgesToAvoid.Contains(aE) && myInvalidEdges.Contains(aE))
|
||||||
|
{
|
||||||
|
anInsideEdges.Add(aE);
|
||||||
|
TopoDS_Iterator anIt(aE);
|
||||||
|
for (; anIt.More(); anIt.Next())
|
||||||
|
{
|
||||||
|
anInsideVertices.Add(anIt.Value());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5749,10 +5783,6 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
TopExp::MapShapes (aCBELoc, TopAbs_EDGE, aME);
|
TopExp::MapShapes (aCBELoc, TopAbs_EDGE, aME);
|
||||||
aMECV = aME;
|
aMECV = aME;
|
||||||
TopExp::MapShapes (aCBELoc, TopAbs_VERTEX, aME);
|
TopExp::MapShapes (aCBELoc, TopAbs_VERTEX, aME);
|
||||||
//
|
|
||||||
// Using the map <aME> find chain of faces to be intersected;
|
|
||||||
//
|
|
||||||
// faces for intersection
|
|
||||||
TopTools_IndexedMapOfShape aMFInt;
|
TopTools_IndexedMapOfShape aMFInt;
|
||||||
// additional faces for intersection
|
// additional faces for intersection
|
||||||
TopTools_IndexedMapOfShape aMFIntExt;
|
TopTools_IndexedMapOfShape aMFIntExt;
|
||||||
@ -5801,6 +5831,14 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
if (pMFInter && !pInterFi)
|
if (pMFInter && !pInterFi)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// create map of edges and vertices for aLFImi
|
||||||
|
TopTools_MapOfShape aMEVIm;
|
||||||
|
mapShapes(*aLFImi, TopAbs_EDGE, aMEVIm);
|
||||||
|
mapShapes(*aLFImi, TopAbs_VERTEX, aMEVIm);
|
||||||
|
|
||||||
|
Standard_Boolean isIContainsE = aMEVIm.HasIntersection(anInsideEdges);
|
||||||
|
Standard_Boolean isIContainsV = aMEVIm.HasIntersection(anInsideVertices);
|
||||||
|
|
||||||
for (j = i + 1; j <= aNb; ++j)
|
for (j = i + 1; j <= aNb; ++j)
|
||||||
{
|
{
|
||||||
const TopoDS_Face& aFj = TopoDS::Face (aMFInt (j));
|
const TopoDS_Face& aFj = TopoDS::Face (aMFInt (j));
|
||||||
@ -5820,6 +5858,28 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
if (!aLFEj)
|
if (!aLFEj)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// create map of edges and vertices for aLFImi
|
||||||
|
aMEVIm.Clear();
|
||||||
|
mapShapes(*aLFImj, TopAbs_EDGE, aMEVIm);
|
||||||
|
mapShapes(*aLFImj, TopAbs_VERTEX, aMEVIm);
|
||||||
|
// check images of both faces contain anInsideEdges and anInsideVertices
|
||||||
|
// not process if false and true
|
||||||
|
Standard_Boolean isJContainsE = aMEVIm.HasIntersection(anInsideEdges);
|
||||||
|
Standard_Boolean isJContainsV = aMEVIm.HasIntersection(anInsideVertices);
|
||||||
|
|
||||||
|
// Check if one face is connected to inside edge then
|
||||||
|
// the other must be also connected
|
||||||
|
if ((isIContainsE && !isJContainsV) ||
|
||||||
|
(isJContainsE && !isIContainsV))
|
||||||
|
{
|
||||||
|
TopTools_ListOfShape aLVC;
|
||||||
|
// it is necessary to process the images if they already have
|
||||||
|
// common vertices
|
||||||
|
FindCommonParts(*aLFImi, *aLFImj, aLVC, TopAbs_VERTEX);
|
||||||
|
|
||||||
|
if (aLVC.IsEmpty())
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// if there are some common edges between faces
|
// if there are some common edges between faces
|
||||||
// we should use these edges and do not intersect again.
|
// we should use these edges and do not intersect again.
|
||||||
|
8
tests/offset/shape_type_i_c/WA1
Normal file
8
tests/offset/shape_type_i_c/WA1
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
restore [locate_data_file bug33298.brep] s
|
||||||
|
|
||||||
|
OFFSETSHAPE 35 {} $calcul $type
|
||||||
|
|
||||||
|
checkprops result -v 1.20105e+08
|
||||||
|
|
||||||
|
checknbshapes result -shell 1
|
||||||
|
|
8
tests/offset/shape_type_i_c/WA2
Normal file
8
tests/offset/shape_type_i_c/WA2
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
restore [locate_data_file bug33298_trimmed.brep] s
|
||||||
|
|
||||||
|
OFFSETSHAPE 35 {} $calcul $type
|
||||||
|
|
||||||
|
checkprops result -v 7.3756e+07
|
||||||
|
|
||||||
|
checknbshapes result -shell 1
|
||||||
|
|
@ -1,8 +1,7 @@
|
|||||||
puts "TODO CR27414 ALL: Error: number of wire entities in the result"
|
puts "TODO CR27414 ALL: Error: number of wire entities in the result"
|
||||||
puts "TODO CR27414 ALL: Error: number of face entities in the result"
|
puts "TODO CR27414 ALL: Error: number of face entities in the result"
|
||||||
puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
|
|
||||||
puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
|
puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
|
||||||
puts "TODO CR27414 ALL: Operations with following offset values have failed: 9 10"
|
puts "TODO CR27414 ALL: Operations with following offset values have failed: 10"
|
||||||
|
|
||||||
puts "============================================================================================="
|
puts "============================================================================================="
|
||||||
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
|
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user