0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tests / bugs / modalg_5 / bug21564
CommitLineData
0cbfb9f1 1puts "================"
2puts "OCC21564"
3puts "================"
4puts ""
5#######################################################################
6# Intersection of two planar faces produces curve with too many poles
7#######################################################################
8
9puts "Construct horizontal plane, convert it to b-spline, and create a face on it"
10plane p1 0 0 0 0 0 1
11trim p1t p1 -10 10 -10 10
12convert bs1 p1t
13mkface f1 bs1
14
15puts "Construct vertical plane and face on it"
16plane p2 0 0 0 1 0 0
17mkface f2 p2 -10 10 -10 10
18
19puts "\nBuild intersection of two faces"
20bsection sec f1 f2
21
22puts "Check number of points in resulting curve"
23if { ! [regexp {([0-9]+) Poles} [dump sec] str nbp] } {
24 puts "Error: Could not check number of poles in resulting curve!"
25} elseif { $nbp != 2 } {
26 puts "Error: Intersection curve has too many poles ($nbp while 2 is expected)"
27}
28
29puts "\nBuild intersection with approximation of resulting curve"
30bsection sec f1 f2 -a
31
32puts "Check number of points in resulting curve"
33if { ! [regexp {([0-9]+) Poles} [dump sec] str nbp] } {
34 puts "Error: Could not check number of poles in resulting curve!"
35} elseif { $nbp != 2 } {
36 puts "Error: Intersection curve has too many poles ($nbp while 2 is expected)"
37}
38
39puts "\nNow trying with inclined plane"
40plane p2 0 0 0 1 2 0
41mkface f2 p2 -15 15 -15 15
42
43puts "\nBuild intersection of two faces"
44bsection sec f1 f2
45
46puts "Check number of points in resulting curve"
47if { ! [regexp {([0-9]+) Poles} [dump sec] str nbp] } {
48 puts "Error: Could not check number of poles in resulting curve!"
49} elseif { $nbp != 2 } {
50 puts "Error: Intersection curve has too many poles ($nbp while 2 is expected)"
51}
52
53puts "\nBuild intersection with approximation of resulting curve"
54bsection sec f1 f2 -a
55
56puts "Check number of points in resulting curve"
57if { ! [regexp {([0-9]+) Poles} [dump sec] str nbp] } {
58 puts "Error: Could not check number of poles in resulting curve!"
59} elseif { $nbp != 2 } {
60 puts "Error: Intersection curve has too many poles ($nbp while 2 is expected)"
61}