<commit_before># glsl-superformula

A GLSL function for generating 3D [supershapes](https://en.wikipedia.org/wiki/Superformula). 

## Usage 

``` glsl
#pragma glslify: superformula = require('glsl-superformula')

vec2 doModel(vec3 p) {
	float id = 1.0;
	float d = length(p);
	float theta = atan(p.y / p.x);
	float phi = asin(p.z / d);

	float r1 = superformula(theta, 8.0, 60.0, 100.0, 30.0, 1.0, 1.0);
	float r2 = superformula(phi, 2.0, 10.0, 10.0, 10.0, 1.0, 1.0);
<commit_msg>Added link to the video that was the source of inspiration.<commit_after># glsl-superformula

A GLSL function for generating 3D [supershapes](https://en.wikipedia.org/wiki/Superformula). 

Inspired by <NAME>'s [3D Supershapes Processing tutorial](https://www.youtube.com/watch?v=akM4wMZIBWg). 

## Usage 

``` glsl
#pragma glslify: superformula = require('glsl-superformula')

vec2 doModel(vec3 p) {
	float id = 1.0;
	float d = length(p);
	float theta = atan(p.y / p.x);
	float phi = asin(p.z / d);

	float r1 = superformula(theta, 8.0, 60.0, 100.0, 30.0, 1.0, 1.0);
	float r2 = superformula(phi, 2.0, 10.0, 10.0, 10.0, 1.0, 1.0);

{'fraction_non_alphanumeric': 0.16846846846846847, 'fraction_numerical': 0.07027027027027027, 'mean_word_length': 3.8095238095238093, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5761921', 'n_tokens_mistral': 525, 'n_tokens_neox': 456, 'n_words': 117}