(self, obj: Shape)
| 520 | """ |
| 521 | |
| 522 | def key(self, obj: Shape) -> float: |
| 523 | if obj.ShapeType() in ("Face", "Shell", "Solid"): |
| 524 | return obj.Area() |
| 525 | elif obj.ShapeType() == "Wire": |
| 526 | try: |
| 527 | from cadquery.occ_impl.shapes import Face, Wire |
| 528 | |
| 529 | return abs(Face.makeFromWires(cast(Wire, obj)).Area()) |
| 530 | except Exception as ex: |
| 531 | raise ValueError( |
| 532 | f"Can not compute area of the Wire: {ex}. AreaNthSelector supports only closed planar Wires." |
| 533 | ) |
| 534 | else: |
| 535 | raise ValueError( |
| 536 | f"AreaNthSelector supports only Wires, Faces, Shells and Solids, not {type(obj).__name__}" |
| 537 | ) |
| 538 | |
| 539 | |
| 540 | class BinarySelector(Selector): |
nothing calls this directly
no test coverage detected