Point Cloud Mobject

PMobject

class manimlib.mobject.types.point_cloud_mobject.PMobject(**kwargs)

点物件

add_points(points: npt.ArrayLike, rgbas: np.ndarray | None = None, color: ManimColor | None = None, opacity: float | None = None)

添加点,点必须是若干个三维坐标,即 Nx3 的数组

point_from_proportion(alpha: float) → numpy.ndarray

获取点集上百分比为 alpha 的最接近的点

pointwise_become_partial(pmobject: manimlib.mobject.types.point_cloud_mobject.PMobject, a: float, b: float)

获取点集上百分比从 a 到 b 的点

resize_points(size: int, resize_func: Callable[[np.ndarray, int], np.ndarray] = <function resize_array>)

重置锚点数组大小

set_color_by_gradient(*colors: ManimColor)

渐变染色

set_points(points: npt.ArrayLike)

设置锚点

sort_points(function: Callable[[np.ndarray]] = <function PMobject.<lambda>>)

按照传入的函数对点进行排序,函数接受一个 三维 坐标,返回一个数值

PGroup

class manimlib.mobject.types.point_cloud_mobject.PGroup(*pmobs: manimlib.mobject.types.point_cloud_mobject.PMobject, **kwargs)

点集组合

Point

class manimlib.mobject.types.point_cloud_mobject.Point(location: numpy.ndarray = array([0., 0., 0.]), **kwargs)

单个点(似乎和 Mobject 中的 Point 类冲突了)