shapes_2d

The 2-D shapes.

Circle, Square, Rectangle, RegularPolygon, Polygon, Quad, Line, Point, Dot and SurroundingRectangle are all cubic bezier circuits (BezierCircuitCubic), so they stay exactly smooth at any zoom and morph into one another. They take color, stroke_color and stroke_width, plus grid_width / grid_height for shapes that carry a gradient or an image rather than one flat color.

A second family – Arc, Annulus, Ellipse, Star, Arrow – comes from the Manim compatibility layer and is constructed with Manim’s arguments, including stroke_width and stroke_color in place of the border ones.

The Triangulated classes here build filled triangle meshes instead, for interiors that need per-fragment shading.

See The Mob Gallery.

Classes

Circle

A circle, drawn as a cubic bezier circuit.

Dot

A small filled Circle, for marking a point.

Line

A straight or circular-arc line segment, drawn as a cubic bezier circuit.

Point

A single point, mostly useful as an invisible anchor.

Polygon

A 2-D planar polygon with N vertices.

Quad

A four-sided polygon, given its four corners.

QuadTriangulated

Rectangle

A rectangle, drawn as a cubic bezier circuit.

RegularPolygon

A regular polygon: n equal sides on a circle.

Square

A square, drawn as a cubic bezier circuit.

SurroundingRectangle

A rectangle sized to enclose one or more other Mobs.

Triangle

An equilateral triangle pointing up.

TriangleTriangulated

TriangleVertices