Methods
Inherited methods
Method new()
Create a new VMobject
Usage
VMobject$new(
position = c(0, 0, 0),
color = "#FFFFFF",
opacity = 1,
stroke_width = DEFAULT_STROKE_WIDTH,
fill_color = NULL,
fill_opacity = 0,
...
)
Arguments
position
Position
color
Color
opacity
Opacity
stroke_width
Stroke width
fill_color
Fill color
fill_opacity
Fill opacity
...
Additional args passed to MObject
Method set_points()
Set points from a matrix
Usage
VMobject$set_points(points)
Arguments
points
Matrix (N x 2 or N x 3)
Method get_points()
Get points matrix
Method has_points()
Check if this VMobject has any points
Method clear_points()
Clear all points
Method get_num_curves()
Get number of curves (4 points each)
Usage
VMobject$get_num_curves()
Add a straight line as a cubic Bezier
Usage
VMobject$add_line(start, end)
Arguments
start
Start point (x, y, z)
end
End point (x, y, z)
Method add_cubic_bezier()
Add a cubic Bezier curve
Usage
VMobject$add_cubic_bezier(p0, p1, p2, p3)
Arguments
p0, p1, p2, p3
Control points
Method append_points()
Append another VMobject's points
Usage
VMobject$append_points(other)
Method get_bounding_box()
Get bounding box computed from actual points
Usage
VMobject$get_bounding_box()
Method get_center()
Get center computed from bounding box
Method get_all_points()
Get all points including from submobjects
Usage
VMobject$get_all_points()
Method get_start()
Get the start point of the first curve
Method get_end()
Get the end point of the last curve
Method get_arc_length()
Get approximate arc length
Usage
VMobject$get_arc_length()
Get point at proportion along the path
Usage
VMobject$point_from_proportion(proportion)
Method get_draw_points()
Get interpolated points for drawing
Usage
VMobject$get_draw_points(precision = 10)
Arguments
precision
Samples per curve
Method set_fill()
Set fill color and opacity
Usage
VMobject$set_fill(color = NULL, opacity = NULL)
Arguments
color
Fill color (NULL to clear)
opacity
Fill opacity
Method set_stroke()
Set stroke color, width, and opacity
Usage
VMobject$set_stroke(color = NULL, width = NULL, opacity = NULL)
Arguments
color
Stroke color
width
Stroke width
opacity
Stroke opacity
Method set_style()
Set both fill and stroke style
Usage
VMobject$set_style(
fill_color = NULL,
fill_opacity = NULL,
stroke_color = NULL,
stroke_width = NULL,
stroke_opacity = NULL
)
Arguments
fill_color
Fill color
fill_opacity
Fill opacity
stroke_color
Stroke color
stroke_width
Stroke width
stroke_opacity
Stroke opacity
Method set_color()
Override set_color to also set stroke
Usage
VMobject$set_color(color)
Method add()
Add child submobjects
Arguments
...
VMobjects to add as children
Method add_submobject()
Add a single submobject (alias for add)
Usage
VMobject$add_submobject(obj)
Arguments
obj
MObject to add as child
Remove a child submobject
Arguments
obj
The VMobject to remove
Method get_submobject()
Get a submobject by index
Usage
VMobject$get_submobject(i)
Shift by direction
Usage
VMobject$shift(direction)
Rotate (applies to points directly)
Usage
VMobject$rotate(angle, about_point = NULL, axis = c(0, 0, 1))
Arguments
angle
Angle in radians
about_point
Center of rotation
axis
Rotation axis for 3D
Scale (applies to points directly)
Usage
VMobject$scale(factor, about_point = NULL)
Arguments
factor
Scale factor
about_point
Center of scaling
Method clone()
The objects of this class are cloneable with this method.
Usage
VMobject$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.