mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-15 05:28:47 +08:00
- Replace monolithic switch statements in BndLib_Add3dCurve, BndLib_AddSurface, and BndLib_Add2dCurve with thin wrappers delegating to GeomBndLib_Curve, GeomBndLib_Surface, and GeomBndLib_Curve2d respectively. - Remove now-dead internal helpers AddGenCurv, AddGenSurf, and BndLib_Box2dCurve. Public BndLib API is preserved unchanged. - Implement proper BoxOptimal() in GeomBndLib_OffsetSurface: try the analytic equivalent surface first (offset plane -> plane, offset sphere -> sphere), then fall back to OtherSurface PSO sampling for general cases. - Refactor GeomBndLib_OffsetCurve2d to share exact fast paths for line and circle offsets between Box() and BoxOptimal(), matching the 3D OffsetCurve pattern; BoxOptimal falls back to OtherCurve2d PSO for general curves. - Update tests to reflect tighter bounds from GeomBndLib delegation.
76 lines
2.1 KiB
Plaintext
Executable File
76 lines
2.1 KiB
Plaintext
Executable File
puts "================"
|
|
puts "OCC23165"
|
|
puts "================"
|
|
puts ""
|
|
###################################################################################################################
|
|
# BndLib_Add3dCurve::Add incorrectly segmented original B-Spline what resulting in wrong bounding box or exception.
|
|
###################################################################################################################
|
|
|
|
catch { pload XDE }
|
|
|
|
set BugNumber OCC23165
|
|
|
|
smallview
|
|
|
|
# 1 step
|
|
set exception_status 0
|
|
|
|
restore [locate_data_file OCC23165-edge1.brep] e1
|
|
|
|
donly e1
|
|
catch { bounding e1 } msg
|
|
fit
|
|
|
|
set index [lsearch $msg exception]
|
|
if {$index > -1} {
|
|
set exception_status 1
|
|
} else {
|
|
bounding e1 -save e1_x1 e1_y1 e1_z1 e1_x2 e1_y2 e1_z2
|
|
|
|
set e1_good_x1 -17.610622244944413
|
|
set e1_good_y1 -3.8835885277044451e-05
|
|
set e1_good_z1 -3.0000388358852792
|
|
set e1_good_x2 -17.589377755055537
|
|
set e1_good_y2 5.700038816113608
|
|
set e1_good_z2 -1.6251884728673096
|
|
|
|
checkreal "e1_x1" [dval e1_x1] ${e1_good_x1} 0 0.001
|
|
checkreal "e1_y1" [dval e1_y1] ${e1_good_y1} 0 0.001
|
|
checkreal "e1_z1" [dval e1_z1] ${e1_good_z1} 0 0.001
|
|
checkreal "e1_x2" [dval e1_x2] ${e1_good_x2} 0 0.001
|
|
checkreal "e1_y2" [dval e1_y2] ${e1_good_y2} 0 0.001
|
|
checkreal "e1_z2" [dval e1_z2] ${e1_good_z2} 0 0.001
|
|
}
|
|
|
|
# 2 step
|
|
restore [locate_data_file OCC23165-curve.rle] c
|
|
mkedge result c 20 36
|
|
|
|
donly result
|
|
set res [bounding result -save x1 y1 z1 x2 y2 z2 ]
|
|
fit
|
|
|
|
set good_x1 -17.6105835090592
|
|
set good_y1 -4.7027736569526475
|
|
set good_z1 -4.3573266042834353
|
|
set good_x2 -17.589416490940806
|
|
set good_y2 5.7000000802283299
|
|
set good_z2 -1.6252272087525899
|
|
|
|
checkreal "x1" [dval x1] ${good_x1} 0 0.001
|
|
checkreal "y1" [dval y1] ${good_y1} 0 0.001
|
|
checkreal "z1" [dval z1] ${good_z1} 0 0.001
|
|
checkreal "x2" [dval x2] ${good_x2} 0 0.001
|
|
checkreal "y2" [dval y2] ${good_y2} 0 0.001
|
|
checkreal "z2" [dval z2] ${good_z2} 0 0.001
|
|
|
|
if { ${exception_status} == 0 } {
|
|
puts "${BugNumber}: OK"
|
|
} else {
|
|
puts "${BugNumber}: Faulty"
|
|
}
|
|
|
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
|
checkprops result -l 15.8888
|
|
checksection result
|