https://github.com/naveen521kk/manim-mobject-svg
Create SVG files from VMobject and VGroup
https://github.com/naveen521kk/manim-mobject-svg
manim math plugin svg
Last synced: about 1 month ago
JSON representation
Create SVG files from VMobject and VGroup
- Host: GitHub
- URL: https://github.com/naveen521kk/manim-mobject-svg
- Owner: naveen521kk
- License: mit
- Created: 2023-01-26T11:59:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-25T17:50:27.000Z (5 months ago)
- Last Synced: 2025-04-15T15:52:20.910Z (2 months ago)
- Topics: manim, math, plugin, svg
- Language: Python
- Homepage:
- Size: 308 KB
- Stars: 19
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# manim-mobject-svg
Create SVG files from [VMobject](https://docs.manim.community/en/stable/reference/manim.mobject.types.vectorized_mobject.VMobject.html) and [VGroup](https://docs.manim.community/en/stable/reference/manim.mobject.types.vectorized_mobject.VGroup.html).
Install: `pip install manim-mobject-svg`
Here's an example of how to use this plugin:
```python
from manim import *
from manim_mobject_svg import *a = Square(color=BLUE)
a.to_svg("square.svg")
```
This should create a file `square.svg` in the current directory and return the path to the file. The output should look like this:
It's also possible to create a SVG file for VGroup.
```python
from manim import *
from manim_mobject_svg import *a = Square(color=BLUE)
b = Circle(color=RED)
c = VGroup(a, b)
c.to_svg("group.svg")
```
It'll create a SVG file like this:
## Parameters for `to_svg()`
`to_svg()` takes the following parameters:
- `path`: Path to the SVG file to be created. If not specified, it'll create a temporary file and return the path to the file.
- `crop`: Crop the SVG file to the bounding box of the VMobject. Default: `True`
- `padding`: Padding around the VMobject. Default: `0.5`This method returns the path to the SVG file.