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);
Handle(Adaptor3d_TopolTool) dom1 = new Adaptor3d_TopolTool(myHS1);
Handle(Adaptor3d_TopolTool) dom2 = new Adaptor3d_TopolTool(myHS2);
myLConstruct.Load(dom1,dom2,myHS1,myHS2);
-
+
Standard_Real TolArc = Tol;
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);
#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 :
myNbSU2 = 10;
myNbSV2 = 10;
myIsDone = Standard_False;
+ myIsParallel = Standard_False;
mySectionLines.Init(1000);
myTangentZones.Init(10000);
Perform();
myNbSU2 = theNbSU2;
myNbSV2 = theNbSV2;
myIsDone = Standard_False;
+ myIsParallel = Standard_False;
mySectionLines.Init(1000);
myTangentZones.Init(10000);
Perform();
myNbSU2 = theUPars2.Length();
myNbSV2 = theVPars2.Length();
myIsDone = Standard_False;
+ myIsParallel = Standard_False;
mySectionLines.Init(1000);
myTangentZones.Init(10000);
Perform(theUPars1, theVPars1, theUPars2, theVPars2);
// 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;
// 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;
//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;
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;
return myIsDone;
}
+ //! Returns state of the operation
+ Standard_Boolean IsParallel() const
+ {
+ return myIsParallel;
+ }
+
//! Returns the number of section lines
Standard_Integer NbSectionLines() const
{
IntPolyh_ListOfCouples& theArrayRF,
IntPolyh_ListOfCouples& theArrayRR) const;
+ Standard_Boolean AnalyzeIntersection(IntPolyh_PMaillageAffinage& theMaillage);
+ Standard_Boolean IsAdvRequired(IntPolyh_PMaillageAffinage& theMaillage);
+
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
{
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);
}
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);
}
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";
__FILE__,
OCC32744, group);
+ theCommands.Add("OCC24472",
+ "CheckLoops curve [CosMaxAngle [theNbPoints]]",
+ __FILE__,
+ OCC24472, group);
+
return;
}
-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
-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"
-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"
-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"
-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"
-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"
-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"
-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"
-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"
-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"
-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"
-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"
-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 "============"
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
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
-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"
-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"
-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"
-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"
-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"
-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 "================"
-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 "================"
## 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
intersect ii12 s1 s2
foreach c [directory ii12*] {
+
+ puts "Curve $c"
+
bounds $c U1 U2
if {[dval U2-U1] < 1.0e-9} {
}
# 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
intersect ii13 s1 s3
foreach c [directory ii13*] {
+
+ puts "Curve $c"
+
bounds $c U1 U2
if {[dval U2-U1] < 1.0e-9} {
}
# 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
-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 "============"
-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 "============"
-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 "============"
-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 "============"
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