0024585: Wrong pcurve of the section curve
[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}
00302ba4 26restore [locate_data_file bug24472_Pipe_1.brep] b1
27
28explode b1 f
29copy b1_2 f1
30copy b1_3 f2
31copy b1_6 f3
32mksurface s1 f1
33mksurface s2 f2
34mksurface s3 f3
35
36puts ""
37puts "First test"
38# 1.1 geometry
39intersect i s1 s2
40
41#donly i_22; fit
42
43dlog reset
44dlog on
45xdistcs i_22 s1 0 1 10
46set Log1 [dlog get]
47
48set List1 [split ${Log1} {TD= \t\n}]
49set Tolerance 1.0e-12
50set D_good 0.
51checkList ${List1} ${Tolerance} ${D_good}
52
53puts ""
54puts "Second test"
55# 1.2 topology
56bsection r f1 f2
57bopcheck r
58# r is self interfered
59explode r e
60mkcurve c r_1
61
62#donly r_1; fit
63
64dlog reset
65dlog on
66xdistcs c s1 0.0714822451660209 1 10
67set Log2 [dlog get]
68
69set List2 [split ${Log2} {TD= \t\n}]
70set Tolerance 1.0e-12
71set D_good 0.
72checkList ${List2} ${Tolerance} ${D_good}
73
74puts ""
75puts "Third test"
76# 2.1 geometry
77intersect i s1 s3
78
79#donly i_4; fit
80
81dlog reset
82dlog on
83xdistcs i_4 s1 0 1 10
84set Log3 [dlog get]
85
86set List3 [split ${Log3} {TD= \t\n}]
87set Tolerance 1.0e-6
88set D_good 0.
89checkList ${List3} ${Tolerance} ${D_good}
90
91puts ""
92puts "Fourth test"
93# 2.2 topology
94bsection r f1 f3
95bopcheck r
96#r is self interfered
97explode r
98mkcurve c r_1
99
100#donly r_1; fit
101
102dlog reset
103dlog on
104xdistcs c s1 0.0714822451660209 1 10
105set Log4 [dlog get]
106
107set List4 [split ${Log4} {TD= \t\n}]
108set Tolerance 1.0e-12
109set D_good 0.
110checkList ${List4} ${Tolerance} ${D_good}