difference consists of.
An Evolutionary Solver/Genetic Algorithm is an implementation of Metaheuristics. Metaheuristics tend to be flexible solvers, applicable to a wide variety of problems, fairly easy to implement, but slow. Other examples of Metaheuristic algorithms would be Random Search, Scatter Search, Simulated Annealing and do on. These algorithms are often modelled on physical or biological processes.
Simulated Annealing for example simulates the physical process of annealing (who'd have thunk it), which is basically the slow cooling of a material which allows it to settle into a crystalline lattice, i.e. a low energy distribution of all the atoms. I'm currently adding an SA solver to Galapagos, and in fact just yesterday managed to get the first successful run: http://www.youtube.com/watch?v=VWtYLv-4oP0
Metaheuristics are especially useful for those cases where little is known about the problem ahead of time. If the problem search-space is mathematically well defined (differentiable, especially), then you can use more targeted algorithms such as the Newton-Raphson method, Pareto-search or Uphill search. You can still use these methods on non-differentiable search-spaces, but it involves sampling the local region to death to get an estimate of the differential. This can be a very costly enterprise, especially in high dimensional search-spaces. In a two-dimensional search-space you'll need 3 to get a lame estimate and 4 to get a halfway decent estimate and 8 to get a good estimate. In three-dimensional search space you already need 26 samples, and the number of samples grows exponentially with higher dimensions.
If you have a specific problem you're trying to solve, Metaheuristics are probably not the best solution, even though they may be easiest to program. Rhino uses something akin to Newton-Raphson for certain problems and that's fast enough to run in real-time.
Divide-and-Conquer algorithms are also quite popular. Sometimes they are called Binary-Search or Tree-Search algorithms as well. Their basic premise is to sample the search-space at a few intervals (but enough to capture the needed detail), then find two neighbours with promising values and sample again in between these two. Then repeat. Each new iteration typically doubles accuracy, which is great because then you only need ~30 ~40 iterations to get an answer as good as possible with double-precision floating point accuracy. However not all problems lend themselves well to this sort of search and in higher dimensions it starts getting slow with disconcerting alacrity.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 1:54am on August 15, 2011
ub) but this update method comes with a caveat. If a more recent component has a different number of inputs/outputs or the names of these inputs/outputs are different, the component will fail. This is because the python code inside the component is up to date but the component, as a whole, is not.
I attached a GH file with the correct glazing ratio component, which I updated manually. To get the glazing component that I used in the video, you need to sync with the version of the components on the github.
In order to do this, the process is a bit convoluted these days since Github has stopped allowing automatic downloads but here are the steps for the best way if you don't plan on updating frequently:
1) Download a copy of our most recent code to your computer by going here (https://github.com/mostaphaRoudsari/ladybug) and clicking on 'download ZIP.'
2) Unzip the file and you should see one folder called userObjects. All of the files in here will be most up-to-date LB userObjects
3) Delete your old Ladybug+Honeybee userObjects by going to File > Special Folders > User Objects Folder in the GH program window and deleting all of the LB+HB components there.
4) Drag the new Ladybug userObjects from the unzipped location onto your GH canvass.
Your components are now up-to-date.
Be wary that, if you stay up-to-date with the github, the overall version of the components might not always be as stable as that which we release at the official download link but you will get access to all of the new features that we are building in. This includes things like the breakUpDist_ on the glazing component.
Glad to be of help! Right now, the best way that you can help and support LB+HB is just by spreading the word to your colleagues. The larger the community, the more that we can help each other. Also, testing out the tools and reporting issues is a huge help to us and allows us to find bugs that we would never be able to find on our own. In a few more months, we will be putting together a Wiki and this will include a lot of places for awesome users like yourself to contribute with example files from your projects, videos, and even scientific discussions / research papers that you have found relevant to the project. Lastly, I think we will have a LB+HB T-shirt drive at some point since there seems to be a good demand for this.
Stay awesome,
-Chris…
e= -3
e = -4
Setting exposure values is a "post-processing" thing done to improve the display of the image on a device or photograph. So, your analysis will still be physically based. I think towards the end of his video Mostapha talks about how the exposure values can be set through Honeybee....
…
= new Point3d(0, 0, 0); b = new Point3d(0, 0, l); Line x = new Line(a, b); Curve m = x.ToNurbsCurve();
if (x == null) return;
Point3d[] points; m.DivideByCount(50, true, out points);
//for (double itr = 0; itr < 50; itr = itr + 0.01) //{ double frac = 50 / 230; int itr = 0; foreach (Point3d point in points) { while (true) { double imtr = (50 - itr) / frac; itr++; Color colour = ColorFromHSV(imtr, 1, 0.5); int rgb = colour.ToArgb(); if (_hash.Contains(rgb)) continue;
_hash.Add(rgb); _points.Add(point); _colours.Add(colour); break; } //} } for (int i = 0; i < _points.Count; i++) cd.AddPoint(_points[i], _colours[i]); }
// <Custom additional code> private readonly HashSet<int> _hash = new HashSet<int>(); private readonly List<Point3d> _points = new List<Point3d>(); private readonly List<Color> _colours = new List<Color>();
/// <summary> /// This method will be called once every solution, before any calls to RunScript. /// </summary> public override void BeforeRunScript() { _hash.Clear(); _points.Clear(); _colours.Clear(); } public static Color ColorFromHSV(double hue, double saturation, double value) { int hi = Convert.ToInt32(Math.Floor(hue / 60)) % 6; double f = hue / 60 - Math.Floor(hue / 60);
value = value * 255; int v = Convert.ToInt32(value); int p = Convert.ToInt32(value * (1 - saturation)); int q = Convert.ToInt32(value * (1 - f * saturation)); int t = Convert.ToInt32(value * (1 - (1 - f) * saturation));
if (hi == 0) return Color.FromArgb(255, v, t, p); else if (hi == 1) return Color.FromArgb(255, q, v, p); else if (hi == 2) return Color.FromArgb(255, p, v, t); else if (hi == 3) return Color.FromArgb(255, p, q, v); else if (hi == 4) return Color.FromArgb(255, t, p, v); else return Color.FromArgb(255, v, p, q); }
Gives this error
1. Value was either too large or too small for an Int32. (line: 0)
…
, but without modifying the lists order:
suposing i have a structure list
(Paths = 75)
{0} (N = 51)
{2} (N = 51)
{3} (N = 51)
{4} (N = 51) ...............
I`m trying to apply to that list of values the statement:
if x>y then x=0
if x<y then x=x/z
but i need the list structure to keep exactly the same.
I`d be very thankful for any ideas on how to approach this problem.
Many thanks,
Roberto
…
r. I have a substantial amount of help from another member of the community, but I find myself stuck again. I cannot get my hexagons to rotate in the XZ and YZ directions. I am not even sure what module I would use for that. It was suggested that I rotate the planes before I actually create the hexagons, and in that scenario I encounter the same issue. I am not sure what module to use for that. I am going to attach the two scripts I am working with right now. The one below the first is my current one. There is a hole where the rotation should be occurring, though. Any help would be greatly appreciated. If you have not seen my first post, this is what I am attempting to accomplish:And these were the great instructions I was given originally: "Reply by Andrew Kudless yesterday
Kevin,
Try this:
1. On each point place a XY plane
2. Rotate each plane in XZ and in YZ by random amounts (make sure you have different seeds in the random component)
3. Use the Polygon component to make a Hexagon on each plane. Use a new random component (with a new seed) for the diameter of the hexagons. Use a domain component and sliders to set the minimum and maximum random diameters.
4. You can make the curves into solids in a couple of ways:
4a. Input the hexagon curves into a planar surface component to make flat surfaces. Next extrude the surface in the direction normal to the plane to make a solid
or
4b. Extrude the hexagon curves in a direction normal to each plane. Then use "Cap Planar Holes" to make the extruded surfaces into solids. " If anyone can help me with my most current issue, that would be extremely helpful. Thank you, Kevin
…
Added by Kevin Miller at 1:05pm on January 21, 2013
.
For my project I want to make a sphere or spherical-like shape and pack it with circles of varying sizes. The circles all have to touch each other and thus on a point where three circles 'sort of' meet, there can only be three circles. This is shown in the second picture I have attached, a 2D circle packing made by Daniel Piker. So basically what I want to achieve is having the second picture projected on a 3d surface, that I can also edit. Also I would like to be able to change the size and amount of the circles that populate the surface. This means that I would be able to say 'there should be 30 circles with a radius of 2, 40 circles with a radius of 3 and 50 circles with a radius of 4, put them on this particular shape'.
As I've just started the project I haven't done so much research yet. What I have found is for example this Kangaroo definition of circle packing in 2D: http://www.grasshopper3d.com/group/kangaroo/forum/topics/circle-packing-definition?xg_source=activity
It is very beautiful and does exactly what I want to achieve, except that it is in two dimensions. I also have to say that I feel pretty confident working with both Grasshopper and Rhino, but not really with Kangaroo. I have used it a few times but not extensively.
So what I'm wondering is, how could I best approach this project? I looked into the concept of 'circle packing' and I noticed that it can be approached very mathematically. As I am an architecture student I don't know much about the math behind the geometry (although I do think it is very interesting) and thus I'm wondering if I will be able to achieve what I want to achieve. Also, do you think I could best approach the project in Kangaroo and do you think it is realistic for me to think I could finish the project? I'm just trying to see if I'm not going to try to tackle a problem that is very difficult to solve even for skilled mathematicans or something. Sorry for the long and perhaps vague read, but I would be very happy with any sort of input you might have on my problem!
Thanks in advance!
…
ported to Rhino and "set" in Grasshopper, i trim both surfaces from their rectangular bases so that when sDivide is used it creates and distributes the same number of points on each surface.But heres the problems: a) if i use the "trimmed" surfaces with SrfGrid it errors warning: "A point in the grid is null. fitting operation aborted".I'd learned this was caused by "nulls" replacing position Data Items when the rectangular grid(surface base) was trimmed away. So i used Clean Tree which worked removing all nulls, then Shift Paths\Flip Matrix to create line-endpoint pairs for Polyline\Evaluate Curve. I Flattened the last Flip Matrix placing all data items in one source for SrfGrid, like in the working Untrim\CopyTrim definition.This time,.b) SrfGrid errored with: "The UCount value is not valid for this amount of points",.So, i substituted a 356 value, numeric Slider in the Addition B param., and tested its range until a valid UCount was found. Then SrfGrid fitted a surface thru the points, BUT,d) those SrfGrid surfaces are extremely deformed even thought the points preceding it from Evaluate Curve are accurate,SEE: def: "3b-RGH_SurfaceBlend.gh",AND,.a2) if i use Untrim with CopyTrim then SrfGrid works, but since the Jokers limbs WILL be in different surface positions then the blends between the Arm (for example) will rise from its relative FLAT position on the untrimmed Source surface to the Arm on the Target surface, rather than morphing from the Corresponding Arm position on the Source surface,. ..see def.: "4-RGH_SurfaceBlend.gh"So please let me know,..1) how to produce accurate surfaces from SrfGrid in def.: "3b-RGH_SurfaceBlend.gh",. ..(NOTE: BOTH these def's contain 2 indentical, "internalized" surfaces, but if def. 3b can be made to work it will also work with Dis-similar surfaces)2) which component to use or how else to determine the correct UCount value for a specified amount of points(ie:155), re: SrfGrid error: "The UCount value is not valid for this amount of points",.3) how else to force SrfGrid to work with Trimmed surfaces?, AND,..4) how to force intersurface, point-blend correspondence lines: Polylines(PLine) to be connected between correctly! correponding positions (Limbs) on the surfaces?,
Really! appreciate all help, definitions and kind generosity common to this knowledgable membership,
Cheers!,
Jeff…
aching my skill set here, but bare with me.
I want to create an animated facade of squares which rotate depending on a sequence of grey-scale images. I've got pretty far thanks to many discussions here, but have hit a blank with exporting my animated model to 3ds max.
Here's my GH script - it's a botch of 3 or 4 various things incorporating centipede at the start and end to get the animation.
All good and it works! It produces animations which I can sequence for presentations too thanks to it's bmp export, which is sort of a side-product.
What I have a problem is that the OBJs it produces error wildly when imported to max. eg in rhino it looks like
But when I've imported them to max it looks like
and as it animates it just gets longer and smaller.
NOW I reckon it might be because my model in grasshopper is 100 separate geometries and it'd like it to be a single one - but I've not achieved that.
Does anyone have any ideas how to solve this? My end result I would like to look like this rendered still from max, but animated.
Thankyou all! This also uses Firefly, so you might need that installed to see how my file works.
…
Added by chris parrott at 10:34am on September 11, 2015
t ''Morph'' turns Red saying ''Cannot morph from a degenerate box'' (image 2),
that's because every curve generates a box (image 3).
After what i check the Option ''Union'' box to make only one box for all the curves (image 4).
However, the result is aleatory and not accurate at all ... :/ (see image 6).I know you are developing Pufferfish and not ''Morph'' component, but recently you publish on instagram a video where i believe you could morph and Twist with success a collection of curves (please see image 7 and 8)...If you could give me a hint how that can be achieved, it would be awesome.(Piping/Meshing the curves with very small diameter will perhaps work and help for visualisation purposes, but i actually just need morphing Raw curves for fabrication purposes).Hope to read you very soon...Ghali,…