1 # Sample: creation of milling cutter
5 pload MODELING VISUALIZATION
8 dset R 10. ;# outer radius
9 dset H 20. ;# height of the spiral part
10 dset a 0.5*pi ;# total angle of spiral rotation
14 circle outer 0 0 0 0 0 1 R
15 circle inner 0 0 0 0 0 1 R-2
16 circle round 3 6 0 0 0 1 5
17 polyline cut -2 0 0 -2 R+1 0 0.5 R+1 0 -1 0 0 -2 0 0
19 proc _curvetoface {name} {
20 uplevel #0 mkedge $name $name
21 uplevel #0 wire $name $name
22 uplevel #0 mkface $name p0 $name
31 bcommon teeth cut round
32 bcommon teeth teeth outer
36 for {set i 0} {$i < $nbteeths} {incr i} {
37 bfuse profile profile teeth
38 trotate teeth 0 0 0 0 0 1 360./$nbteeths
40 unifysamedom profile profile
42 # sweep profile along curved shape
44 polyline sp 0 0 0 0 0 H
45 cylinder ss 0 0 0 0 0 1 1 0 0 R
49 trim ll ll 0 sqrt(a*a+H*H)
51 trotate v2 0 0 0 0 0 1 180.*a/pi
57 tcopy profile_1 profile_2
58 tcopy profile_1 profile_3
59 tscale profile_1 0 0 0 1./(R-2)
60 ttranslate profile_2 0 0 H/2
61 tscale profile_2 0 0 H/2 4./(R-2)
62 ttranslate profile_3 0 0 H
63 tscale profile_3 0 0 H 3./(R-2)
76 pcylinder shank p1 1.4 H
77 plane p2 0 0 H+1 0 0 1
78 pcylinder sh2 p2 1.5 H-1
80 bfuse cutter base shank
90 incmesh profile_1 0.01; vdisplay profile_1