1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
occt/tests/bugs/modalg_2/bug23218
nbv ecc4f1489d 0024915: Wrong intersection curves between two cylinders
Existing method of Cylinder-Cylinder intersection computing is based on finding the analytic line (as a function of one argument) and converting one into the walking-line with set of equidistant (along the line parameter) points.

The main advantage of applied method is using adaptively computed step. Necessary step is computed into every point of the obtained walking-line. At that we receive final walking-line directly (without preliminary analytic line) and we determine moments more precisely, when it should be split (see IntPatch_ImpImpIntersection_4.gxx).

The main disadvantages is bad working this method for non-trimmed cylinders (with infinite bounds), because step value is depend on the boundaries values.

More over, new method always returns walking-line, while intersection result can be an analytic curve (lines, circle, ellipse). That is NO good. Therefore, analytic curve is computed by existing method.

In conclusion, in spite of covering almost all more often meeting cases, new method has limited application. Then we should use the existing old method.

Additionally, method MinMax() is added (see Standard_Real.hxx file). It uses into new algorithm.

Some test cases is changed according to their new behavior.

Test case for issue CR24915 is added.

Into GeometryTest_APICommands.cxx only tabulations were chaged.

"Extending" of isolines (see Geom2dHatch_Hatcher.cxx).

Small correction of test case for issue CR24915.
2014-08-21 15:54:02 +04:00

49 lines
1.3 KiB
Plaintext
Executable File

puts "============"
puts "OCC23218"
puts "============"
puts ""
#######################################################################
# Wrong value of tolerance for the intersection curve.
#######################################################################
set BugNumber OCC23218
puts "Load first shape ..."
restore [locate_data_file bug23218_b1] b1
puts "Load second shape ..."
restore [locate_data_file bug23218_b4] b2
puts "Start project operation ..."
set result [bopcurves b1 b2]
puts $result
puts "Finish project operation ..."
set GoodToleranceReached 2.4950140688989345e-006
regexp {Tolerance Reached=([-0-9.+eE]+)} $result full ToleranceReached
proc GetPercent {Value GoodValue} {
set Percent 0.
if {${GoodValue} != 0.} {
set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
} elseif {${Value} != 0.} {
set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
} else {
set Percent 0.
}
return ${Percent}
}
set percent_max 0.1
set ToleranceReached_percent [expr abs ( [GetPercent ${ToleranceReached} ${GoodToleranceReached}] ) ]
if {${ToleranceReached_percent} > ${percent_max}} {
puts "${BugNumber}: Faulty"
} else {
puts "OK ${BugNumber}"
}
set 3dviewer 0