@@ -21,7 +21,18 @@ class Body:
2121 def __init__ (self , workplane : cq .Workplane ):
2222 self .__wp = workplane
2323
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' :
2536 """
2637 Fillets the specified edges of the body.
2738
@@ -32,11 +43,13 @@ def fillet(self, edgesStr: str, amount: float) -> 'Body':
3243 Returns:
3344 Body: The modified body object.
3445 """
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
3750 return self
3851
39- def chamfer (self , edgesStr : str , amount : float ) -> 'Body' :
52+ def chamfer (self , edgeQuery : str , amount : float ) -> 'Body' :
4053 """
4154 Chamfers the specified edges of the body.
4255
@@ -47,8 +60,10 @@ def chamfer(self, edgesStr: str, amount: float) -> 'Body':
4760 Returns:
4861 Body: The modified body object.
4962 """
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
5267 return self
5368
5469 def move (self , translationVector : Vector3DType ) -> 'Body' :
0 commit comments