MCPcopy Index your code
hub / github.com/CadQuery/cadquery / DirectionNthSelector

Class DirectionNthSelector

cadquery/selectors.py:430–452  ·  view source on GitHub ↗

Filters for objects parallel (or normal) to the specified direction then returns the Nth one. Applicability: Linear Edges Planar Faces

Source from the content-addressed store, hash-verified

428
429# inherit from CenterNthSelector to get the CenterNthSelector.key method
430class DirectionNthSelector(ParallelDirSelector, CenterNthSelector):
431 """
432 Filters for objects parallel (or normal) to the specified direction then returns the Nth one.
433
434 Applicability:
435 Linear Edges
436 Planar Faces
437 """
438
439 def __init__(
440 self,
441 vector: Vector,
442 n: int,
443 directionMax: bool = True,
444 tolerance: float = 0.0001,
445 ):
446 ParallelDirSelector.__init__(self, vector, tolerance)
447 _NthSelector.__init__(self, n, directionMax, tolerance)
448
449 def filter(self, objectlist: Sequence[Shape]) -> List[Shape]:
450 objectlist = ParallelDirSelector.filter(self, objectlist)
451 objectlist = _NthSelector.filter(self, objectlist)
452 return objectlist
453
454
455class LengthNthSelector(_NthSelector):

Callers 1

_chooseSelectorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected