Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cheind/supershape
Python code to compute 3D parametric supershapes; additional Blender mesh generation support
https://github.com/cheind/supershape
superformula supershape
Last synced: 3 months ago
JSON representation
Python code to compute 3D parametric supershapes; additional Blender mesh generation support
- Host: GitHub
- URL: https://github.com/cheind/supershape
- Owner: cheind
- License: mit
- Created: 2020-08-05T12:26:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-31T08:52:05.000Z (almost 4 years ago)
- Last Synced: 2024-09-24T20:42:16.768Z (4 months ago)
- Topics: superformula, supershape
- Language: Python
- Homepage:
- Size: 328 KB
- Stars: 15
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# supershape
Python code to efficiently generate [3D SuperShapes](https://en.wikipedia.org/wiki/Superformula).3D SuperShapes are a family of parametric surfaces that can take on a variety of shapes depending on the parametrization. The following snippet creates 3D coordinates of a flower-like object
```python
import supershape as sshapex,y,z = sshape.supercoords(
# m, a, b, n1, n2, n3 (1x6 or 2x6)
[7, 1, 1, 0.2, 1.7, 1.7],
# u,v resolution
shape=(50,50)
)
```
To reproduce the above result, run
```
python -m supershape
```## Install
Via `pip````
pip install supershape
```## Blender support
Add the cloned folder path to your `PYTONPATH`, then launch Blender (>=v2.8) as follows
```
blender --python-use-system-env --python scripts\blender_demo.py
```
to get
To avoid modifying your `PYTHONPATH`, you can may install `supershape` into the Blender Python environment. See [this script](https://github.com/cheind/pytorch-blender/blob/eb2793e4ad90d3dd8210724feec5021d773f6beb/scripts/install_btb.py) for example.
## Releases
Tags on master are pushed as releases to PyPi.
1. Version bump
1. Commit push and await build result.
1. `git tag -a`
1. `git push origin --tags`
Or create the tag throuh the `Releases` page in github.