File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,22 @@ def dist(tShape):
8686 return [min (objectList , key = dist )]
8787
8888
89+ class NearestToShapeSelector (Selector ):
90+ """
91+ Selects object nearest the provided Shape.
92+
93+ Applicability: All Types of Shapes
94+
95+ """
96+
97+ def __init__ (self , s : Shape ):
98+ self .shape = s
99+
100+ def filter (self , objectList : Sequence [Shape ]):
101+
102+ return [min (objectList , key = lambda el : self .s .distance (el ))]
103+
104+
89105class BoxSelector (Selector ):
90106 """
91107 Selects objects inside the 3D box defined by 2 points.
@@ -870,3 +886,11 @@ def filter(self, objectList: Sequence[Shape]):
870886 Filter give object list through th already constructed complex selector object
871887 """
872888 return self .mySelector .filter (objectList )
889+
890+
891+ #%% Aliases
892+
893+ NearestToPoint = NearestToPointSelector
894+ NearestToShape = NearestToShapeSelector
895+ Parallel = ParallelDirSelector
896+ Perpendicular = PerpendicularDirSelector
You can’t perform that action at this time.
0 commit comments