0014531: Boolean Operation Algorithm fails
[occt.git] / tests / bugs / modalg_5 / bug24758_1
CommitLineData
07b5cb8f 1puts "==========="
2puts "OCC24758"
3puts "==========="
4puts ""
5##############################################################
6# Sample Draw scripts for demonstrating sweeping algorithm
7##############################################################
8
9# parameters
10dset R 10. ;# outer radius
11dset H 20. ;# height of the spiral part
12dset a 0.5*pi ;# total angle of spiral rotation
13
14# make profile
15circle outer 0 0 0 0 0 1 R
16circle inner 0 0 0 0 0 1 R-2
17circle round 3 6 0 0 0 1 5
18polyline cut -2 0 0 -2 R+1 0 0.5 R+1 0 -1 0 0 -2 0 0
19
20proc _curvetoface {name} {
21 uplevel #0 mkedge $name $name
22 uplevel #0 wire $name $name
23 uplevel #0 mkface $name p0 $name
24}
25
26plane p0
27_curvetoface outer
28_curvetoface inner
29_curvetoface round
30mkface cut p0 cut
31
32bcommon teeth cut round
33bcommon teeth teeth outer
34
35tcopy inner profile
36set nbteeths 25
37for {set i 0} {$i < $nbteeths} {incr i} {
38 fuse profile profile teeth
39 trotate teeth 0 0 0 0 0 1 360./$nbteeths
40}
41
42# sweep profile along curved shape
43polyline sp 0 0 0 0 0 H
44cylinder ss 0 0 0 0 0 1 1 0 0 R
45vertex v1 R 0 0
46vertex v2 R 0 H
47line ll 0 0 a H
48trim ll ll 0 sqrt(a*a+H*H)
49
50trotate v2 0 0 0 0 0 1 180.*a/pi
51mkedge ee ll ss v1 v2
52wire gg ee
53
54donly profile sp gg
55explode profile w
56tcopy profile_1 profile_2
57tcopy profile_1 profile_3
58tscale profile_1 0 0 0 1./(R-2)
59ttranslate profile_2 0 0 H/2
60tscale profile_2 0 0 H/2 4./(R-2)
61ttranslate profile_3 0 0 H
62tscale profile_3 0 0 H 3./(R-2)
63
64mksweep sp
65setsweep -G gg 0 0
66addsweep profile_1
67addsweep profile_2
68addsweep profile_3
69vclear
70
71buildsweep base -S
72
73# make a shank
74plane p1 0 0 H 0 0 1
75pcylinder shank p1 1.4 H
76plane p2 0 0 H+1 0 0 1
77pcylinder sh2 p2 1.5 H-1
78bfuse shank shank sh2
79bfuse cutter base shank
80
81# check result
82checkshape cutter
83
84# show result
85incmesh cutter 0.01
86vinit
87vdisplay cutter
88vsetdispmode cutter 1
89incmesh profile_1 0.01; vdisplay profile_1
90vfit
91
58cf74e0 92# check area
07b5cb8f 93renamevar cutter result
58cf74e0 94checkprops result -s 1403.85
95checkshape result
07b5cb8f 96
5747059b 97checkview -screenshot -3d -path ${imagedir}/${test_image}.png