Utility function to make the code further below more clean and tidy Performs some test and raise appropriate error when no Faces are found for extrusion
(face, eDir, direction, both=False)
| 3709 | """ |
| 3710 | |
| 3711 | def getFacesList(face, eDir, direction, both=False): |
| 3712 | """ |
| 3713 | Utility function to make the code further below more clean and tidy |
| 3714 | Performs some test and raise appropriate error when no Faces are found for extrusion |
| 3715 | """ |
| 3716 | facesList = self.findSolid().facesIntersectedByLine( |
| 3717 | face.Center(), eDir, direction=direction |
| 3718 | ) |
| 3719 | if len(facesList) == 0 and both: |
| 3720 | raise ValueError( |
| 3721 | "Couldn't find a face to extrude/cut to for at least one of the two required directions of extrusion/cut." |
| 3722 | ) |
| 3723 | |
| 3724 | if len(facesList) == 0: |
| 3725 | # if we don't find faces in the workplane normal direction we try the other |
| 3726 | # direction (as the user might have created a workplane with wrong orientation) |
| 3727 | facesList = self.findSolid().facesIntersectedByLine( |
| 3728 | face.Center(), eDir.multiply(-1.0), direction=direction |
| 3729 | ) |
| 3730 | if len(facesList) == 0: |
| 3731 | raise ValueError( |
| 3732 | "Couldn't find a face to extrude/cut to. Check your workplane orientation." |
| 3733 | ) |
| 3734 | return facesList |
| 3735 | |
| 3736 | # process sketches or pending wires |
| 3737 | faces = self._getFaces() |
nothing calls this directly
no test coverage detected