mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0032214: Modeling Algorithms - 2d Offset produces wrong result
Add new option to convert input contours into ones consisting of 2D circular arcs and 2D linear segments only.
This commit is contained in:
23
tests/bugs/modalg_8/bug32214_1
Normal file
23
tests/bugs/modalg_8/bug32214_1
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "========================================="
|
||||
puts "OCC32214: 2d Offset produces wrong result"
|
||||
puts "========================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32214.brep] a
|
||||
wire ww a
|
||||
|
||||
arclinconvert result ww
|
||||
build3d result
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -t -vertex 50 -edge 49 -wire 1
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 1.001e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkprops result -l 1.88301
|
||||
|
24
tests/bugs/modalg_8/bug32214_2
Normal file
24
tests/bugs/modalg_8/bug32214_2
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "========================================="
|
||||
puts "OCC32214: 2d Offset produces wrong result"
|
||||
puts "========================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug31992.brep] a
|
||||
wire a a
|
||||
mkplane a a
|
||||
|
||||
arclinconvert result a
|
||||
build3d result
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -t -vertex 187 -edge 187 -wire 1 -face 1
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 1.001e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkprops result -s 3.13603
|
||||
|
30
tests/bugs/modalg_8/bug32214_3
Normal file
30
tests/bugs/modalg_8/bug32214_3
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "========================================="
|
||||
puts "OCC32214: 2d Offset produces wrong result"
|
||||
puts "========================================="
|
||||
puts ""
|
||||
|
||||
beziercurve c1 9 3 3 0 10 0 10 0 100 -3 3 0 10 -10 0 0 100 -3 -3 0 10 0 -10 0 100 3 -3 0 10 10 0 0 100 3 3 0 10
|
||||
beziercurve c2 5 3 0 0 0 3 0 -3 0 0 0 -3 0 3 0 0
|
||||
mkedge e1 c1
|
||||
mkedge e2 c2
|
||||
wire w1 e1
|
||||
wire w2 e2
|
||||
orientation w2 R
|
||||
mkplane a w1
|
||||
add w2 a
|
||||
|
||||
arclinconvert result a
|
||||
build3d result
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -t -vertex 170 -edge 170 -wire 2 -face 1
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 1.001e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkprops result -s 106.6
|
||||
|
52
tests/bugs/modalg_8/bug32214_4
Normal file
52
tests/bugs/modalg_8/bug32214_4
Normal file
@@ -0,0 +1,52 @@
|
||||
puts "========================================="
|
||||
puts "OCC32214: 2d Offset produces wrong result"
|
||||
puts "========================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32214.brep] a
|
||||
wire ww a
|
||||
donly ww
|
||||
|
||||
mkoffset result ww 14 0.1 -approx
|
||||
|
||||
front
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
||||
|
||||
for {set i 1} {$i<=14} {incr i} {
|
||||
checkshape result_${i}
|
||||
set tolres [checkmaxtol result_${i}]
|
||||
if { ${tolres} > 1.001e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
}
|
||||
|
||||
checknbshapes result_1 -t -vertex 114 -edge 114 -wire 1
|
||||
checkprops result_1 -l 4.39365
|
||||
checknbshapes result_2 -t -vertex 110 -edge 110 -wire 1
|
||||
checkprops result_2 -l 5.02084
|
||||
checknbshapes result_3 -t -vertex 104 -edge 104 -wire 1
|
||||
checkprops result_3 -l 5.64778
|
||||
checknbshapes result_4 -t -vertex 101 -edge 101 -wire 1
|
||||
checkprops result_4 -l 6.27443
|
||||
checknbshapes result_5 -t -vertex 95 -edge 95 -wire 1
|
||||
checkprops result_5 -l 6.89816
|
||||
checknbshapes result_6 -t -vertex 92 -edge 92 -wire 1
|
||||
checkprops result_6 -l 7.51255
|
||||
checknbshapes result_7 -t -vertex 88 -edge 88 -wire 1
|
||||
checkprops result_7 -l 8.12807
|
||||
checknbshapes result_8 -t -vertex 81 -edge 81 -wire 1
|
||||
checkprops result_8 -l 8.74586
|
||||
checknbshapes result_9 -t -vertex 72 -edge 72 -wire 1
|
||||
checkprops result_9 -l 9.36292
|
||||
checknbshapes result_10 -t -vertex 65 -edge 65 -wire 1
|
||||
checkprops result_10 -l 9.97455
|
||||
checknbshapes result_11 -t -vertex 60 -edge 60 -wire 1
|
||||
checkprops result_11 -l 10.5864
|
||||
checknbshapes result_12 -t -vertex 59 -edge 59 -wire 1
|
||||
checkprops result_12 -l 11.2017
|
||||
checknbshapes result_13 -t -vertex 57 -edge 57 -wire 1
|
||||
checkprops result_13 -l 11.8196
|
||||
checknbshapes result_14 -t -vertex 55 -edge 55 -wire 1
|
||||
checkprops result_14 -l 12.4395
|
52
tests/bugs/modalg_8/bug32214_5
Normal file
52
tests/bugs/modalg_8/bug32214_5
Normal file
@@ -0,0 +1,52 @@
|
||||
puts "========================================="
|
||||
puts "OCC32214: 2d Offset produces wrong result"
|
||||
puts "========================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32214.brep] a
|
||||
wire ww a
|
||||
donly ww
|
||||
|
||||
openoffset result ww 14 0.1 -approx
|
||||
|
||||
front
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
||||
|
||||
for {set i 1} {$i<=14} {incr i} {
|
||||
checkshape result_${i}
|
||||
set tolres [checkmaxtol result_${i}]
|
||||
if { ${tolres} > 1.001e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
}
|
||||
|
||||
checknbshapes result_1 -t -vertex 61 -edge 60 -wire 1
|
||||
checkprops result_1 -l 2.04858
|
||||
checknbshapes result_2 -t -vertex 61 -edge 60 -wire 1
|
||||
checkprops result_2 -l 2.21414
|
||||
checknbshapes result_3 -t -vertex 61 -edge 60 -wire 1
|
||||
checkprops result_3 -l 2.37971
|
||||
checknbshapes result_4 -t -vertex 61 -edge 60 -wire 1
|
||||
checkprops result_4 -l 2.54528
|
||||
checknbshapes result_5 -t -vertex 61 -edge 60 -wire 1
|
||||
checkprops result_5 -l 2.71084
|
||||
checknbshapes result_6 -t -vertex 61 -edge 60 -wire 1
|
||||
checkprops result_6 -l 2.87641
|
||||
checknbshapes result_7 -t -vertex 61 -edge 60 -wire 1
|
||||
checkprops result_7 -l 3.04198
|
||||
checknbshapes result_8 -t -vertex 56 -edge 55 -wire 1
|
||||
checkprops result_8 -l 3.20723
|
||||
checknbshapes result_9 -t -vertex 50 -edge 49 -wire 1
|
||||
checkprops result_9 -l 3.38587
|
||||
checknbshapes result_10 -t -vertex 48 -edge 47 -wire 1
|
||||
checkprops result_10 -l 3.58204
|
||||
checknbshapes result_11 -t -vertex 45 -edge 44 -wire 1
|
||||
checkprops result_11 -l 3.73715
|
||||
checknbshapes result_12 -t -vertex 45 -edge 44 -wire 1
|
||||
checkprops result_12 -l 3.97323
|
||||
checknbshapes result_13 -t -vertex 43 -edge 42 -wire 1
|
||||
checkprops result_13 -l 4.14242
|
||||
checknbshapes result_14 -t -vertex 43 -edge 42 -wire 1
|
||||
checkprops result_14 -l 4.37544
|
52
tests/bugs/modalg_8/bug32214_6
Normal file
52
tests/bugs/modalg_8/bug32214_6
Normal file
@@ -0,0 +1,52 @@
|
||||
puts "========================================="
|
||||
puts "OCC32214: 2d Offset produces wrong result"
|
||||
puts "========================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32214.brep] a
|
||||
wire ww a
|
||||
donly ww
|
||||
|
||||
openoffset result ww 14 -0.1 -approx
|
||||
|
||||
front
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
||||
|
||||
for {set i 1} {$i<=14} {incr i} {
|
||||
checkshape result_${i}
|
||||
set tolres [checkmaxtol result_${i}]
|
||||
if { ${tolres} > 1.001e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
}
|
||||
|
||||
checknbshapes result_1 -t -vertex 50 -edge 49 -wire 1
|
||||
checkprops result_1 -l 1.66475
|
||||
checknbshapes result_2 -t -vertex 46 -edge 45 -wire 1
|
||||
checkprops result_2 -l 1.57655
|
||||
checknbshapes result_3 -t -vertex 40 -edge 39 -wire 1
|
||||
checkprops result_3 -l 1.48755
|
||||
checknbshapes result_4 -t -vertex 37 -edge 36 -wire 1
|
||||
checkprops result_4 -l 1.39682
|
||||
checknbshapes result_5 -t -vertex 31 -edge 30 -wire 1
|
||||
checkprops result_5 -l 1.30715
|
||||
checknbshapes result_6 -t -vertex 28 -edge 27 -wire 1
|
||||
checkprops result_6 -l 1.27033
|
||||
checknbshapes result_7 -t -vertex 24 -edge 23 -wire 1
|
||||
checkprops result_7 -l 1.1996
|
||||
checknbshapes result_8 -t -vertex 22 -edge 21 -wire 1
|
||||
checkprops result_8 -l 1.1737
|
||||
checknbshapes result_9 -t -vertex 18 -edge 17 -wire 1
|
||||
checkprops result_9 -l 1.17713
|
||||
checknbshapes result_10 -t -vertex 17 -edge 16 -wire 1
|
||||
checkprops result_10 -l 1.22711
|
||||
checknbshapes result_11 -t -vertex 14 -edge 13 -wire 1
|
||||
checkprops result_11 -l 1.2663
|
||||
checknbshapes result_12 -t -vertex 14 -edge 13 -wire 1
|
||||
checkprops result_12 -l 1.33108
|
||||
checknbshapes result_13 -t -vertex 14 -edge 13 -wire 1
|
||||
checkprops result_13 -l 1.39586
|
||||
checknbshapes result_14 -t -vertex 14 -edge 13 -wire 1
|
||||
checkprops result_14 -l 1.46064
|
Reference in New Issue
Block a user