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
user to understand. RhinoScript is a generally more straightforward and easy to use. You can think of it as a translation of RhinoCommon so that you don't have to write all the technical stuff.
In your first line you've said "import rhinoscriptsyntax as rs". To see the methods you can call from this library you can go to the help menu and choose 'Help for Rhinoscript'. It will show you a searchable window of all the the options you have. This is much easier for new users to learn than looking at the RhinoCommon SDK.
If you search the help file for 'BoundingBox' you'll get the screen capture below:
At the bottom you can see an example of how to use it. In your case you would replace the following lines:
2/ boxA=brepA.GetBoundingBox((0,0,0,)) --> boxA = rs.BoundingBox(brepA)
3/ boxB=brepB.GetBoundingBox((0,0,0,)) --> boxB = rs.BoundingBox(brepB)
The script you have written uses elements of both RhinoScript and RhinoCommonSDK. I would suggest you might start just using RhinoScript. See below, I have re-written the first 8 lines of your script using just RhinoScript:
import rhinoscriptsyntax as rs
#Get BoundingBox from breps.BoundingBoxA = rs.BoundingBox(brepA) #Returns list of eight corner points.BoundingBoxB = rs.BoundingBox(brepB)
#Get centre point of RhinoScript BoundingBox (which is a list of eight points).boxA = rs.AddBox(BoundingBoxA) #Generate box from corner pointsptA = rs.SurfaceVolumeCentroid(boxA) #Get Volumetric Centroid of boxboxB = rs.AddBox(BoundingBoxB) ptB = rs.SurfaceVolumeCentroid(boxB)
For reference the following will achieve the same thing using RhinoCommon, fewer lines, but more technical. There are a few other quirks as well, for example you have to explictly tell the python component what kind of object 'brepA' is. See below for example of same script in RhinoCommon:
import Rhino as rh
centerPtA = brepA.GetBoundingBox(rh.Geometry.Plane.WorldXY).CentercenterPtB = brepB.GetBoundingBox(rh.Geometry.Plane.WorldXY).Center
I'm not sure what you are trying to achieve overall and your loop doesn't make a lot of sense to me but I hope that clarifies some of the differences between the two libraries you can use.
Regards,
M…
own use and added the command line port LPT1 port dump.
I found a couple of strange things in your code:
# Changes the model units to inches, but does not scale model.rs.UnitSystem(unit_system=8, scale=False)
Why did you change the model units here? HPGL units are 40 per mm (which is also 1016 per inch) staying in mm units in your model will be fine if your step scaling in right.
And doing this seems strange for a cutting program:
allCurves = rs.ObjectsByType(4)for curve in allCurves: if (rs.CurveDegree(curve) == 2 or rs.CurveDegree(curve) == 3) and rs.IsPolyCurve(curve): rs.ExplodeCurves(curve, True)allCurves = rs.ObjectsByType(4)
Cutting usually needs a closed curve to produce a nice clean removable piece from the material. Your approach results in a bunch of line/curve segments instead of closed polycurves/polylines. As this simulation shows the 'O's and 'R' are cut as a collection of curve segments - not closed polycurves:
I just removed this step from the code.
As this simulation shows every part of the font is cut in one cut action - exactly what I needed:
I saw your RVB code on the RhinoScript site too - was way more detailed than I needed - my vinyl cutter only has one 'pen' - the cutting blade. I just needed a really basic way of getting polycurves into HPGL format and firing it out to a printer port.
Thanks for your help on this little project - I'm very stoked at the result! Let me know if I can help with your cutter project.
Cheers
DK…
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,…
to a rationalized integer format for use in the grasshopper definition . I don't want to convert the information permanently, but have been looking for an elegant method for converting the datetime string as needed so that it can interface within a grasshopper definition.
What I am trying to do is create a process for working with the timestamp included alongside sensor data I pull from Cosm. The data feed is formatted like this; <current_value at="2012-07-25T05:24:44.601988Z">77.68</current_value> and the Time paramater seems to easily understand the datetime string to read 2012-07-25T05:24:44.601988 as Wednesday, 25 July 2012 (05:24:44) so I plan on keeping the string as is when stored in a local mySQL database I have setup, but want to make sure I am not setting myself up for major headaches down the road.
I asked about converting the date time string to an integer to allow me to find time spans and generate a series of time stamps in an efficient way for creating a batch/ iterative process for requesting additional sets of data based on a query comparison of what gaps are left to fill in along a timeline of data points.
At the moment, I think a conversion to an integer is my best bet. (ref; Excel Date Time Code Id love to be able to feed in a date into a math component, add 08:00:00 and for it to result with a time 8 hours later than the first. I also have a string manipulation method working also, but have yet to really test it beyond what I have shown in the screenshot below.
I currently have these batches stream from Cosm.com into Grasshopper via a xml parser component (either the one found in Andy Payne's Firefly set, or the one included in gHowl.) From there I sort/ extract the data points and their respective time stamps and feed these data points into a mySQL database I've setup with Nathan Miller's Slingshot components. With the points in a local SQL database, I can then begin to integrate the use of database queries into definitions and retrieve data points based on sensor value Booleans rather than being restricted to time spans, (which is the only way to request historical data from Cosm's site)
I've been debating on if I should convert all the time information to an integer before writing it to the SQL database so GH can work with the data, or if I should keep the time code as a string and create a couple of conversation component clusters to translate the information each time it needs to be processed or manipulated in GH. I'd prefer to keep things in the date time string because the database can handle it without a problem, GH sort of handles it in one translation direction and allows me to avoid conversion that Id have to explain to others if they were to access the database in their own grasshopper definition or from another application.…
of them. If they were already suggested and deemed impossible, i apologize.First, it would be really cool to have a right-click menu item for any geometry retaining module, that does the following: bakes the geometry, then disconnects all inherited data from the module, and assigns the baked version as locally defined. This is a one-time only thing, of course - it would be cool because if you have a "step-definition", that is, you have clear bottlenecks in your dataflow, and at some point you become satisfied with what you have so far, and only need to manually tweak some stuff to move on, you can discard the "already solved part of your definition. It's just a sort of "casting in stone" of partial results, that helps especially with simple work-defs or helper-defs. You could also call it something kickass like "manual override" or "emergency/hand b(r)ake".Second, if you have a component that outputs to a lot of others, and you want to change it with something else, you usually have to painstakingly reconnect all those wires, and if it doesn't work out, you do it right back or undo until you fingers bleed. Just as there is an extract parameter upstream for locally defined values, a downstream "extend parameter" with one rightclick menu item would make switching between various components easier.
Third, maybe a hot-key that you press and then click on a wire, which creates a "data" component at that point, splitting the wire and effectively allowing you to hijack it.
Lastly, maybe this is a stupid question, but what happened to the "clusters"? I mean i know they ended abruptly because of technical difficulties, but collapsing a group to a single component like that was totally awesome.Oh, and a minor bug repor from the v7.053 - it's not important, but mildly annoying: when you have an embedded graft, flatten, reparam or expression into a plug, the component extends to the left with the nifty little icons, and that looks very nice, but the wires still go in the old place, so at first glance i always think the wires are plugged in wrong. Is it possible to move the plug along with the component icon edge, or at least make those little indicators smaller, so that the error is minimized?
Thanks for your time,Hope i was pertinent
Andrei I.ps: the lolcat component is adorable, but i do believe that overall worldwide grasshopper productivity has dropped by various increments of those 20 sec it takes for it to refresh. Sadly accustomed with the feeling of guilt associated to watching around 50 lolpics refresh, I suggest that every 5 refreshes or so, you get a "stop looking at this and get back to work" message. It is at least a good way to derogate responsibility for tempting people to watch kitty-pics all day. :D…
es at the beginning. But as I make changes to the input (or just hit the recompute button) the time it takes to execute increases. This has happened to me with other scripts I've written with the python component. Why does this happen? And how do I fix it? Does python hold onto data from one execution to the next? The only solution I have found is to relaunch Rhino. Even if I copy the component into a fresh grasshopper canvas, the computation time does not return to original.
The images below illustrate the time increase. I simply hit the recompute button between each pass. All inputs remain the same the whole time. There are 6400 curves being projected. I will say that with fewer curves, the increase in time is nonexistent or perceivable. (I have 24 GB RAM and it is did not even reach 50% of usage during the tests)
My python code:
import ghpythonlib.components as ghcompimport ghpythonlib.parallel
def project (tempc): tempresult=ghcomp.Project(tempc,B,D) return tempresult
a=ghpythonlib.parallel.run(project,C,True)
I have attached the GH file with the inputs internalized if anyone wants to try for themselves.
Pass 1= 444ms
Pass 5= 610ms
Pass 10= 908ms
Pass 15= 1.2s
Pass 20= 1.4s
…
Added by Lawrence Yun at 3:19pm on December 10, 2014
ace Syntax." eCAADe 2013 18 (2013): 357.
http://www.sss9.or.kr/paperpdf/mmd/sss9_2013_ref048_p.pdf
The measure Entropy is newer. I hereby explain it (from my PhD dissertation):
Entropy values, as described in (Hillier & Hanson, The Social Logic of Space, 1984) and specified in (Turner A. , “Depthmap: A Program to Perform Visibility Graph Analysis, 2007), intuitively describe the difficulty of getting to other spaces from a certain space. In other words, the higher the entropy value, the more difficult it is to reach other spaces from that space and vice-versa. We compute the spatial entropy of the node as using the point depth set:
(11)
“The term is the maximum depth from vertex and is the frequency of point depth *d* from the vertex” (ibid). Technically, we compute it using the function below, which itself uses some outputs and by-products from previous calculations:
Algorithm 4: Entropy Computation
Given the graph (adjacency lists), Depths as List of List of integer, DepthMap as Dictionary of integer
Initialize Entropies as List(double)
For node as integer in range [0, |V|)
integer How_Many_of_D=0
double S_node=0
For depth as integer in range [1, Depths[node].Max()]
How_Many_of_D=DepthMap.Branch[(node,depth)].Count
double frequency= How_Many_of_D/|V|
S_node = S_node - frequency * Math.Log(frequency, 2)
Next
Entropies [node] = S_node
Next
…
Meeting Agenda:
1) Discuss what the group would like to learn this term through our regular scheduled meetings. Topics include the priority and sequence of Grasshopper exercises we would like to explore during the winter term from http://www.digitaltoolbox.info/grasshopper_basic.html and Processing tutorials from the Processing Handbook I received from MIT.
2) Watch the Matt Storus Church Machine video and have a discussion about parametric and generative tools in design.
If you have a chance, please read the following article by Tim Love called Between Mission Statement and Parametric Model at:
http://places.designobserver.com/entry.html?entry=10757
3) Discuss a possible design build project over the following winter and spring terms using the skill set this group is developing. Conversation led by Chris Nielson (please see comments below for a brief backstory)
4) Discuss possible applied research and design work for the National Conference on the Beginning Design Student paper, Machine Craft and the Contemporary Designer: exploring parameters and variables through making physical artifacts. I wrote the attached abstract and submitted it for the conference the past fall and it was accepted. To continue with the research I need to assemble a team of students that will help explore the principles I set forth by making physical objects with the cnc router. In exchange for helping with the research I will show participants how to use the cnc router, how to author machine code and provide you with the cnc controller interface software necessary to simulate machine movements. Not to mention, your work will be sited in the research paper I present at the conference at UNC Charlotte in March. More tomorrow night, of course.
Thank you for your interest and I hope to see you there.
Sincerely,
Erik Hegre
Chris Nielson Reply by Eugene Parametric Society on January 7, 2010 at 12:02pm
All,
In response to Erik, who requested that I describe my intentions in a design-build project and to the article posted (definitely required reading for this group) I propose that we begin development of a project that spans the realm of "sustainable social" architecture and parametric design. The particulars of such a design do need to be made concrete, and it will be important to define the goals of such a project.
Therefore, I would suggest that this serve as a forum for the next few weeks for those interested in producing a built project. I agree with Nico that it may not be feasible to create the built piece, whatever it may be, this term; however we should have the groundwork and a plan in place by the end of the next 10 weeks.
Either way, I would ask that everyone who is interested to please provide as many concepts to this forum to begin a discussion. If you are indeed interested, please submit goals that this project could achieve (energy, socially, aesthetically, economically, related) and perhaps what you envision the project to physically be (shading device, public bench, water catchment, interactive thermal contraption, etc . . . )
I look forward to hearing your thoughts!
Cheers,
Christopher…
st variety of papers (mostly related with LIDAR airborne sampled clouds) ... but ... hmm ... no code (other than some "abstract" algos that may (or may not) work). Reason? A very hot cake that one these days: from reverse engineering to DARPA founded future defense systems and up to cruse missiles pattern recognition algos.
The solution (obviously doable only via code) is the so called flat hard clustering ... were points are sampled into clusters based on the coPlanarity "rule". For large amounts recursive octTrees (an oriented box divided in 8 "partitions") subdivisions are used and then pts are processed in parallel (and then clusters are re-evaluated in order to "absorb" other clusters with same plane A,B,C,D vars etc etc).
See what's happening in a very carefully made test point collection:
3.7 ms and the "ideal" clustering (7 search loops VS the max 42M theoretical threshold):
Depending on the pts "preparation" ... a considerable more time/search loops is required ... and ... well ... also "valid" clusters (4 points and up) made:
So "ideally" speaking in your case:
1. Mesh faces center points (or alternatively: mesh vertices) are sampled into a pts collection .
2. Hard flat coPlanarity clustering is attempted yielding pts/planes in equivalent DataTrees.
3. Planar Breps are made with respect the planes (like the black things captured above) and sampled, say, into a breps List.
4. The method Brep[] solids = Brep.CreateSolid(breps); is used for attempting to create your desired "engulfing" brep. This method is very slow mind (other waaaay faster approaches also available).
…