File: bug21507

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (57 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
puts "=========="
puts "OCC21507"
puts "=========="
puts ""
############################################################
# Bug in BOP: bcut produces invalid result without notice 
############################################################

# Demonstrates bug in bcut command
pload XDE

# Load face
puts "Loading face"
restore [locate_data_file bug21507_bcut_bug_face.brep] face

# Make tool - an elliptic cylinder
puts "Constructing tool"
ellipse c 10000 0 0 0 1 0 600 300
mkedge e c
wire w e
tcopy w w1
tcopy w w2
ttranslate w1 0  5000 0
ttranslate w2 0 -5000 0
thrusections tool 1 1 w1 w2

# Check validity of face and tool
puts "Checking face: [checkshape face]; [lrange [tolerance face] 0 1]"
puts "Checking tool: [checkshape tool]; [lrange [tolerance tool] 0 1]"
bopcheck face
bopcheck tool

# Do cut
puts "Running bcut"
bcut result face tool

# Evaluate result by number of faces (bcut)
set rfaces [explode result f]
if { [llength $rfaces] != 1 } {
  puts "Error: [llength $rfaces] faces instead of 1"
} else {
  puts "Result is as expected"
}

# Do the same using cut
puts "Now running old cut"
cut rcut face tool

# Evaluate result by number of faces (cut)
set rcfaces [explode rcut f]
if { [llength $rcfaces] != 1 } {
  puts "Error: [llength $rcfaces] faces instead of 1"
} else {
  puts "Result is as expected"
}

set 2dviewer 1