Skip to content

Commit

Permalink
init: upload project
Browse files Browse the repository at this point in the history
  • Loading branch information
lucthienphong1120 committed May 1, 2024
0 parents commit 059eaa8
Show file tree
Hide file tree
Showing 6 changed files with 18,168 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv/
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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
```

![Sample](./output.png)
Loading

0 comments on commit 059eaa8

Please sign in to comment.