semvec/pypi-packages huggingface dataset:
curve2mesh 0.1.4
Python library to create 3D mesh from a 2D curve by revolving.
License: MIT
Requires Python: >=3.7,<4.0

[![Python application](https://github.com/ckesanapalli/curve2mesh/actions/workflows/python-app.yml/badge.svg)](https://github.com/ckesanapalli/curve2mesh/actions/workflows/python-app.yml)
[![Upload Python Package](https://github.com/ckesanapalli/curve2mesh/actions/workflows/python-publish.yml/badge.svg)](https://github.com/ckesanapalli/curve2mesh/actions/workflows/python-publish.yml)
[![Python package](https://github.com/ckesanapalli/curve2mesh/actions/workflows/python-package.yml/badge.svg)](https://github.com/ckesanapalli/curve2mesh/actions/workflows/python-package.yml)

# curve2mesh

## Overview

`curve2mesh` is a Python module designed for generating 3D meshes from 2D curves. This module simplifies the process of revolving a 2D curve around the Z-axis to create a 3D mesh. It is optimized for performance with NumPy, but also works with standard Python math operations when NumPy is not available.

## Features

- **Ease of Use**: Simple interface for revolving 2D curves.

- **Performance**: Optimized with NumPy for efficient computation.
- **Fallback Compatibility**: Works with standard Python math operations in the absence of NumPy.
- **Flexible**: Suitable for a wide range of applications in graphics, modeling, and educational purposes.

## Installation

To install `curve2mesh`, simply run the following command:

```bash
pip install curve2mesh
```

Or Install directly from Github using

```bash
pip install git+https://github.com/ckesanapalli/curve2mesh
```

**Note**: NumPy is an optional dependency but is recommended for performance enhancement.

## Usage

Here's a basic example of how to use curve2mesh:

```python
from curve2mesh import revolve_curve
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Poly3DCollection

# Sample 2D curve coordinates
x = np.linspace(0, 1, 100)
z = x ** 2  # Example curve (parabola)

# Revolve the curve
angle_count = 50
faces = revolve_curve(x, z, angle_count, revolve_angle=2*np.pi)

# Plotting
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.add_collection3d(Poly3DCollection(faces, facecolors='g', linewidths=1, alpha=0.5))
ax.set_xlim(-x.max(), x.max())
ax.set_ylim(-x.max(), x.max())
ax.set_zlim(z.min(), z.max())
plt.show()
```

![asdas](assets/images/mesh3d.png)

## Requirements

- Python 3.7+
- NumPy (optional but recommended)

## Contributing

Contributions to `curve2mesh` are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) for details on how to submit pull requests, bug reports, and feature requests.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Authors

Chaitanya Kesanapalli
dj-raw-sql 3.0.0
This is a Django wrapper to make it easier to write raw SQL queries.
License: MIT
Requires Python: >=3.10,<4.0
Keywords: python,django,sql,database,query,web

# dj-raw-sql

[![Dependencies](https://img.shields.io/librariesio/github/axemanofic/dj-raw-sql)](https://pypi.org/project/dj-raw-sql/)
[![Version](https://img.shields.io/pypi/v/dj-raw-sql?color=green)](https://pypi.org/project/dj-raw-sql/)
[![Downloads](https://pepy.tech/badge/dj-raw-sql/month)](https://pepy.tech/project/dj-raw-sql)
[![Downloads](https://pepy.tech/badge/dj-raw-sql/week)](https://pepy.tech/project/dj-raw-sql)

dj-raw-sql is just a wrapper over the [standard Django query](https://docs.djangoproject.com/en/4.1/topics/db/sql/#executing-custom-sql-directly)

This demo shows how to get the record(s) from the database

Example:

``` py title="queries.py" linenums="1"
def get_music_by_id(id: int):
    return "SELECT * FROM dj_app_music WHERE id = %s", (id,)
```

``` py title="models.py" linenums="1"
from django.db import models

# Our demo model
class Music(models.Model):
    name = models.CharField(max_length=150)
    create_at = models.DateTimeField(auto_now_add=True)
    update_at = models.DateTimeField(auto_now=True)
    is_delete = models.BooleanField(default=False)
```

``` py title="views.py" linenums="1"
from django.http import JsonResponse
from django.views import View

from my_app.queries import get_music_by_id

from dj_raw_sql import QueryExecutor


class MyView(View):
    def get(self, request, *args, **kwargs):
        music: tuple[tuple] = QueryExecutor.fetchone(get_music_by_id, id=1)
        return JsonResponse({"name": music[0][1]})
```

## Benchmarks

**Q**: How were performance tests conducted?

**A**: tests/test_collection/ performance tests are located here. A dataset of 5000 elements was generated and loaded into the database. Then the query "SELECT * FROM dj_app_music LIMIT %s" was called, where the value of LIMIT changed from 10 to 5000 in each test.

---
Test results

| Number of items |    fetchall   | to_ordereddict=True |
|-----------------|:-------------:|:-------------------:|
| 10              | 0.00006       | 0.00011             |
| 100             | 0.00017       | 0.00025             |
| 1000            | 0.00138       | 0.00207             |
| 5000            | 0.00658       | 0.01052             |

## Improve project

If you want to improve the project then create "Issues" . If you want to help with writing tests or typing, create a "pull request".