PMobject#
Qualified name: manim.mobject.types.point\_cloud\_mobject.PMobject
- class PMobject(stroke_width=4, **kwargs)[source]#
Bases:
MobjectA disc made of a cloud of Dots
Examples
Example: PMobjectExample ¶
from manim import * class PMobjectExample(Scene): def construct(self): pG = PGroup() # This is just a collection of PMobject's # As the scale factor increases, the number of points # removed increases. for sf in range(1, 9 + 1): p = PointCloudDot(density=20, radius=1).thin_out(sf) # PointCloudDot is a type of PMobject # and can therefore be added to a PGroup pG.add(p) # This organizes all the shapes in a grid. pG.arrange_in_grid() self.add(pG)
Methods
Add points.
align_points_with_largerfade_tofilter_outget_all_rgbasget_array_attrsReturns the color of the
MobjectReturn the base class of this mobject type.
The simplest
Mobjectto be transformed to or from self.get_stroke_widthingest_submobjectsinterpolate_colormatch_colorspoint_from_proportionpointwise_become_partialSets
pointsto be an empty array.Condition is function which takes in one arguments, (x, y, z).
set_color_by_gradientset_colors_by_radial_gradientset_stroke_widthFunction is any map from R^3 to R
Removes all but every nth point for n = factor
Attributes
animateUsed to animate the application of any method of
self.animation_overridesdepthThe depth of the mobject.
heightThe height of the mobject.
widthThe width of the mobject.
- add_points(points, rgbas=None, color=None, alpha=1)[source]#
Add points.
Points must be a Nx3 numpy array. Rgbas must be a Nx4 numpy array if it is not None.
- get_point_mobject(center=None)[source]#
The simplest
Mobjectto be transformed to or from self. Should by a point of the appropriate type