---
description: Geometry defined by equations
---

# Parametric Shapes

![Associative and Imperative Shape definition](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MSkFAd33zVVaUKcOxlM%2F-MSkFcjuiUtSLRS1PQLY%2Fshape_2021-02-04_12-32-50.png?alt=media\&token=0cea4540-0047-48c8-894a-ee25d573f672)

```d
u = 180/2..3*180/2..2;
v = 0..180*2..2;
x = ((3/2) + Math.Sin(u + (2 * v)<1>)) * (Math.Cos(v) + Math.Cos(2 * v)/10);
y = ((3/2) + Math.Sin(u + (2 * v)<1>)) * (Math.Sin(v) + Math.Sin(2 * v)/10);
z = Math.Sin(Math.RadiansToDegrees(Math.Sin(Math.RadiansToDegrees(Math.Cos(u + (2 * v)<1>)<1> + (Math.Cos(12 * u) / 12)))));
s = GeometryColor.ByGeometryColor(NurbsSurface.ByPoints(Point.ByCoordinates(x,y,z)),Color.ByARGB(150,255,150,100));
```

```d
geometry = [Imperative]
{
	a = 0;
	b = 0;
	arrPoints = [];
	for (v in 0..2*180..2)
	{
		for (u in (180/2)..(3*180/2)..2)
		{
			x = ((3/2) + Math.Sin(u+(2*v))) * (Math.Cos(v)+Math.Cos(2*v)/10);
			y = ((3/2) + Math.Sin(u+(2*v))) * (Math.Sin(v)+Math.Sin(2*v)/10);
			z = (Math.Sin(Math.RadiansToDegrees(Math.RadiansToDegrees(Math.Sin(Math.Cos(u+(2*v))+Math.Cos(12*u)/12)))));
			arrPoints [a][b] = Point.ByCoordinates(x, y, z);
			b = b + 1;
		}
		a = a + 1;
		b = 0;
	}
	return List.Clean(NurbsCurve.ByPoints(arrPoints),false);
```

![https://pixabay.com/images/id-331944/](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MOvGZfPqeRWo5yqmj9a%2F-MOvHPE7M4jWnm02v8gf%2Fpringles-331944_1280.jpg?alt=media\&token=d3c0d3ab-8ad1-4ac8-a386-002f9ca4fed1)

![Hyperbolic Paraboloid](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MOvGZfPqeRWo5yqmj9a%2F-MOvHggqPXIrQtpP6ZcK%2FPotatoChip_2020-12-17_05-49-36.png?alt=media\&token=77ba3eac-c8be-440f-829b-265d5720b54f)

```d
//Circular Grid of Points
p1 = Point.ByCoordinates(Math.Cos(0..360),Math.Sin(0..360));
p2 = p1.Translate((p1.AsVector())<1>,(-1..10)<2>);

//Equation
a = 5;
b = 8;
z1 = Math.Pow(p2.X,2)/Math.Pow(a,2)-Math.Pow(p2.Y,2)/Math.Pow(b,2);

//Surface
s1 = NurbsSurface.ByPoints(p2.Translate(Vector.ZAxis(),z1));
GeometryColor.ByGeometryColor(s1,Color.ByARGB(255,252,211,3));
```

![Mobius Strip](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-Lg-6cgTmg9yv-GPo7As%2F-Lg-6qNI9COACocROLub%2FmobiusStrip.png?alt=media\&token=f7a0101c-33e1-443e-867d-29bc67104141)

```d
n = 10;
r = 20;
s = -n..n..#100;
t = 0..360..#100;
x = (r + (s<2> * Math.Cos(t/2)<1>)) * Math.Cos(t);
y = (r + (s<2> * Math.Cos(t/2)<1>)) * Math.Sin(t);
z = s<2> * Math.Sin(t/2)<1>;
points = Autodesk.Point.ByCoordinates(x,y,z);
Mobius = NurbsSurface.ByPoints(points)
```

![Hemisphere](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-LfzxXWdfevMLsNaZW16%2F-LfzxdspVpVucx_EvGZw%2FparametricHemisphere.png?alt=media\&token=4307928d-fef0-43ff-b945-849f48b13180)

```d
//Parametric Hemisphere
r = 10;
b = 30;
c = 20;
u = 0..360..#b;
v = 0..r..#c;
x = Math.Sqrt(Math.Pow(r,2)<1>-Math.Pow(v<2>,2)<2>)*Math.Cos(u)<1>;
y = Math.Sqrt(Math.Pow(r,2)<1>-Math.Pow(v<2>,2)<2>)*Math.Sin(u)<1>;
z = v;
p = List.FirstItem(Autodesk.Point.ByCoordinates(x<1><2>,y<1><2>,z)<1>);

//Cross Bracing
dr = List.DiagonalRight(p,c);
pr = PolyCurve.ByPoints(List.FilterByBoolMask(dr,List.Count(dr<1>)>1)["in"],false);
dl = List.DiagonalLeft(p,c);
pl = PolyCurve.ByPoints(List.FilterByBoolMask(dl,List.Count(dl<1>)>1)["in"],false);
dh = List.UniqueItems(List.Transpose(p)<1>);
ph = PolyCurve.ByPoints(List.FilterByBoolMask(dh,List.Count(dh<1>)>1)["in"],false);
```
