Clo3d There Are Pattern Points That Are Too Close Together Please Adjust the Scale and Try Again
Growing and Branching Lines – Example 10.four
This script is probably the most circuitous I take written near and then far, but it turned out to be highly flexible and capable of generating a wide range of dissimilar possibilities in the stop. Before trying this out, I would highly recommend looking at the previous Instance 10.iii – Growing Lines since it uses the same logic, with a few additions. If you didn't understand that example, this ane will be pretty difficult to manage. Too, i will only plan on explaining the major new concepts, and not spending time on basic concepts you should already have a grasp of. If yous aren't there yet, though, please read on and at least look at the pictures… 🙂
Initial Setup
This script uses a looping process using the Anemone plug-in to grasshopper. Before any looping script, you demand to pattern the initial setup weather condition. I actually made two versions of the initial setup for this script, and was going to explicate both in 1 weblog mail service, only it was getting out of control, then I decided to dissever it into 2 split up posts. The adjacent example, Example 10.v, has another version of the setup that volition produce very different results, but yous should try this one kickoff. In this version, before Starting the looping, I drew a square "Curve" in Rhino and a few semi-randomly placed points in the middle. The edge bend is divided into using the "Dissever Curve" component to generate evenly spaced points, in this case, 50. From each of these edge points, a line is drawn to the closest of the semi-random points in the middle, its length being ane-tertiary of the total distance to the closest signal. These points can be tweaked a fleck to manipulate the initial conditions.
All these lines are put into a container which I am calling "Live Lines" which volition grow in the looping process. The edge curve is placed in a container called "Expressionless Lines". The live lines will be independent in the aqueduct "D0" of the Anemone component, while the expressionless lines will be in channel "D1"
Ane of the most important aspects of this loop will be to fairly manage which lines are "Live" and hence subject field to further growth, and which ones are "Expressionless" and volition non abound, but will even so exist used for proximity tests, as in the last example. Understanding this concept is half of the central to success on this loop!
Notation I identify ii boosted "variables" indicated with a lavender color, that volition be used in the loop. The first is called the "Average Initial Length", obtained using the "Average" component. This will be used later to make up one's mind how long a line needs to exist before information technology can divide into branches.
The 2nd variable I am calling the "Extension Rate" This is a percentage of the "Average Initial Length", which determines how much the lines will grow each line. The lower the extension charge per unit, the slower the simulation will run, but the more authentic the results volition be. More on this later. While testing the loop, I recommend a slightly college rate (maybe v%) to keep things from running TOO ho-hum, only once y'all are happy with how information technology is working, yous can lower this to get a more precise cartoon. For at present I volition employ a 5% extension rate.
Starting the Loop
In the loop, the "Live Lines" in channel "D0" volition go through a series of tests, i afterward the other, to determine if they volition stay in the "Alive Lines" category, and keep growing, if they will divide and branch, or if they will "Die" and move into the expressionless pile (Aqueduct D1). Every bit the loop progresses, more and more than geometry will be considered expressionless. Eventually, all geometry will dice, in which instance the "Live Lines" channel volition be empty. You volition notice at the top of the prototype below, I put in a simple "Equality" test to run across if the "Alive Lines" container is empty. If the List is empty, the list length will = 0, returning a "Truthful" value. This is input into the "Due east" channel at the end of the loop to finish the whole process. At that place is no point in standing the loop if there is no more geometry to grow.
If the "Live Lines" pile still has geometry in it, the geometry is subjected to the commencement test! Much similar in the final example, the distance from the endpoint of EACH live line is measured to the closest indicate on EACH slice of geometry in the simulation (live or dead). This is washed with the proper "grafting" of points and "flattening" of lines as shown in the image above. In the lesser right, the dashed grey lines testify what these distance measurement await similar for merely one endpoint. The second illustration shows all the total measurements. Information technology is quite a few! I and so sort these distance measurements using the "Sort Listing" component. The closest altitude is always "0" since it volition measure the altitude from the endpoint of the line to the line it is an endpoint of… that is why when we use the "List Item" component next, nosotros take Item "1" (not Particular "0") which will be the distance to the nearest piece of geometry that is not itself, if the list was properly sorted.
This distance is and then tested against the variable "Extension Rate" (marked in Lavander) which I identified and explained in the Initial Setup. If the altitude betwixt the endpoint and the nearest piece of geometry is LESS THAN the extension rate, the line will die. Information technology is too close to a neighbor. This early in the game, in round 0, no slice of geometry fails this detail test, but shortly pieces volition start to neglect. I do a "Dispatch" to move the pieces whose endpoint is to close into the morgue…the geometry that passes the first test stays alive, but will be subjected to more tests coming up… Life is TOUGH…
Last Gasp of Dying Geometry
Well, the geometry sent to the morgue isn't quite dead yet. It doesn't want to go quietly into the nighttime. Every bit a last, dying gasp, it grows… a little chip…before information technology is truly dead. This is a completely optional step…merely I like it enough. Basically, every line grows by the "Distance" between itself and the nearest piece of geometry. I remeasure from the endpoint of the dying lines to EACH slice of geometry (Living and Dead) similar in the previous step, Sort the List, and use the altitude of Item "1" equally in the "Extend" component for the dying lines. Later on this last extension, they movement into the "Dead Curves" pile, never to grow again…
Tests for Partition into Branches
The geometry that is still Living now has to get through some more tests (3 really) to run across if it will co-operative or if it will simply grow more in its current direction. The first exam. Is it long enough? Only once a line has reached a certain length is it eligible for branching. You tin alter the concluding effect of your drawing by playing with this parameter, just in this case, the minimum length that makes you eligible for branching is being 1.15 times (115%) of the Boilerplate Initial Length. You lot volition observe this early in the growth process, only 8 lines out of our initial 50 are eligible, and these ones are in the corners, since the corner lines tended to be longer because of the way we fix our script. Anyways, the viii lines which have reached sufficient maturity are put into i group called "Possible Sectionalization", while the rest is sent back to school to do a little more growing up.
So you're mature enough to divide? Good for you. The next test is pure random luck. Simply similar some things in life. In this case, your chances of dividing are pretty high (30%), but probability sometimes goes against you. In this case, simply ane of the 8 lines passed the test. Information technology could accept easily swung the other fashion, with 4 or 5 of the lines passing. But the lines that failed don't have to loose hope yet. They will be eligible for this exam again in the side by side round (if they don't die >:-) ) since they are assured to pass the minimum growth exam again, and will have another 30% risk next round. As far as the final design expression, a high division probability (like 30%) will accept nearly eligible lines dividing roughly around the same time, creating a more regular pattern, while a very low probability (like one-ii%) will tend to create a more irregular final design. Anyways, the lines that passed this test (in this case one) are once again dispatched into i pile, while the lines that don't pass are sent back to school to do a lilliputian more growing up.
There is ane more than test to run into if the line is eligible for branching. It has to have some growing room. This was a fine tunement I put into the script later to solve a few minor issues, but basically, it keeps you from getting too many "micro" branches that are destined to stop besides before long. A altitude is measured that is more than the incremental growth distance, in this case a bit more than than twice equally much. The circumvolve shown in the paradigm above is simply a graphic illustration of this distance…the circumvolve is not really drawn. If the line passes this test…most will, it will branch in the next stride. Those branches that don't pass volition be immune to keep growing…only with a dark cloud over their head. Their time left is short, and destiny is calling at their door.
Spring! New Life, Growth, and Branching
So all the tests are complete. We accept iii stacks now. Those who failed the showtime test are long cached with the balance in the dead pile and forgotten. Those who passed the branching tests are set up to multiply! And the smaller stems or unlucky mature ones at least get to keep growing! But as nosotros will soon see, the young and the unlucky may have the last laugh.
You volition come across in the image in a higher place, before the branching happens, the "stems" that will dissever are unceremoniously moved into the "Dead" pile. It doesn't even get to grow in its dying last gasp. All this effort…and for what! At least it will alive on though…in its children. Ii new tiny stems will be drawn at its endpoint, whose management and vector is determined from a branching angle parameter. in this case, the angle is ninety°, which volition lead to two branches at 45° angles from the vector of the parent branch. The kids get a slight spurt in life…growing a flake more than than the typical "Extension Rate"… to be verbal, halfway between the "Extension Rate" variable and the "Room for Growth" parameter from the last examination. This is a fine tune to the script I added after, otherwise the new line will be too short and will exist too close to another line (his dead parent!) and will dice earlier life even gets started when the loop starts again. So the children need a bit of a head start in life…Likewise annotation…if the "branching angle" is too low, the two sibling branches will besides be too close to each other in the next loop, and both volition die… Merely for now, the ii new lines are welcomed into the world of the living.
The lines that did not co-operative grow a little bit…equal to the extension rate, and different those who ended up multiplying, alive to see another twenty-four hour period. After beingness extended, they are grouped together with the young new branches, and are all put back into channel "D0" on the loop.
The dead are shuffled along at the bottom of the script, with the long dead, the newly dead, and the dead parents all dumped together into a common grave, and placed into channel "D1" on the loop.
Permit it Roll! Looping
If everything was setup correctly in the loop, you lot can now but sit dorsum and relax and sentry your patterns form. The epitome above shows a snapshot of what the pattern looks similar afterwards every 10 rounds. With the dead geometry shown in black, the living geometry in grey, and the new growth and new branching in ruddy. The saga of life/expiry/and reproduction continues until round 157, when the last slice of geometry "dies" ending the loop. The last blueprint is the terminal fossil tape of our petty game of life.
You lot can now play around with the variables and parameters, or the initial setup if y'all'd like, to run into what other kinds of patterns emerge. When yous see a design you think is promising, it is probably worthwhile to slow the simulation down to become a more than precise drawing.
In the image above, you will see the results of running the loop with various extension rates. 1%, 2%, v%, and x% Y'all can see that the rapidly growing drawing is much less precise, but it can capture pretty closely at least the "experience" of a variation. 10%, even so, while going by in a zip, is probably too imprecise even for quick tests, but 5% in this case works pretty well. Y'all can try even less than one%, but the returns are increasingly minimal, and the number of rounds to generate the blueprint increasingly high.
The script can generate quite a few variations. We will explore some variations in the initial setup in the side by side blog posting, but for at present, you tin see some of the results of changing the number of initial points (1-3), changing the branching angle (4-6), moving the initial points (7), or changing the minimum division length parameter and/or branching probability (8 and ix) You tin can do a bit of mail processing after the lines are generated. here I just gave them some thickness and fabricated them white on a black groundwork.
Anyways, I will testify some more than possible variations in the next Example 10.5. For now though, hither is an overview of the full script (very big!) if you want to try and recreate it yourself.
Source: https://generativelandscapes.wordpress.com/2014/11/22/growing-and-branching-lines-example-10-4-part-1/
0 Response to "Clo3d There Are Pattern Points That Are Too Close Together Please Adjust the Scale and Try Again"
Post a Comment