algorithmic modeling for Rhino
Supershape%20test.ghHello Friends
Someone can help me .....
I would like to create a script for a Supershape, I saw the old one
definition of Nathan Miller, but the VB node fails and I can not activate it -
In this case I would like to create it from traditional nodes-
I attach my definition, which does not make me the desired form (closed)
What am I wrong about? I can not understand......
I thought I had well interpreted the formula, but obviously it is not so-
Thanks in advance for your help
alberto
Tags:
Many thanks Daniel
But not being a great Math ... I can not understand ,
even visiting the site and seeing the videos , where I'm wrong.....
perhaps writing the Formula ....
I also tried in k3d surfing ... in the Software Library
the formula called Star 7 is identical to my ...
Take care of yourself, considering your skills in the subject
I'm confident
Thanks again
alberto
File attached
private void RunScript(int num, int num1, double num2, double num3, double num4, double num5, double num6, double num7, double num8, Interval interval, Interval interval1, ref object A)
{
//Points for supershape
List<Point3d> point3ds = new List<Point3d>();
//Inputs
double min = interval.Min;
double max = interval.Max;
double min1 = interval1.Min;
double max1 = interval1.Max;
double num9 = Math.Abs(max - min) / (double) (num - 1);
double num10 = Math.Abs(max1 - min1) / (double) (num1 - 1);
double num11 = 0;
double num12 = 0;
double num13 = max;
double num14 = num9;
//Loops for points manipulation
for (double i = min; i < num13; i += num14) {
num12 = 0;
double num15 = 1 / Math.Pow(Math.Pow(Math.Abs(Math.Cos(num2 * i / 4) / num3), num6) + Math.Pow(Math.Abs(Math.Sin(num2 * i / 4) / num4), num7), 1 / num5);
double num16 = max1;
double num17 = num10;
for (double j = min1; j < num16; j += num17) {
double num18 = 1 / Math.Pow(Math.Pow(Math.Abs(Math.Cos(num2 * j / 4) / num3), num6) + Math.Pow(Math.Abs(Math.Sin(num2 * j / 4) / num4), num7), 1 / num5);
double num19 = num15 * Math.Cos(i) * num18 * Math.Cos(j);
double num20 = num15 * Math.Sin(i) * num18 * Math.Cos(j);
double num21 = num18 * Math.Sin(j);
Point3d point3d = new Point3d(num19 * num8, num20 * num8, num21 * num8);
point3ds.Add(point3d);
num12 += 1;
}
num11 += 1;
}
//Output
A = NurbsSurface.CreateFromPoints(point3ds, (int) Math.Round(num11), (int) Math.Round(num12), 2, 2);
Hi Petras you are a Ginius
Many Thanks...........
Is there a way to make definition without ( C or Vb or Pyton ) Script ?
I think , its a best manner to Know Definition in the "Deept"
Have a nice day
alberto
What is happening inside is that you have those list of points and then apply math functions in double for loop. For sure it is possible to convert to components .
I suggest to go through the script line by line and translate it to grasshopper gradually.
I am not that good with expressions in grasshopper
HI Petras
I'll try ... but I do not know if I can.
Maybe some good soul, reading the post
will give us the solution
let's hope
Thanks again
alberto
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson.
Powered by