(
self,
func: MultiMappingFunction,
about_point: Point3DLike | None = None,
about_edge: Vector3DLike | None = None,
)
| 1546 | |
| 1547 | # TODO: name is inconsistent with OpenGLMobject.apply_points_function() |
| 1548 | def apply_points_function_about_point( |
| 1549 | self, |
| 1550 | func: MultiMappingFunction, |
| 1551 | about_point: Point3DLike | None = None, |
| 1552 | about_edge: Vector3DLike | None = None, |
| 1553 | ) -> Self: |
| 1554 | if about_point is None: |
| 1555 | if about_edge is None: |
| 1556 | about_edge = ORIGIN |
| 1557 | about_point = self.get_critical_point(about_edge) |
| 1558 | # Make a copy to prevent mutation of the original array if about_point is a view |
| 1559 | about_point = np.array(about_point, copy=True) |
| 1560 | for mob in self.family_members_with_points(): |
| 1561 | mob.points -= about_point |
| 1562 | mob.points = func(mob.points) |
| 1563 | mob.points += about_point |
| 1564 | return self |
| 1565 | |
| 1566 | def pose_at_angle(self, **kwargs): |
| 1567 | self.rotate(TAU / 14, RIGHT + UP, **kwargs) |
no test coverage detected