r""" Selects objects parallel 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(ParallelDirSelector((0, 0, 1)))
| 190 | |
| 191 | |
| 192 | class ParallelDirSelector(BaseDirSelector): |
| 193 | r""" |
| 194 | Selects objects parallel with the provided direction. |
| 195 | |
| 196 | Applicability: |
| 197 | Linear Edges |
| 198 | Planar Faces |
| 199 | |
| 200 | Use the string syntax shortcut \|(X|Y|Z) if you want to select based on a cardinal direction. |
| 201 | |
| 202 | Example:: |
| 203 | |
| 204 | CQ(aCube).faces(ParallelDirSelector((0, 0, 1))) |
| 205 | |
| 206 | selects faces with the normal parallel to the z direction, and is equivalent to:: |
| 207 | |
| 208 | CQ(aCube).faces("|Z") |
| 209 | """ |
| 210 | |
| 211 | def test(self, vec: Vector) -> bool: |
| 212 | return self.direction.cross(vec).Length < self.tolerance |
| 213 | |
| 214 | |
| 215 | class DirectionSelector(BaseDirSelector): |
no outgoing calls