Dot Cloud¶
DotCloud¶
-
class
manimlib.mobject.types.dot_cloud.
DotCloud
(points: npt.ArrayLike = None, **kwargs)¶ 点云图
传入一系列三维坐标,在这些坐标的位置生成点物件
-
compute_bounding_box
() → numpy.ndarray¶ 计算包围框
-
get_radii
() → numpy.ndarray¶ 获取所有点的半径
-
get_radius
() → float¶ 获取点半径的最大值
-
get_shader_data
() → numpy.ndarray¶ 获取 shader 数据
-
make_3d
(reflectiveness: float = 0.5, shadow: float = 0.2)¶ 给点集添加光泽
-
scale
(scale_factor: float | npt.ArrayLike, scale_radii: bool = True, **kwargs)¶ 点集大小,
scale_radii
控制是否同时缩放每个点的大小
-
set_radii
(radii: npt.ArrayLike)¶ 传入一个数组,逐一设置点的半径
-
set_radius
(radius: float)¶ 传入一个数值,统一设置点的半径
-
to_grid
(n_rows: int, n_cols: int, n_layers: int = 1, buff_ratio: Optional[float, None] = None, h_buff_ratio: float = 1.0, v_buff_ratio: float = 1.0, d_buff_ratio: float = 1.0, height: float = 6)¶ 重置点的数量为
n_rows*n_cols*n_layers
,并将点按照 [行, 列, 层] 排列
-