Grasshopper

algorithmic modeling for Rhino

Hello :-)

I'm doing a spiral in c# to make a component after.

I'm not very good yet at coding in grasshopper, but I'm giving lot of passion to reach an acceptable level.
My coding background is on Unity, and its quiet different.

Anyways, I think this little exercice its a child's play for some of you.

The idea its to make the component more robust.
First I'm doing it in Rhino and then I will make a component with that spiral.

I writed annotations around in the grasshopper file.
It will be lot easier to understand than a text here.

Its quiet funny because, I didn't find any spiral with C#/Vb/Python here.
Then I can propose that one I guess !
I hope I'll find some fixes, let see.

Hope you'll be interrested to play also ^^.

Some helpfull links :
http://www.designcoding.net/archimedean-spirals/

https://computergraphics.stackexchange.com/questions/1820/archimede...

http://www.gecode.org/doc-latest/reference/classArchimedeanSpiral.html
https://www.comsol.com/blogs/how-to-build-a-parameterized-archimede...
http://www.java2s.com/Code/CSharp/2D-Graphics/Spiral.htm
http://www.grasshopper3d.com/forum/topics/spiral-1
http://members.tripod.com/~Paul_Kirby/quantum/param.html






The code
:

    Point3d newCoord = new Point3d();


    newCoord = P;

    IEnumerable < double > squares = Enumerable.Range(start, end).Select(x => ( (P.X) + ((((((D / N) * x)) * Math.Cos(((D / N) * x)))) * factor)));
    IEnumerable < double > squares1 = Enumerable.Range(start, end).Select(x => ((P.Y) + ((((D / N) * x)) * Math.Sin(((D / N) * x)))) * factor);


    foreach (double num in squares)
    {
      //Print(num.ToString());
      xPoints = squares;
    }

    foreach (double num1 in squares1)
    {
      //Print(num1.ToString());
      yPoints = squares1;
    }

    foreach (double num1 in squares1)
    {
      //Print(num1.ToString());
      zPoints = newCoord.Z;
    }



Views: 3134

Attachments:

Replies to This Discussion

Just to say i put a component here, sorry discussion in French
http://www.grasshopper3d.com/group/grasshopper-french-users-group/f...

Salut Laurent,
Merci beaucoup pour le lien je vais regarder ca t’inquiètes pas pour la langue je parle français :-)

A bientot !

Thank Tom for your answer, I'll check that out!
And of course the component already exists, but I need to build a component because than it will be updated with other in-built features that I need in a plugin.

for the spiral "like-curavture" could be indeed very interresting, do you have exemples ?
I'll take a look how we could build that :-)
Also it could give more control, because basically I think all our exemples now are interpolated and with some lack of flexibillity I guess.
Regards,

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service