-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfillet.py
59 lines (49 loc) · 1.25 KB
/
fillet.py
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
58
59
from SolidPy import *
class AxialFillet(object):
def __init__(self,rfa,r):
"""
rfa = radius from axail
r = radius of fillet
axis= vector of axis
"""
self.r=r
self.rfa=rfa
def outterFillet(self):
"""
returns a SolidPyObject to cut with
"""
c=Circle(self.r)
c.translate([self.rfa-self.r,0,0])
b=Square([self.r+1,self.r])
b.translate([self.rfa-self.r+0.5,0,0])
re=Rotate_extrude(b-c)
re.translate([0,0,-self.r])
## re.debug=True
return re
def innerFillet(self):
"""
returns a SolidPyObject to cut with
"""
c=Circle(self.r)
c.translate([self.r+self.rfa,0,0])
b=Square([self.r,self.r])
b.translate([self.rfa,0,0])
re=Rotate_extrude(b-c)
re.translate([0,0,-self.r])
## return b-c
return re
def main():
SolidPyObj.fs=0.1
## SolidPyObj.fn = 60
## SolidPyObj.fa = 6
AF= AxialFillet(5,3)
bb=AF.outterFillet()
bb.translate([0,0,10])
## bb.debug=True
bb.color("red",0.5)
aa=Cylinder(h=10,rad=5)
aa.color("blue",0.5)
junk= aa - bb
writeSCADfile('junk.scad',junk)
if __name__ == '__main__':
main()