1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Compare commits

...

1 Commits

Author SHA1 Message Date
emv
fcfc4713a6 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.
2019-06-24 12:16:12 +03:00
7 changed files with 121 additions and 11 deletions

View File

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

View File

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