MCPcopy
hub / github.com/ManimCommunity/manim / apply_points_function_about_point

Method apply_points_function_about_point

manim/mobject/mobject.py:1548–1564  ·  view source on GitHub ↗
(
        self,
        func: MultiMappingFunction,
        about_point: Point3DLike | None = None,
        about_edge: Vector3DLike | None = None,
    )

Source from the content-addressed store, hash-verified

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)

Callers 5

scaleMethod · 0.95
rotateMethod · 0.95
stretchMethod · 0.95
apply_functionMethod · 0.95
apply_matrixMethod · 0.95

Calls 3

get_critical_pointMethod · 0.95
funcFunction · 0.50

Tested by

no test coverage detected