0024472: Wrong section curves
[occt.git] / tests / bugs / modalg_5 / bug24472
CommitLineData
00302ba4 1puts "========="
2puts "CR24472"
3puts "========="
4puts ""
5###############################
6## Wrong section curves
7###############################
8
9proc checkList {List Tolerance D_good} {
10 set L1 [llength ${List}]
11 set L2 10
12 set L3 5
13 set N [expr (${L1} - ${L2})/${L3} + 1]
14
15 for {set i 1} {${i} <= ${N}} {incr i} {
16 set j1 [expr ${L2} + (${i}-1)*${L3}]
17 set j2 [expr ${j1} + 2]
18 set T [lindex ${List} ${j1}]
19 set D [lindex ${List} ${j2}]
20 #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
21 if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
22 puts "Error: i=${i} T=${T} D=${D}"
23 }
24 }
25}
26smallview
27
28restore [locate_data_file bug24472_Pipe_1.brep] b1
29
30explode b1 f
31copy b1_2 f1
32copy b1_3 f2
33copy b1_6 f3
34mksurface s1 f1
35mksurface s2 f2
36mksurface s3 f3
37
38puts ""
39puts "First test"
40# 1.1 geometry
41intersect i s1 s2
42
43#donly i_22; fit
44
45dlog reset
46dlog on
47xdistcs i_22 s1 0 1 10
48set Log1 [dlog get]
49
50set List1 [split ${Log1} {TD= \t\n}]
51set Tolerance 1.0e-12
52set D_good 0.
53checkList ${List1} ${Tolerance} ${D_good}
54
55puts ""
56puts "Second test"
57# 1.2 topology
58bsection r f1 f2
59bopcheck r
60# r is self interfered
61explode r e
62mkcurve c r_1
63
64#donly r_1; fit
65
66dlog reset
67dlog on
68xdistcs c s1 0.0714822451660209 1 10
69set Log2 [dlog get]
70
71set List2 [split ${Log2} {TD= \t\n}]
72set Tolerance 1.0e-12
73set D_good 0.
74checkList ${List2} ${Tolerance} ${D_good}
75
76puts ""
77puts "Third test"
78# 2.1 geometry
79intersect i s1 s3
80
81#donly i_4; fit
82
83dlog reset
84dlog on
85xdistcs i_4 s1 0 1 10
86set Log3 [dlog get]
87
88set List3 [split ${Log3} {TD= \t\n}]
89set Tolerance 1.0e-6
90set D_good 0.
91checkList ${List3} ${Tolerance} ${D_good}
92
93puts ""
94puts "Fourth test"
95# 2.2 topology
96bsection r f1 f3
97bopcheck r
98#r is self interfered
99explode r
100mkcurve c r_1
101
102#donly r_1; fit
103
104dlog reset
105dlog on
106xdistcs c s1 0.0714822451660209 1 10
107set Log4 [dlog get]
108
109set List4 [split ${Log4} {TD= \t\n}]
110set Tolerance 1.0e-12
111set D_good 0.
112checkList ${List4} ${Tolerance} ${D_good}