mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0032811: Bad result of sweep operation due to Surface Surface Intersect Bug
This commit is contained in:
@@ -217,7 +217,7 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
|
||||
if(Bsaux->LastParameter() < U2 ) u2 = Bsaux->LastParameter();
|
||||
// modified by NIZHNY-EAP Fri Dec 3 14:29:18 1999 ___END___
|
||||
}
|
||||
Standard_Real aSegmentTol = Precision::PConfusion();
|
||||
Standard_Real aSegmentTol = 2. * Precision::PConfusion();
|
||||
if (Abs(u2 - u1) < aSegmentTol)
|
||||
aSegmentTol = Abs(u2 - u1) * 0.01;
|
||||
Bsaux->Segment(u1, u2, aSegmentTol);
|
||||
|
@@ -85,6 +85,11 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1,
|
||||
Standard_Real TolTang = Tol;
|
||||
Standard_Real UVMaxStep = IntPatch_Intersection::DefineUVMaxStep(myHS1, dom1, myHS2, dom2);
|
||||
Standard_Real Deflection = 0.1;
|
||||
if (myHS1->GetType() == GeomAbs_BSplineSurface && myHS2->GetType() == GeomAbs_BSplineSurface)
|
||||
{
|
||||
Deflection /= 10.;
|
||||
}
|
||||
|
||||
|
||||
myIntersector.SetTolerances(TolArc,TolTang,UVMaxStep,Deflection);
|
||||
|
||||
|
@@ -29,12 +29,8 @@
|
||||
|
||||
#include <NCollection_Map.hxx>
|
||||
|
||||
static Standard_Boolean IsAdvRequired(IntPolyh_PMaillageAffinage& theMaillage);
|
||||
|
||||
static Standard_Integer ComputeIntersection(IntPolyh_PMaillageAffinage& theMaillage);
|
||||
|
||||
static Standard_Boolean AnalyzeIntersection(IntPolyh_PMaillageAffinage& theMaillage);
|
||||
|
||||
//=======================================================================
|
||||
//function : IntPolyh_Intersection
|
||||
//purpose :
|
||||
@@ -49,6 +45,7 @@ IntPolyh_Intersection::IntPolyh_Intersection(const Handle(Adaptor3d_Surface)& th
|
||||
myNbSU2 = 10;
|
||||
myNbSV2 = 10;
|
||||
myIsDone = Standard_False;
|
||||
myIsParallel = Standard_False;
|
||||
mySectionLines.Init(1000);
|
||||
myTangentZones.Init(10000);
|
||||
Perform();
|
||||
@@ -72,6 +69,7 @@ IntPolyh_Intersection::IntPolyh_Intersection(const Handle(Adaptor3d_Surface)& th
|
||||
myNbSU2 = theNbSU2;
|
||||
myNbSV2 = theNbSV2;
|
||||
myIsDone = Standard_False;
|
||||
myIsParallel = Standard_False;
|
||||
mySectionLines.Init(1000);
|
||||
myTangentZones.Init(10000);
|
||||
Perform();
|
||||
@@ -95,6 +93,7 @@ IntPolyh_Intersection::IntPolyh_Intersection(const Handle(Adaptor3d_Surface)& th
|
||||
myNbSU2 = theUPars2.Length();
|
||||
myNbSV2 = theVPars2.Length();
|
||||
myIsDone = Standard_False;
|
||||
myIsParallel = Standard_False;
|
||||
mySectionLines.Init(1000);
|
||||
myTangentZones.Init(10000);
|
||||
Perform(theUPars1, theVPars1, theUPars2, theVPars2);
|
||||
@@ -442,7 +441,7 @@ void IntPolyh_Intersection::MergeCouples(IntPolyh_ListOfCouples &anArrayFF,
|
||||
// too small (less than 5 deg), the advanced intersection is required.
|
||||
// Otherwise, the standard intersection is considered satisfactory.
|
||||
//=======================================================================
|
||||
Standard_Boolean IsAdvRequired(IntPolyh_PMaillageAffinage& theMaillage)
|
||||
Standard_Boolean IntPolyh_Intersection::IsAdvRequired(IntPolyh_PMaillageAffinage& theMaillage)
|
||||
{
|
||||
if (!theMaillage)
|
||||
return Standard_True;
|
||||
@@ -452,7 +451,7 @@ Standard_Boolean IsAdvRequired(IntPolyh_PMaillageAffinage& theMaillage)
|
||||
// Number of interfering pairs
|
||||
Standard_Integer aNbCouples = Couples.Extent();
|
||||
// Flag to define whether advanced intersection is required or not
|
||||
Standard_Boolean isAdvReq = (aNbCouples == 0);
|
||||
Standard_Boolean isAdvReq = (aNbCouples == 0) && !IsParallel();
|
||||
if (isAdvReq)
|
||||
// No interfering triangles are found -> perform advanced intersection
|
||||
return isAdvReq;
|
||||
@@ -507,7 +506,7 @@ Standard_Integer ComputeIntersection(IntPolyh_PMaillageAffinage& theMaillage)
|
||||
//function : AnalyzeIntersection
|
||||
//purpose : Analyzes the intersection on the number of interfering triangles
|
||||
//=======================================================================
|
||||
Standard_Boolean AnalyzeIntersection(IntPolyh_PMaillageAffinage& theMaillage)
|
||||
Standard_Boolean IntPolyh_Intersection::AnalyzeIntersection(IntPolyh_PMaillageAffinage& theMaillage)
|
||||
{
|
||||
if (!theMaillage)
|
||||
return Standard_False;
|
||||
@@ -528,7 +527,9 @@ Standard_Boolean AnalyzeIntersection(IntPolyh_PMaillageAffinage& theMaillage)
|
||||
if (npara >= theMaillage->GetArrayOfTriangles(1).NbItems() ||
|
||||
npara >= theMaillage->GetArrayOfTriangles(2).NbItems())
|
||||
{
|
||||
return Standard_False;
|
||||
Couples.Clear();
|
||||
myIsParallel = Standard_True;
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_True;
|
||||
|
@@ -83,6 +83,12 @@ public: //! @name Getting the results
|
||||
return myIsDone;
|
||||
}
|
||||
|
||||
//! Returns state of the operation
|
||||
Standard_Boolean IsParallel() const
|
||||
{
|
||||
return myIsParallel;
|
||||
}
|
||||
|
||||
//! Returns the number of section lines
|
||||
Standard_Integer NbSectionLines() const
|
||||
{
|
||||
@@ -186,6 +192,9 @@ private: //! @name Performing the intersection
|
||||
IntPolyh_ListOfCouples& theArrayRF,
|
||||
IntPolyh_ListOfCouples& theArrayRR) const;
|
||||
|
||||
Standard_Boolean AnalyzeIntersection(IntPolyh_PMaillageAffinage& theMaillage);
|
||||
Standard_Boolean IsAdvRequired(IntPolyh_PMaillageAffinage& theMaillage);
|
||||
|
||||
|
||||
private: //! @name Fields
|
||||
|
||||
@@ -200,6 +209,7 @@ private: //! @name Fields
|
||||
Standard_Boolean myIsDone; //!< State of the operation
|
||||
IntPolyh_ArrayOfSectionLines mySectionLines; //!< Section lines
|
||||
IntPolyh_ArrayOfTangentZones myTangentZones; //!< Tangent zones
|
||||
Standard_Boolean myIsParallel;
|
||||
};
|
||||
|
||||
#endif // _IntPolyh_Intersection_HeaderFile
|
||||
|
@@ -504,7 +504,11 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1,
|
||||
|
||||
{
|
||||
const Standard_Real UVMaxStep = IntPatch_Intersection::DefineUVMaxStep(myHS1, dom1, myHS2, dom2);
|
||||
const Standard_Real Deflection = 0.1;
|
||||
Standard_Real Deflection = 0.1;
|
||||
if (aType1 == GeomAbs_BSplineSurface && aType2 == GeomAbs_BSplineSurface)
|
||||
{
|
||||
Deflection /= 10.;
|
||||
}
|
||||
myIntersector.SetTolerances(TolArc, TolTang, UVMaxStep, Deflection);
|
||||
}
|
||||
|
||||
|
@@ -448,5 +448,5 @@ void IntTools_TopolTool::SamplePnts(const Standard_Real theDefl,
|
||||
myV0 = myVPars->Value(1);
|
||||
|
||||
myDU = (myUPars->Value(myNbSmplU) - myU0)/(myNbSmplU-1);
|
||||
myDV = (myVPars->Value(myNbSmplV) - myU0)/(myNbSmplV-1);
|
||||
myDV = (myVPars->Value(myNbSmplV) - myV0)/(myNbSmplV-1);
|
||||
}
|
||||
|
@@ -4183,6 +4183,77 @@ static Standard_Integer OCC32744(Draw_Interpretor& theDi, Standard_Integer theNb
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OCC24472
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer OCC24472(Draw_Interpretor& theDI,
|
||||
Standard_Integer theNArg,
|
||||
const char ** theArgVal)
|
||||
{
|
||||
// Checks whether theCurve has a loop / bend
|
||||
|
||||
if (theNArg < 2)
|
||||
{
|
||||
theDI << "Use: " << theArgVal[0] << " CheckLoops curve [CosMaxAngle [theNbPoints]]" << "/n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Handle(Geom_Curve) aCurve = DrawTrSurf::GetCurve(theArgVal[1]);
|
||||
|
||||
if(aCurve.IsNull())
|
||||
{
|
||||
theDI << " " << theArgVal[1] << " : NULL curve" << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_Real aCosMaxAngle = .8;
|
||||
Standard_Integer aNbPoints = 1000;
|
||||
|
||||
if (theNArg > 2)
|
||||
{
|
||||
aCosMaxAngle = Draw::Atof(theArgVal[2]);
|
||||
}
|
||||
|
||||
if (theNArg > 3)
|
||||
{
|
||||
aNbPoints = Draw::Atoi(theArgVal[3]);
|
||||
}
|
||||
|
||||
|
||||
Standard_Real U1 = aCurve->FirstParameter(), U2 = aCurve->LastParameter();
|
||||
if (Precision::IsInfinite(U1) || Precision::IsInfinite(U2))
|
||||
{
|
||||
theDI << "Infinite interval : " << U1 << " " << U2 << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Standard_Real delta = (U2 - U1) / aNbPoints;
|
||||
gp_Pnt aP;
|
||||
gp_Vec aDC1, aDC2;
|
||||
aCurve->D1(U1, aP, aDC1);
|
||||
gp_Dir aD1(aDC1);
|
||||
Standard_Real p;
|
||||
for (p = U1; p <= U2; p += delta)
|
||||
{
|
||||
aCurve->D1(p, aP, aDC2);
|
||||
gp_Dir aD2(aDC2);
|
||||
Standard_Real aCos = Abs(aD1*aD2);
|
||||
|
||||
if (aCos < aCosMaxAngle)
|
||||
{
|
||||
theDI << "Error: The curve " << theArgVal[1] << " is possible to have a bend at parameter " << p << ". Please check carefully \n";
|
||||
}
|
||||
|
||||
aD1 = aD2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void QABugs::Commands_20(Draw_Interpretor& theCommands) {
|
||||
const char *group = "QABugs";
|
||||
@@ -4275,5 +4346,10 @@ void QABugs::Commands_20(Draw_Interpretor& theCommands) {
|
||||
__FILE__,
|
||||
OCC32744, group);
|
||||
|
||||
theCommands.Add("OCC24472",
|
||||
"CheckLoops curve [CosMaxAngle [theNbPoints]]",
|
||||
__FILE__,
|
||||
OCC24472, group);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
#jmu
|
||||
#pro18457
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "PRO15946"
|
||||
puts "Fuse"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "============"
|
||||
puts "OCC12918"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "============"
|
||||
puts "OCC697"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "============"
|
||||
puts "OCC697"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "============"
|
||||
puts "OCC697"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "============"
|
||||
puts "OCC697"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "=========="
|
||||
puts "OCC22829"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "================"
|
||||
puts "OCC24003"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "================"
|
||||
puts "OCC25625"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "=========="
|
||||
puts "OCC24161"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "========"
|
||||
puts "OCC28283"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
puts "TODO OCC21134 ALL: Error: checkshape command does not return faulty shapes"
|
||||
|
||||
puts "============"
|
||||
|
@@ -3,7 +3,7 @@ puts "0025082: bopcommon returns different result on Windows and Linux system"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
restore [locate_data_file bug25054_shape1.brep] b1
|
||||
restore [locate_data_file bug25054_shape2.brep] b2
|
||||
|
@@ -3,7 +3,7 @@ puts "0025082: bopcommon returns different result on Windows and Linux system"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
restore [locate_data_file bug25054_shape1.brep] b1
|
||||
restore [locate_data_file bug25054_shape2.brep] b2
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "========"
|
||||
puts "OCC28150"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 All: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 All: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "========"
|
||||
puts "OCC29900: Invalid result of FUSE operation"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "============================================================================================="
|
||||
puts "0030559: BOP Fuse: result is inconsistent"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "========"
|
||||
puts "30760: Modeling Algorithms - Intersection fails in Occt 7.3.0"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
puts "=========================================="
|
||||
puts "0031890: Invalid result of common fuse BOP"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
puts "================"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
puts "================"
|
||||
|
@@ -6,8 +6,9 @@ puts ""
|
||||
## Wrong section curves
|
||||
###############################
|
||||
|
||||
puts "TODO OCC29501 ALL: Error in ii12_22"
|
||||
puts "TODO OCC29501 All: Error: The curve ii12_22 is possible"
|
||||
pload QAcommands
|
||||
##puts "TODO OCC29501 ALL: Error in ii12_22"
|
||||
##puts "TODO OCC29501 All: Error: The curve ii12_22 is possible"
|
||||
set MaxToler 1.5e-4
|
||||
|
||||
restore [locate_data_file bug24472_Pipe_1.brep] b1
|
||||
@@ -26,6 +27,9 @@ puts "First test"
|
||||
intersect ii12 s1 s2
|
||||
|
||||
foreach c [directory ii12*] {
|
||||
|
||||
puts "Curve $c"
|
||||
|
||||
bounds $c U1 U2
|
||||
|
||||
if {[dval U2-U1] < 1.0e-9} {
|
||||
@@ -33,7 +37,7 @@ foreach c [directory ii12*] {
|
||||
}
|
||||
|
||||
# cos(~75.5deg)
|
||||
CheckLoops $c 0.25
|
||||
OCC24472 $c 0.25
|
||||
|
||||
xdistcs $c s1 U1 U2 10 $MaxToler
|
||||
xdistcs $c s2 U1 U2 10 $MaxToler
|
||||
@@ -55,6 +59,9 @@ puts "Third test"
|
||||
intersect ii13 s1 s3
|
||||
|
||||
foreach c [directory ii13*] {
|
||||
|
||||
puts "Curve $c"
|
||||
|
||||
bounds $c U1 U2
|
||||
|
||||
if {[dval U2-U1] < 1.0e-9} {
|
||||
@@ -62,7 +69,7 @@ foreach c [directory ii13*] {
|
||||
}
|
||||
|
||||
# cos(~75.5deg)
|
||||
CheckLoops $c 0.25
|
||||
OCC24472 $c 0.25
|
||||
|
||||
xdistcs $c s1 U1 U2 10 $MaxToler
|
||||
xdistcs $c s2 U1 U2 10 $MaxToler
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
|
||||
puts "============"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
|
||||
puts "============"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
|
||||
puts "============"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
|
||||
puts "============"
|
||||
|
@@ -3,7 +3,7 @@ puts "0029329: Modeling Algorithms - Low performance of the General Fuse algorit
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
##puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
|
||||
|
||||
restore [locate_data_file bug29329_objects.brep] a
|
||||
restore [locate_data_file bug29329_tools.brep] b
|
||||
|
Reference in New Issue
Block a user