Metadata-Version: 2.4
Name: pybeltsolver
Version: 0.1.0
Summary: Geometric solver and visualizer for 2D generic belt systems.
Author-email: Vincent Wallsten <vincent.wallsten03@gmail.com>
License: MIT License
        
        Copyright (c) 2026 vincewall
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: HomePage, https://github.com/vincewall/pybeltsolver
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scipy>=1.17.1
Requires-Dist: matplotlib>=3.11.0
Requires-Dist: numpy>=2.4.6
Dynamic: license-file

# Geometric Solver and Visualizer for 2D Generic Belt Systems

This module provides the `Belt` and `Circle` classes to define, validate, and solve the geometry of a closed-loop belt-like system with no restrictions on the number of pulleys. It also supports custom routing topologies (front/back) via the `BeltFace` class, and dynamic length optimization via SciPy. Visualization is provided through Matplotlib. Axes and Figures are returned.

## Examples

### Standard 2-Pulley System
```python
c1 = Circle(40.0, (0, 0), name="Drive Motor")
c2 = Circle(40.0, (250, 0), name="Driven Wheel")

pulleys = [c1, c2]
routing = [BeltFace.FRONT, BeltFace.FRONT]

belt = Belt(circles=pulleys, topology=routing, allow_crossing=False)
print(f"Total Belt Length: {belt.total_length:.2f}")
belt.plot()
```

### Three-Pulley System with Mixed Routing and Optimization
```python
import numpy as np

c1 = Circle(52 * 2 / np.pi / 2, (0, 0), name="c1")
c2 = Circle(23 * 2 / np.pi / 2, (10, 50), name="c2")
c3 = Circle(20 * 2 / np.pi / 2, (0, 78.87), name="c3")

pulleys = [c1, c2, c3]
routing = [BeltFace.FRONT, BeltFace.BACK, BeltFace.FRONT]

belt = Belt(circles=pulleys, topology=routing, allow_crossing=True)
print(f"Original Length: {belt.total_length:.2f}")

# Slide the tensioner (c2) along the X-axis to reach exactly 240 units
belt.find_movable_circle_position(
    target_length=240, movable_circle_idx=1, slide_vector=np.array([1, 0])
)
print(f"New Length: {belt.total_length:.2f}")
belt.plot()
```

### 4-Pulley System (Default Topology)
```python
c1 = Circle(40.0, (0, 0), name="c1")
c2 = Circle(40.0, (250, 0), name="c2")
c3 = Circle(20.0, (240, -75), name="c3")
c4 = Circle(40.0, (100, -160), name="c4")

pulleys = [c1, c2, c3, c4]

# Topology defaults to all BeltFace.FRONT if not specified
belt = Belt(circles=pulleys, allow_crossing=False)
print(f"Total Belt Length: {belt.total_length:.2f}")
belt.plot()
```

---
**Author:** Vincent Wallsten  
**Date:** 2026-06-23
