Test cases for the issue have been created.
# 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 {theNbPoints 1000.0}} {
+proc CheckLoops {theCurve {theCosMaxAngle 0.8} {theNbPoints 1000.0}} {
upvar #0 $theCurve aCurve
bounds aCurve U1 U2
set dp [ dval dx1*dx2+dy2*dy2+dz1*dz2 ]
if {$dp < [ expr $theCosMaxAngle * sqrt($nv1 * $nv2) ] } {
- puts "Error: The curve aCurve is possible to have a bend at parameter $p. Please check carefully"
+ puts "Error: The curve $theCurve is possible to have a bend at parameter $p. Please check carefully"
}
dset dx1 dx2
--- /dev/null
+puts "========"
+puts "0025952: Wrong intersection curve"
+puts "========"
+puts ""
+
+puts "TODO OCC25952 ALL: Error: The curve c_1 is possible to have a bend at"
+
+restore [locate_data_file bug25952_shape.brep] q
+explode q
+copy q_1 b1
+copy q_2 b2
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1 b2 -2d] full Toler NbCurv
+
+checkreal Tolerance $Toler 1.0e-7 1.0e-7 0.0
+if {$NbCurv != 1} {
+ puts "Error: Please check NbCurves for intersector"
+} else {
+ checklength c_1 -l 0.00068663591416249451
+ CheckLoops c_1
+}
+
+smallview
+don c_*
+fit
+disp b1 b2
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0025952: Wrong intersection curve"
+puts "========"
+puts ""
+
+puts "TODO OCC25952 ALL: Error: The curve res_1 is possible to have a bend at parameter"
+
+set aGoodNbCurves 1
+
+restore [locate_data_file bug25952_shape.brep] q
+explode q
+copy q_1 b1
+copy q_2 b2
+
+mksurface s1 b1
+mksurface s2 b2
+
+trimv s2t s2 0.24999939999991502 1
+
+intersect res s1 s2t
+
+set che [whatis res]
+set ind [string first "3d curve" $che]
+if {${ind} >= 0} {
+ #Only variable "res" exists
+ renamevar res res_1
+}
+
+set ic 1
+set AllowRepeat 1
+while { $AllowRepeat != 0 } {
+ set che [whatis res_$ic]
+ set ind [string first "3d curve" $che]
+ if {${ind} < 0} {
+ set AllowRepeat 0
+ } else {
+ lappend CurvesList res_$ic
+ CheckLoops res_$ic
+ incr ic
+ }
+}
+
+set ic [expr $ic - 1]
+
+if { $ic != $aGoodNbCurves } {
+ puts "Error: $aGoodNbCurves curves is expected but $ic ones are found"
+} else {
+ CheckIntersectionResult s1 s2 $CurvesList 100 2.0e-7 2.0e-7
+}
+
+
+smallview
+don res_*
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0025952: Wrong intersection curve"
+puts "========"
+puts ""
+
+puts "TODO OCC26510 ALL: Error: 1 curve is expected but 0 ones are found"
+
+set aGoodNbCurves 1
+
+restore [locate_data_file bug25952_shape.brep] q
+explode q
+copy q_1 b1
+copy q_2 b2
+
+mksurface s1 b1
+mksurface s2 b2
+
+intersect res s1 s2
+
+set che [whatis res]
+set ind [string first "3d curve" $che]
+if {${ind} >= 0} {
+ #Only variable "res" exists
+ renamevar res res_1
+}
+
+set ic 1
+set AllowRepeat 1
+while { $AllowRepeat != 0 } {
+ set che [whatis res_$ic]
+ set ind [string first "3d curve" $che]
+ if {${ind} < 0} {
+ set AllowRepeat 0
+ } else {
+ lappend CurvesList res_$ic
+ CheckLoops res_$ic
+ incr ic
+ }
+}
+
+set ic [expr $ic - 1]
+
+if { $ic != $aGoodNbCurves } {
+ puts "Error: $aGoodNbCurves curve is expected but $ic ones are found"
+} else {
+ CheckIntersectionResult s1 s2 $CurvesList 100 2.0e-7 2.0e-7
+}
+
+smallview
+don res_*
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png