mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0027261: Incorrect bounding boxes computed for the b-spline faces
Protection from the out of bounds parameters is added. Test cases are added.
This commit is contained in:
parent
4b3541c68b
commit
447c7e54f0
@ -195,6 +195,11 @@ void ComputePolesIndexes(const TColStd_Array1OfReal &theFlatKnots,
|
||||
Standard_Integer &theOutMinIdx,
|
||||
Standard_Integer &theOutMaxIdx)
|
||||
{
|
||||
// Set initial values for the result indexes to handle situation when requested parameter space
|
||||
// is slightly greater than B-spline parameter space.
|
||||
theOutMinIdx = theFlatKnots.Lower();
|
||||
theOutMaxIdx = theFlatKnots.Upper();
|
||||
|
||||
// Compute first and last used flat knots.
|
||||
for(Standard_Integer aKnotIdx = theFlatKnots.Lower();
|
||||
aKnotIdx < theFlatKnots.Upper();
|
||||
|
15
tests/bugs/moddata_3/bug27261_1
Normal file
15
tests/bugs/moddata_3/bug27261_1
Normal file
@ -0,0 +1,15 @@
|
||||
puts "================"
|
||||
puts "0027261"
|
||||
puts "================"
|
||||
puts ""
|
||||
###############################################################
|
||||
# Incorrect bounding box is created for the face
|
||||
##############################################################
|
||||
|
||||
restore [locate_data_file bug27261_f1.brep] f1
|
||||
bounding f1
|
||||
|
||||
# Visual check.
|
||||
smallview
|
||||
fit
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
15
tests/bugs/moddata_3/bug27261_2
Normal file
15
tests/bugs/moddata_3/bug27261_2
Normal file
@ -0,0 +1,15 @@
|
||||
puts "================"
|
||||
puts "0027261"
|
||||
puts "================"
|
||||
puts ""
|
||||
###############################################################
|
||||
# Incorrect bounding box is created for the face
|
||||
##############################################################
|
||||
|
||||
restore [locate_data_file bug27261_f2.brep] f2
|
||||
bounding f2
|
||||
|
||||
# Visual check.
|
||||
smallview
|
||||
fit
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user