Vector is projected onto the plane provided as input. :param args: Plane object Returns the projected vector.
(self, plane: "Plane")
| 208 | raise NotImplementedError("Have not needed this yet, but OCCT supports it!") |
| 209 | |
| 210 | def projectToPlane(self, plane: "Plane") -> "Vector": |
| 211 | """ |
| 212 | Vector is projected onto the plane provided as input. |
| 213 | |
| 214 | :param args: Plane object |
| 215 | |
| 216 | Returns the projected vector. |
| 217 | """ |
| 218 | base = plane.origin |
| 219 | normal = plane.zDir |
| 220 | |
| 221 | return self - normal * (((self - base).dot(normal)) / normal.Length ** 2) |
| 222 | |
| 223 | def __neg__(self) -> "Vector": |
| 224 | return self * -1 |