Metadata-Version: 2.4
Name: shapix
Version: 0.1.0
Summary: A geometry engine for Python with text-based syntax and PNG export
Home-page: https://github.com/berkayz/shapix
Author: BerkayZ
Author-email: BerkayZ <zelyurtberkay@gmail.com>
Project-URL: Homepage, https://github.com/BerkayZ/shapix
Project-URL: Bug Reports, https://github.com/BerkayZ/shapix/issues
Project-URL: Source, https://github.com/BerkayZ/shapix
Keywords: geometry,mathematics,visualization,education,graphics,shapes,canvas,png,export
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Education
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pillow>=8.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.10; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Requires-Dist: flake8>=3.8; extra == "dev"
Requires-Dist: mypy>=0.910; extra == "dev"
Provides-Extra: gui
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Shapix

A geometry engine for Python with text-based syntax and PNG export capabilities.

## Features

- **Simple text-based syntax** for defining geometric shapes
- **Multiple shape types**: Points, Lines, Circles, Triangles, Angles
- **PNG export** with automatic scaling and positioning
- **Flexible rendering** with customizable colors, labels, and styling
- **Mathematical operations** like area, perimeter, angle calculations
- **Clean object-oriented API** for programmatic use

## Installation

```bash
pip install shapix
```

## Quick Start

### Using Text Syntax

```python
from shapix.syntax import export_geometry_syntax

# Define geometry using simple text syntax
geometry = '''
POINT O 0 0 "O" show_label=true label_position=bottom_right
POINT A 0 100 "A" show_label=true label_position=top
POINT B -87 50 "B" show_label=true label_position=top_left
CIRCLE O 100 color=blue
TRIANGLE A B O color=green
ANGLE B O A color=red arc=true show_measure=true
'''

# Export to PNG
export_geometry_syntax(geometry, "my_diagram.png", width=800, height=600)
```

### Using Python API

```python
from shapix.core import Point
from shapix.shapes import Circle, Triangle
from shapix.rendering import ShapeRenderer

# Create shapes programmatically  
center = Point(0, 0, "O")
circle = Circle(center, radius=100)
circle.color = "blue"

vertex_a = Point(0, 100, "A")
vertex_b = Point(-87, 50, "B") 
triangle = Triangle(vertex_a, vertex_b, center)
triangle.color = "green"

# Render to canvas or export
# ... (rendering code)
```

## Syntax Reference

### Points
```
POINT name x y "label" show_label=true label_position=top_right
```

### Circles
```
CIRCLE center_point radius color=blue show_center=true
```

### Lines
```
LINE start_point end_point color=red show_endpoints=true
```

### Triangles  
```
TRIANGLE point1 point2 point3 color=green show_vertices=true
```

### Angles
```
ANGLE point1 vertex point2 color=red arc=true show_measure=true
```

## Shape Properties

All shapes support common properties:
- `color` - Outline color
- `fill_color` - Fill color  
- `line_width` - Line thickness
- `font_size` - Label font size
- `text_color` - Label text color
- `visible` - Show/hide shape
- `layer` - Drawing order

## Label Positions

Points and labels can be positioned using:
- `top_left`, `top`, `top_right`
- `center_left`, `center`, `center_right` 
- `bottom_left`, `bottom`, `bottom_right`
- `left`, `right`

## Requirements

- Python 3.8+
- Pillow (for PNG export)
- tkinter (usually included with Python)

## License

MIT License
