Skip to main content

Python code to efficiently generate 3D supershapes with optional Blender support.

Project description

supershape

Python code to efficiently generate 3D SuperShapes.

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

import supershape as sshape

x,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 for example.

Releases

Tags on master are pushed as releases to PyPi.

  1. Version bump
  2. Commit push and await build result.
  3. git tag <tagname> -a
  4. git push origin --tags Or create the tag throuh the Releases page in github.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supershape-1.1.1.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

supershape-1.1.1-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page