MCPcopy
hub / github.com/CadQuery/cadquery / LengthNthSelector

Class LengthNthSelector

cadquery/selectors.py:455–469  ·  view source on GitHub ↗

Select the object(s) with the Nth length Applicability: All Edge and Wire objects

Source from the content-addressed store, hash-verified

453
454
455class LengthNthSelector(_NthSelector):
456 """
457 Select the object(s) with the Nth length
458
459 Applicability:
460 All Edge and Wire objects
461 """
462
463 def key(self, obj: Shape) -> float:
464 if obj.ShapeType() in ("Edge", "Wire"):
465 return cast(Shape1DProtocol, obj).Length()
466 else:
467 raise ValueError(
468 f"LengthNthSelector supports only Edges and Wires, not {type(obj).__name__}"
469 )
470
471
472class AreaNthSelector(_NthSelector):

Callers 1

test_selectorsFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_selectorsFunction · 0.72