GeomInt/GeomInt_IntSS.cxx, IntTools/IntTools_FaceFace.cxx - setting deflection 0.01
for case of two bspline surfaces
IntPolyh/IntPolyh_Intersection.cxx, IntPolyh/IntPolyh_Intersection.hxx - status IsParallel is added
BndLib/BndLib_Add3dCurve.cxx, IntTools/IntTools_TopolTool.cxx - fix small bugs
Correction of test scripts according to current behavior of algorithms
lowalgos/intss/bug32849 - test case added
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 : QACheckBends
+//purpose :
+//Checks whether the Curve has a loop/bend
+//Use: QACheckBends curve [CosMaxAngle [NbPoints]]
+//NbPoints sets the interval of discretization;
+//CosMaxAngle sets the maximal rotation angle between two adjacent segments.
+//This value must be equal to the cosine of this angle.
+//=======================================================================
+static Standard_Integer QACheckBends(Draw_Interpretor& theDI,
+ Standard_Integer theNArg,
+ const char ** theArgVal)
+{
+ // Checks whether theCurve has a loop / bend
+
+ if (theNArg < 2)
+ {
+ theDI << "Use: " << theArgVal[0] << " QACheckBends 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 = 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("QACheckBends",
+ "QACheckBends curve [CosMaxAngle [theNbPoints]]",
+ __FILE__,
+ QACheckBends, group);
+
return;
}
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
#jmu
#pro18457
#cascade 2.1
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "PRO15946"
puts "Fuse"
puts ""
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "============"
puts "OCC12918"
puts "============"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "============"
puts "OCC697"
puts "============"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "============"
puts "OCC697"
puts "============"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "============"
puts "OCC697"
puts "============"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "============"
puts "OCC697"
puts "============"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "=========="
puts "OCC22829"
puts "=========="
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "================"
puts "OCC24003"
puts "================"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "================"
puts "OCC25625"
puts "================"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "=========="
puts "OCC24161"
puts "=========="
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "========"
puts "OCC28283"
puts "========"
-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"
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"
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 "========"
puts "OCC28150"
puts "========"
-puts "TODO CR29596 All: Intersection of pair of shapes has failed"
-
puts "========"
puts "OCC29900: Invalid result of FUSE operation"
puts "========"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "============================================================================================="
puts "0030559: BOP Fuse: result is inconsistent"
puts "============================================================================================="
-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 "========"
-puts "TODO CR29596 ALL: Warning: Intersection of pair of shapes has failed"
-
puts "=========================================="
puts "0031890: Invalid result of common fuse BOP"
puts "=========================================="
-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 OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "================"
-# Checks whether theCurve has a loop/bend
-# Use: CheckLoops curve CosMaxAngle [theNbPoints]}
-# theNbPoints sets the interval of discretization;
-# theCosMaxAngle sets the maximal rotation angle between two adjacent segments. This value must be equal to the cosine of this angle.
-
-help CheckLoops {curve CosMaxAngle theNbPoints }
-proc CheckLoops {theCurve {theCosMaxAngle 0.8} {theNbPoints 1000.0}} {
- upvar #0 $theCurve aCurve
- bounds aCurve U1 U2
-
- set delta [dval (U2-U1)/$theNbPoints]
- cvalue aCurve [dval U1] xp yp zp dx1 dy1 dz1
-
- for {set p [dval U1]} {$p <= [dval U2]} {set p [expr $p + $delta]} {
- cvalue aCurve $p xp yp zp dx2 dy2 dz2
-
- #Check if the angle between the vectors {dx1 dy1 dz1} and {dx2 dy2 dz2} is less than 30deg.
- set nv1 [ dval dx1*dx1+dy1*dy1+dz1*dz1 ]
- set nv2 [ dval dx2*dx2+dy2*dy2+dz2*dz2 ]
- set dp [ dval dx1*dx2+dy2*dy2+dz1*dz2 ]
-
- if {$dp < [ expr $theCosMaxAngle * sqrt($nv1 * $nv2) ] } {
- puts "Error: The curve $theCurve is possible to have a bend at parameter $p. Please check carefully"
- }
-
- dset dx1 dx2
- dset dy1 dy2
- dset dz1 dz2
- }
-}
# General check of the result of geometrical intersection
help CheckIntersectionResult { surf1 surf2 ListOfCurves NbPoints TolerS1 TolerS2 }
## Wrong section curves
###############################
-puts "TODO OCC29501 ALL: Error in ii12_22"
-puts "TODO OCC29501 All: Error: The curve ii12_22 is possible"
+puts "TODO OCC29501 All: Error: The curve ii13_20 is possible"
+puts "TODO OCC29501 All: Error: The curve ii13_48 is possible"
+
+pload QAcommands
+
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
+ QACheckBends $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
+ QACheckBends $c 0.25
xdistcs $c s1 U1 U2 10 $MaxToler
xdistcs $c s2 U1 U2 10 $MaxToler
puts "========"
puts ""
+pload QAcommands
puts "TODO OCC25952 ALL: Error: The curve c_1 is possible to have a bend at"
restore [locate_data_file bug25952_shape.brep] q
puts "Error: Please check NbCurves for intersector"
} else {
checklength c_1 -l 0.00068663591416249451
- CheckLoops c_1
+ QACheckBends c_1
}
smallview
puts "0025952: Wrong intersection curve"
puts "========"
puts ""
-
+pload QAcommands
puts "TODO OCC25952 ALL: Error: The curve res_1 is possible to have a bend at parameter"
set aGoodNbCurves 1
set AllowRepeat 0
} else {
lappend CurvesList res_$ic
- CheckLoops res_$ic
+ QACheckBends res_$ic
incr ic
}
}
puts "========"
puts ""
+pload QAcommands
puts "TODO OCC26510 ALL: Error: 1 curve is expected but 0 ones are found"
set aGoodNbCurves 1
set AllowRepeat 0
} else {
lappend CurvesList res_$ic
- CheckLoops res_$ic
+ QACheckBends res_$ic
incr ic
}
}
puts "========"
puts ""
+pload QAcommands
+
foreach a [directory c*] {unset $a}
restore [locate_data_file bug28491_H0.brep] h0
continue
}
- CheckLoops c_$ic 0.86602540378443864676372317075294
+ QACheckBends c_$ic 0.86602540378443864676372317075294
}
smallview
puts "========"
puts ""
+pload QAcommands
+
restore [locate_data_file bug32607.brep] s
explode s
puts "Error: Please check NbCurves for intersector"
} else {
checklength c_1 -l 14.469397997508448
- CheckLoops c_1
+ QACheckBends c_1
}
smallview
--- /dev/null
+puts "========"
+puts "0032849: Modeling Algorithms - Intersection algorithm returns incomplete result"
+puts "========"
+puts ""
+
+restore [locate_data_file bug32849_s1] s1
+restore [locate_data_file bug32849_s2] s2
+
+mkface f1 s1;
+mkface f2 s2;
+
+set log [bopcurves f1 f2 -2d]
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} $log full Toler NbCurv
+
+if {$NbCurv != 2} {
+ puts "Error: Number of curves is wrong"
+}
+
+if { $Toler > 1.0e-8} {
+ puts "Error: Big tolerance value"
+}
+
+
+
+
+
+
+
+
-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 OCC11111 ALL: Error : is WRONG because number of "
puts "============"
-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 OCC11111 ALL: Error : is WRONG because number of "
puts "============"
puts "========"
puts ""
-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