manim.mobject.svg.svg_path

Mobjects generated from an SVG pathstring.

Classes

Functions

correct_out_of_range_radii(rx, ry, x1p, y1p)[source]

Correction of out-of-range radii.

See: https://www.w3.org/TR/SVG11/implnote.html#ArcCorrectionOutOfRangeRadii

elliptical_arc_to_cubic_bezier(x1, y1, rx, ry, phi, fA, fS, x2, y2)[source]

Generate cubic bezier points to approximate SVG elliptical arc.

See: http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes

get_elliptical_arc_center_parameters(x1, y1, rx, ry, phi, fA, fS, x2, y2)[source]

Conversion from endpoint to center parameterization.

See: https://www.w3.org/TR/SVG11/implnote.html#ArcConversionEndpointToCenter

grouped(iterable, n)[source]

Group iterable into arrays of n items.

string_to_numbers(num_string)[source]

Parse the SVG string representing a sequence of numbers into an array of floats.

Parameters

num_string (str) – String representing a sequence of numbers, separated by commas, spaces, etc.

Returns

List of float values parsed out of the string.

Return type

list(float)

vector_angle(ux, uy, vx, vy)[source]

Calculate the dot product angle between two vectors.

This clamps the argument to the arc cosine due to roundoff errors from some SVG files.