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

Class DirectionMinMaxSelector

cadquery/selectors.py:399–426  ·  view source on GitHub ↗

Selects objects closest or farthest in the specified direction. Applicability: All object types. for a vertex, its point is used. for all other kinds of objects, the center of mass of the object is used. You can use the string shortcuts >(X|Y|Z) or <(X|Y|Z) if you want

Source from the content-addressed store, hash-verified

397
398
399class DirectionMinMaxSelector(CenterNthSelector):
400 """
401 Selects objects closest or farthest in the specified direction.
402
403 Applicability:
404 All object types. for a vertex, its point is used. for all other kinds
405 of objects, the center of mass of the object is used.
406
407 You can use the string shortcuts >(X|Y|Z) or <(X|Y|Z) if you want to select
408 based on a cardinal direction.
409
410 For example this::
411
412 CQ(aCube).faces(DirectionMinMaxSelector((0, 0, 1), True))
413
414 Means to select the face having the center of mass farthest in the positive
415 z direction, and is the same as::
416
417 CQ(aCube).faces(">Z")
418
419 """
420
421 def __init__(
422 self, vector: Vector, directionMax: bool = True, tolerance: float = 0.0001
423 ):
424 super().__init__(
425 n=-1, vector=vector, directionMax=directionMax, tolerance=tolerance
426 )
427
428
429# inherit from CenterNthSelector to get the CenterNthSelector.key method

Callers 1

_chooseSelectorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected