1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030794: BRepOffsetAPI_MakePipeShell: shape is produced with artifacts

BRepFill_TrimShellCorner::MakeFacesSec() - When replacing a bound edge with a section wire make sure that edges in a wire are oriented correctly.
Test cases for the issue.
This commit is contained in:
emv
2019-06-24 11:41:30 +03:00
parent 4151c94d20
commit fcfc4713a6
7 changed files with 121 additions and 11 deletions

View File

@@ -17,6 +17,7 @@
#include <BOPAlgo_BOP.hxx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPDS_DS.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAlgoAPI_Section.hxx>
@@ -175,6 +176,7 @@ static void RemoveEdges(const TopoDS_Compound& theSourceComp,
static Standard_Boolean FilterSectionEdges(const BOPDS_VectorOfCurve& theBCurves,
const TopoDS_Face& theSecPlane,
const BOPDS_PDS& theDS,
const Handle (IntTools_Context)& theContext,
TopoDS_Compound& theResult);
static Standard_Boolean GetUEdges(const Standard_Integer theIndex,
@@ -345,7 +347,7 @@ void BRepFill_TrimShellCorner::Perform()
}
}
else {
if(!MakeFacesSec(ii, theDS, anIndex1, anIndex2, i)) {
if(!MakeFacesSec(ii, theDS, aPF.Context(), anIndex1, anIndex2, i)) {
myHistMap.Clear();
return;
}
@@ -658,6 +660,7 @@ BRepFill_TrimShellCorner::MakeFacesNonSec(const Standard_Integer
Standard_Boolean
BRepFill_TrimShellCorner::MakeFacesSec(const Standard_Integer theIndex,
const BOPDS_PDS& theDS,
const Handle (IntTools_Context)& theContext,
const Standard_Integer theFaceIndex1,
const Standard_Integer theFaceIndex2,
const Standard_Integer theSSInterfIndex)
@@ -669,7 +672,7 @@ BRepFill_TrimShellCorner::MakeFacesSec(const Standard_Integer
TopoDS_Compound aSecEdges;
TopoDS_Face aSecPlane;
if(!FilterSectionEdges(aBCurves, aSecPlane, theDS, aSecEdges))
if(!FilterSectionEdges(aBCurves, aSecPlane, theDS, theContext, aSecEdges))
return Standard_False;
//Extract vertices on the intersection of correspondent U-edges
@@ -787,11 +790,18 @@ BRepFill_TrimShellCorner::MakeFacesSec(const Standard_Integer
aBB.MakeWire(aW);
TopTools_ListIteratorOfListOfShape aEIt(aListOfWireEdges);
for(; aEIt.More(); aEIt.Next()) {
if(!aBoundEdge.IsSame(aEIt.Value()))
aBB.Add(aW, aEIt.Value());
TopoDS_Edge aFBE = TopoDS::Edge (aBoundEdge.Oriented (TopAbs_FORWARD));
for (; aEIt.More(); aEIt.Next())
{
if (!aBoundEdge.IsSame(aEIt.Value()))
{
TopoDS_Edge aSplit = TopoDS::Edge (aEIt.Value());
if (BOPTools_AlgoTools::IsSplitToReverse (aSplit, aFBE, theContext))
aSplit.Reverse();
aBB.Add (aW, aSplit);
}
}
aSubstitutor->Replace(aBoundEdge.Oriented(TopAbs_FORWARD), aW);
aSubstitutor->Replace (aFBE, aW);
}
aSubstitutor->Apply(aFace);
@@ -2154,6 +2164,7 @@ void RemoveEdges(const TopoDS_Compound& theSourceComp,
Standard_Boolean FilterSectionEdges(const BOPDS_VectorOfCurve& theBCurves,
const TopoDS_Face& theSecPlane,
const BOPDS_PDS& theDS,
const Handle (IntTools_Context)& theContext,
TopoDS_Compound& theResult) {
theResult.Nullify();
@@ -2181,10 +2192,7 @@ Standard_Boolean FilterSectionEdges(const BOPDS_VectorOfCurve& theBCurves,
Standard_Real f = 0., l = 0.;
BRep_Tool::Range(anEdge, f, l);
anIntersector.SetBeanParameters(f, l);
//
Handle(IntTools_Context) aContext = new IntTools_Context;
anIntersector.SetContext(aContext);
//
anIntersector.SetContext(theContext);
anIntersector.Perform();
if(anIntersector.IsDone()) {

View File

@@ -35,7 +35,7 @@ class gp_Ax2;
class TopoDS_Face;
class TopoDS_Wire;
class TopoDS_Shape;
class IntTools_Context;
//! Trims sets of faces in the corner to make proper parts of pipe
class BRepFill_TrimShellCorner
@@ -80,6 +80,7 @@ private:
Standard_Boolean MakeFacesSec(const Standard_Integer theIndex,
const BOPDS_PDS& theDS,
const Handle (IntTools_Context)& theContext,
const Standard_Integer theFaceIndex1,
const Standard_Integer theFaceIndex2,
const Standard_Integer theSSInterfIndex);

View File

@@ -0,0 +1,19 @@
puts "========"
puts "0030794: BRepOffsetAPI_MakePipeShell: shape is produced with artifacts"
puts "========"
puts ""
restore [locate_data_file bug30794_shapes1.brep] c
explode c
unifysamedom spine c_1
mksweep spine
addsweep c_2
buildsweep result -C -S
checkshape result
checkprops result -s 1.24302e+06 -v 5.64101e+06
checknbshapes result -wire 14 -face 14 -shell 1 -solid 1 -t
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,23 @@
puts "TODO OCC30794 ALL: Faulty shapes in variables"
puts "TODO OCC30794 ALL: Error : The area of result shape is"
puts "TODO OCC30794 ALL: Error : The volume of result shape is"
puts "TODO OCC30794 ALL: Error : is WRONG because number of"
puts "========"
puts "0030794: BRepOffsetAPI_MakePipeShell: shape is produced with artifacts"
puts "========"
puts ""
restore [locate_data_file bug30794_shapes1.brep] c
explode c
mksweep c_1
addsweep c_2
buildsweep result -C -S
checkshape result
checkprops result -s 1.24302e+06 -v 5.64101e+06
checknbshapes result -wire 14 -face 14 -shell 1 -solid 1 -t
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,19 @@
puts "========"
puts "0030794: BRepOffsetAPI_MakePipeShell: shape is produced with artifacts"
puts "========"
puts ""
restore [locate_data_file bug30794_shapes2.brep] c
explode c
unifysamedom spine c_1
mksweep spine
addsweep c_2
buildsweep result -C -S
checkshape result
checkprops result -s 883273 -v 1.09918e+07
checknbshapes result -wire 6 -face 6 -shell 1 -solid 1 -t
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,22 @@
puts "TODO OCC30794 ALL: Faulty shapes in variables"
puts "TODO OCC30794 ALL: Error : The volume of result shape is"
puts "TODO OCC30794 ALL: Error : is WRONG because number of"
puts "========"
puts "0030794: BRepOffsetAPI_MakePipeShell: shape is produced with artifacts"
puts "========"
puts ""
restore [locate_data_file bug30794_shapes2.brep] c
explode c
mksweep c_1
addsweep c_2
buildsweep result -C -S
checkshape result
checkprops result -s 883273 -v 1.09918e+07
checknbshapes result -wire 6 -face 6 -shell 1 -solid 1 -t
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,18 @@
puts "========"
puts "0030794: BRepOffsetAPI_MakePipeShell: shape is produced with artifacts"
puts "========"
puts ""
binrestore [locate_data_file bug30794_shapes.bin] c
explode c
mksweep c_1
addsweep c_2
buildsweep result -C -S
checkshape result
checkprops result -s 1.44508e+06 -v 1.78664e+07
checknbshapes result -wire 7 -face 7 -shell 1 -solid 1 -t
checkview -display result -2d -path ${imagedir}/${test_image}.png