07b5cb8f |
1 | # Sample: creation of milling cutter |
2 | |
3 | pload MODELING VISUALIZATION |
4 | |
5 | # parameters |
6 | dset R 10. ;# outer radius |
7 | dset H 20. ;# height of the spiral part |
8 | dset a 0.5*pi ;# total angle of spiral rotation |
9 | |
10 | # make profile |
11 | |
12 | circle outer 0 0 0 0 0 1 R |
13 | circle inner 0 0 0 0 0 1 R-2 |
14 | circle round 3 6 0 0 0 1 5 |
15 | polyline cut -2 0 0 -2 R+1 0 0.5 R+1 0 -1 0 0 -2 0 0 |
16 | |
17 | proc _curvetoface {name} { |
18 | uplevel #0 mkedge $name $name |
19 | uplevel #0 wire $name $name |
20 | uplevel #0 mkface $name p0 $name |
21 | } |
22 | |
23 | plane p0 |
24 | _curvetoface outer |
25 | _curvetoface inner |
26 | _curvetoface round |
27 | mkface cut p0 cut |
28 | |
29 | bcommon teeth cut round |
30 | bcommon teeth teeth outer |
31 | |
32 | tcopy inner profile |
33 | set nbteeths 25 |
34 | for {set i 0} {$i < $nbteeths} {incr i} { |
35 | fuse profile profile teeth |
36 | trotate teeth 0 0 0 0 0 1 360./$nbteeths |
37 | } |
38 | |
39 | # sweep profile along curved shape |
40 | |
41 | polyline sp 0 0 0 0 0 H |
42 | cylinder ss 0 0 0 0 0 1 1 0 0 R |
43 | vertex v1 R 0 0 |
44 | vertex v2 R 0 H |
45 | line ll 0 0 a H |
46 | trim ll ll 0 sqrt(a*a+H*H) |
47 | |
48 | trotate v2 0 0 0 0 0 1 180.*a/pi |
49 | mkedge ee ll ss v1 v2 |
50 | wire gg ee |
51 | |
52 | donly profile sp gg |
53 | explode profile w |
54 | tcopy profile_1 profile_2 |
55 | tcopy profile_1 profile_3 |
56 | tscale profile_1 0 0 0 1./(R-2) |
57 | ttranslate profile_2 0 0 H/2 |
58 | tscale profile_2 0 0 H/2 4./(R-2) |
59 | ttranslate profile_3 0 0 H |
60 | tscale profile_3 0 0 H 3./(R-2) |
61 | |
62 | mksweep sp |
63 | setsweep -G gg 0 0 |
64 | addsweep profile_1 |
65 | addsweep profile_2 |
66 | addsweep profile_3 |
67 | vclear |
68 | |
69 | buildsweep base -S |
70 | |
71 | # make a shank |
72 | plane p1 0 0 H 0 0 1 |
73 | pcylinder shank p1 1.4 H |
74 | plane p2 0 0 H+1 0 0 1 |
75 | pcylinder sh2 p2 1.5 H-1 |
76 | bfuse shank shank sh2 |
77 | bfuse cutter base shank |
78 | |
79 | # check result |
80 | checkshape cutter |
81 | |
82 | # show result |
83 | incmesh cutter 0.01 |
84 | vdisplay cutter |
85 | vsetdispmode cutter 1 |
86 | incmesh profile_1 0.01; vdisplay profile_1 |
87 | vfit |