snaipperi

Untitled

Aug 5th, 2021
709
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from typing import Optional, Union
  2.  
  3. import cadquery as cq
  4. from cadquery.selectors import Selector
  5.  
  6.  
  7. def sub_edges(self,
  8.           sub: Union['cq.Workplane', str],
  9.           selector: Optional[Union[Selector, str]] = None,
  10.           tag: Optional[str] = None,
  11.           ):
  12.     wp = self.edges(selector, tag)
  13.     if isinstance(sub, str):
  14.         sub = self.workplaneFromTagged(sub)
  15.     wp.objects = [o for o in wp.objects if o not in sub.objects]
  16.     return wp
  17.  
  18.  
  19. cq.Workplane.sub_edges = sub_edges
RAW Paste Data