Filters for objects parallel (or normal) to the specified direction then returns the Nth one. Applicability: Linear Edges Planar Faces
| 428 | |
| 429 | # inherit from CenterNthSelector to get the CenterNthSelector.key method |
| 430 | class 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 | |
| 455 | class LengthNthSelector(_NthSelector): |