Selects objects aligned with the provided direction. Applicability: Linear Edges Planar Faces Use the string syntax shortcut +/-(X|Y|Z) if you want to select based on a cardinal direction. Example:: CQ(aCube).faces(DirectionSelector((0, 0, 1))) selec
| 213 | |
| 214 | |
| 215 | class DirectionSelector(BaseDirSelector): |
| 216 | """ |
| 217 | Selects objects aligned with the provided direction. |
| 218 | |
| 219 | Applicability: |
| 220 | Linear Edges |
| 221 | Planar Faces |
| 222 | |
| 223 | Use the string syntax shortcut +/-(X|Y|Z) if you want to select based on a cardinal direction. |
| 224 | |
| 225 | Example:: |
| 226 | |
| 227 | CQ(aCube).faces(DirectionSelector((0, 0, 1))) |
| 228 | |
| 229 | selects faces with the normal in the z direction, and is equivalent to:: |
| 230 | |
| 231 | CQ(aCube).faces("+Z") |
| 232 | """ |
| 233 | |
| 234 | def test(self, vec: Vector) -> bool: |
| 235 | return self.direction.getAngle(vec) < self.tolerance |
| 236 | |
| 237 | |
| 238 | class PerpendicularDirSelector(BaseDirSelector): |
no outgoing calls
no test coverage detected