Spherical Transformations
Transforming with equations
SphereTransformations.zip
3KB
Binary
1
//Spherical Transformations
2
3
n = 11;
4
x = Math.Sin(0..180..#n)<1>*Math.Cos(0..360..#n);
5
y = Math.Sin(0..180..#n)<1>*Math.Sin(0..360..#n);
6
z = Math.Cos(0..180..#n);
7
8
//Sphere
9
p1 = Point.ByCoordinates(x<1>,y<1>,z<1><2>);
10
11
//Sphere Translated and Scaled along Z-Axis
12
p2 = Point.ByCoordinates(x<1>,y<1>,((0.75+z)/(1.75..2..#n))<1><2>);
13
14
//Sphere Translated and Scaled along X-Axis
15
p3 = Point.ByCoordinates(((x+0.75)*(1..3..#n))<1>,y<1>,z<1><2>);
Copied!
Dome Transformations
1
//Dome Transformations
2
3
n = 11;
4
x = Math.Sin(0..90..#n)<1>*Math.Cos(0..360..#n);
5
y = Math.Sin(0..90..#n)<1>*Math.Sin(0..360..#n);
6
z = Math.Cos(0..90..#n);
7
8
//Dome
9
p1 = Point.ByCoordinates((x*(mnx..(mnx+mxs)..#n))<1>,
10
y<1>,(z/(mnz..(mnz+mxz)..#n))<1><2>);
Copied!
Asymmetric Vertical Scaling
1
u = 0..360..#50;
2
v = 0..180..#50;
3
x = (Math.Cos(u) * Math.Sin(v)<1>) * 1.25;
4
y = (Math.Sin(u) * Math.Sin(v)<1>) * 1.65;
5
z = Math.Pow(Math.Cos(0..55..#50),8)*-2+2;
6
7
NurbsSurface.ByPoints(Point.ByCoordinates(x,y,z));
Copied!
Last modified 1yr ago
Copy link