https://github.com/lucthienphong1120/svg-turtle-converter
This script transforms Scalable Vector Graphics (SVG) files into commands for Turtle graphics
https://github.com/lucthienphong1120/svg-turtle-converter
python python-draw svg-converter turtle turtle-graphics
Last synced: 5 months ago
JSON representation
This script transforms Scalable Vector Graphics (SVG) files into commands for Turtle graphics
- Host: GitHub
- URL: https://github.com/lucthienphong1120/svg-turtle-converter
- Owner: lucthienphong1120
- Created: 2024-05-01T05:32:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-01T05:35:35.000Z (over 1 year ago)
- Last Synced: 2025-06-10T00:18:19.729Z (5 months ago)
- Topics: python, python-draw, svg-converter, turtle, turtle-graphics
- Language: Python
- Homepage:
- Size: 291 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SVG to Turtle Graphics Converter
## Overview
This script transforms Scalable Vector Graphics (SVG) files into commands for Turtle graphics. Turtle graphics is a beginner-friendly method for creating visual patterns and shapes using a virtual turtle.
The script takes an SVG file, extracts its path details, and converts these into Turtle graphics commands. This allows for the rich visuals of SVG files to be recreated with the Turtle graphics system.
## Features
+ Converts SVG to Turtle graphics commands.
+ Handles SVG path commands like M, L, C, and Z.
+ Adjusts SVG coordinates to fit the Turtle graphics space.
+ Preserves the original SVG colors and strokes in Turtle format.
+ Compatible with common Turtle graphics libraries.
## Install dependencies
```
git clone https://github.com/lucthienphong1120/SVG-Turtle-Converter.git
cd SVG-Turtle-Converter
pip install -r requirements.txt
```
## Usage
1. Vectorize an image to SVG file: https://vectorizer.ai.
2. To convert an SVG file to Turtle draw
```
python turtle-svg.py -s input.svg
```
