@@ -21,7 +21,18 @@ class Body:
21
21
def __init__ (self , workplane : cq .Workplane ):
22
22
self .__wp = workplane
23
23
24
- def fillet (self , edgesStr : str , amount : float ) -> 'Body' :
24
+ def _select_edges (self ,
25
+ query : str
26
+ ) -> cq .Workplane :
27
+ '''
28
+ Selects edges in the body
29
+ '''
30
+ if query == "ALL" or query == "*" :
31
+ return self .__wp .edges ()
32
+ else :
33
+ return self .__wp .edges (query )
34
+
35
+ def fillet (self , edgeQuery : str , amount : float ) -> 'Body' :
25
36
"""
26
37
Fillets the specified edges of the body.
27
38
@@ -32,11 +43,13 @@ def fillet(self, edgesStr: str, amount: float) -> 'Body':
32
43
Returns:
33
44
Body: The modified body object.
34
45
"""
35
- result = self .__wp .edges (edgesStr ).fillet (amount )
36
- self .__wp = result
46
+ selection = self ._select_edges (edgeQuery )
47
+ if selection :
48
+ result = selection .fillet (amount )
49
+ self .__wp = result
37
50
return self
38
51
39
- def chamfer (self , edgesStr : str , amount : float ) -> 'Body' :
52
+ def chamfer (self , edgeQuery : str , amount : float ) -> 'Body' :
40
53
"""
41
54
Chamfers the specified edges of the body.
42
55
@@ -47,8 +60,10 @@ def chamfer(self, edgesStr: str, amount: float) -> 'Body':
47
60
Returns:
48
61
Body: The modified body object.
49
62
"""
50
- result = self .__wp .edges (edgesStr ).chamfer (amount )
51
- self .__wp = result
63
+ selection = self ._select_edges (edgeQuery )
64
+ if selection :
65
+ result = selection .chamfer (amount )
66
+ self .__wp = result
52
67
return self
53
68
54
69
def move (self , translationVector : Vector3DType ) -> 'Body' :
0 commit comments