Grasshopper

algorithmic modeling for Rhino

Hello All,

i want to create a loop in grasshopper such that;

i have a segment AB. Divide AB at parameter 0.618 then divide the 2 smaller segments at the same parameter i.e. 0.618 and continue dividing the shattered segments. end in the end i will end up with heaps of points on original segment AB.

I also want control over number of time the loops runs.

can any help me?

Regards,

AB

Views: 923

Replies to This Discussion

Attachments:

Thank you Daniel for taking out time for me, you have been a great help.

Alternative to Daniel's solution, you can solve it mathematically with ghPython.

Function calls itself, feeding a result back into it, using a counter to escape the resulting loop.

Here is a beginner's version without the functional programming ideology that swaps variables around to the detriment of the human mind:

To use Python you must right click the inputs to give them type hints. I also had to reparameterize my curves so they really flow from 0 to 1 for their position parameters, and graft the input so it treats each curve separately.

Attachments:

Thank you Han for taking out time for me, unfortunately i do not know scripting, may be time to learn it!

Thank you Nik for taking out time for me, it is so good to learn different ways of doing a thing. Thank u again

You do know scripting. English language searches of Google for Python and what you want to do in a command gives you peer rated answers galore. You can mostly stick to math to avoid having to learn Rhinocommon or obsolete Rhinoscript. Numbers in, numbers out, let Grasshopper make geometry out of it.

Scripting is only thorny when you have to learn the jungle of Rhinocommon, a rather arcane system of rules and object oriented command structures with dots between them.

[] are lists or lists of lists like [ [], [], [] ] and calling of items in them like My_Variable[5].

len is length, append is obvious, and that's it.

Here's the first hit for a Google search for "get the length of a list python":

http://stackoverflow.com/questions/1712227/how-to-get-the-size-of-a...

You don't need functions or classes for 95% of simple Grasshopper work.

You are right! Whilst, i enjoy working in GH and use generative systems & logic for designs (even at concept stages), but i have realised that my brains are not built to learn scripting ( i had tried it twice), i find it difficult to memorise all the scrypting syntax, rules etc. Also, if i have a big gap between 2 instances where i have used scripting, i forget all the rules and syntax.

You are just ADD. Keep notes. Discover limitations and parameters. Fight for clarity. College teaches kids an upsidedown urinal is "art." And college teaches that coding requires obfuscation. These are all death cult lies.

Similar to my above query, if i have a surface which is divided into Golden mean rectangular cells (in u & v direction) and i want to further divide the each cell into golden ratio ( and keep on doing it until i choose). i have attached a picture.

any solution to that?

regards & Thank you.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service