an that HashCodes well ... since they are "unique" per item (even if this - for the one reason or the other - is created at the same location with that) I barely can see how one can use them in order to get rid if "equal" items (Lines in this occasion).
On the other hand ... well ... using HashSets sampling the Line center and testing length and direction ... well ... this works but why bother? > if you are not doing business with code (thus you need this "check" internally) > use the Kangaroo1 component.
That said the topic of "equality" is rather huge and most people are confusing a lot of things on that matter: for instance a point not equal to another ... well ... that's rather simple but a brep "not equal" with some else ... this is not that easy (if it's solvable).…
th one element which is a list of 10 numbers?
I can flatten it and get (I think) a list of 10 elements (even though when I hover over the output of "Flatten" it says "Tree(T) as tree"). I'm surprised I can flatten at all what would appear to common sense to be a simple list of 10 numbers.
I'm hoping that if I can get this answered it will become obvious why we have trees of lists rather than just lists of lists as you would in most computer languages. That's my real goal - to understand the purpose of adding what seems like an unnecessary complication - trees - to the concept of lists in GH. It seems to me as though a "tree" is just a list of other "trees" until you get to the leaves where you can have "lists" which are identical to trees but can have something other than a tree in them. Whether you can have lists of trees or trees with no lists I'm unclear on. Do the leaves of trees have to be lists? Do lists have to be contained in trees? It would appear from the series example where a tree is produced for no obvious reason to contain the list that this is the case but given that you can flatten it, I guess not - or is the "List" I see in the param viewer just another type of "tree"?
I've found many tutorials that talk about how to manipulate trees and lists and I've managed to get along fairly well with them so far, but nothing seems to explain the reasoning behind the existence of trees and the philosophy for how and when they should be used and when lists should/could be used and precisely what the difference is between them.
Sorry to be long winded but I'm so confused!
Darrell Plank
P.S. I've seen David Rutten's diagram with the colored leaves in Grasshopper Primer 2 and that seems helpful. It would appear that trees can only have lists at their leaves and lists can't have trees although I'm not sure that it comes out and says that directly but at least there are no examples of this shown in his tree diagram. I thought I had it down pretty much so decided to test myself. Apparently I'm as confused as ever:
It certainly appears to me that this tree has two levels - a first level with one limb and a second with 10 limbs - and that I should be able to index it with {0;0} and retrieve a tree with one item in it - the list {0}. The panel data seems to confirm this with indices of {0;0;0}, etc. so I put this path in with quite a bit of confidence that it would work and...bust. The error reads "Path {0;0} does not exist within this tree". Huh? Again, I'm just so confused.…
Added by Darrell Plank at 12:17am on January 20, 2015
- Exception occured during processing of command: Grasshopper Plug-In = Grasshopper Font 'Segoe UI' does not support style 'Regular'. Stack trace: at System.Drawing.Font.CreateNativeFont() at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont) at System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont) at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet) at Grasshopper.GUI.GH_DocumentEditor.InitializeComponent() in C:\dev\Grasshopper\1.0\root\src\GH_DocumentEditor.Designer.vb:line 329 at Grasshopper.GUI.GH_DocumentEditor..ctor() in C:\dev\Grasshopper\1.0\root\src\GH_DocumentEditor.vb:line 1779 at Grasshopper.Plugin.Commands.ShowGrasshopperEditor(Boolean ShowUponLoad) in C:\dev\Grasshopper\1.0\root\src\GH_GrasshopperCommands.vb:line 22 at Grasshopper.Plugin.Commands.Run_Grasshopper() in C:\dev\Grasshopper\1.0\root\src\GH_GrasshopperCommands.vb:line 94 at GrasshopperPlugin.GrasshopperCommand.RunCommand(IRhinoCommandContext context) at RhDN_TemplateCommand<CRhinoCommand,RMA::Rhino::MRhinoCommand>.RunCommand(RhDN_TemplateCommand<CRhinoCommand\,RMA::Rhino::MRhinoCommand>* , CRhinoCommandContext* context) --------------------------- OK ---------------------------
I am using grasshopper 0.8.0050 and Rhino 4 SR8. I tried uninstalling it, and then installing it again. The same. It is interesting that until yesterday, everything was fine. What could possibly be the cause of a problem?
Thank you.…
(twice the amount of lines, it'll take twice as long).
If you nest two loops you're iterating over each line, and then you iterate again over each line. So when you now have twice as many lines, it takes four times as long O(N*N) or O(N²)
With an octree you can reduce the second iteration from O(N) to O(log N). The reason octrees are fast is because they allow you to quickly reject large amounts of lines in your set. Lines are no longer stored in a list, but rather in recursive spatial buckets. If we determine that a certain bucket is too far away to possibly yield any valid results, we can instantly skip all the lines in that buckets and any sub-buckets. If you're lucky, you can reject ~85% of the local data in every iteration, which means even large collections of lines are reduced to only a few potential candidates very quickly.
Thinking about this I'm actually not sure now whether lookup in my Tree3d class is O(log N) or O(sqrt N), but the basic principle holds. The reason the resulting algorithm is O(N * log N) is because the outer loop is still O(N) but the inner loop is now replaced with an O(log N) searcher, so you end up with O(N) * O(log N) = O(N log N)
At least that's how I think it works, computational theory has never been my strong suit.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 4:55pm on November 29, 2012
p; 3D Urban ModelingOn the topography subject I get the next message: "One or more boundaries may be outside the bounds of the topo dataset" I'm not sure if it's the .IMG file I'm loading since I found so many IMG files nearing my polyline area (Miami Lat:26 Lon:-81 aprox.) or maybe my polygon doesn't match the topo area? I have no idea why it isn't working :(On the Shapefile subject, haven't been able to find a Building Height SHP File, so far have downloaded around 8 SHP files which only contain Polylines, my solution is to meanwhile randomize Z heights, but of course this data is not "technically" correct.P.S.: I've already tried all example links and also the ones posted by you and Benjamin in this video.Been strugling last few days, hope you can help me, thanks in advance!!…
try now to integrate Geco in an interdisciplinary architectural engineering studio: hoping we can show you some nice applications of your tool, I'll keep you update and sending now details by e-mail. Here the file (very welcome to be shared). It most probably contais trivial errors by me, thanks for helping and giving some tip! Gr. Michela
FILE:
Ok, right, I see the outputs update correctly. Origin of problems must be in some different mistake I do:
- Incident radiation: I am not sure I understand what is going on: why I get so many 'not a number' ? (The Galapagos report is full of NaNs).
Bio-Diversity: 0.887 Genome[0], Fitness=NaN, Genes [89% · 44%] { Record: Too many fitness values supplied } ...
Genome[7], Fitness=NaN, Genes [74%] { Record: No fitness value was supplied } ....
Genome[9], Fitness=NaN, Genes [37% · 11%] { Record: Genome was mutated to avoid collision Record: Too many fitness values supplied }
- Daylight calculations: the geometry accumulates withouth deleting the previous models. As a consequance, results almost do not change after few varations (so, outputs get updated but do not vary). In current daylight definition: the first object being imported is the one where the grid has to fit; its setting makes it cancelling all the other objects during import. All the others, do not delete anything when imported. When running loops (manual or GA) that vary parameters, the entire geometry do not get cancelled - so I guess the loop does not pass back by the cancelling step, but imports only the geometry which has been varied by the parameters using the setting of that import component only? I will then try again by changing the order of the operations, but if you have specfic tips, let me know.
THANKS!
…
" (idiomatic) and easy way of doing things.So here come some basic questions:
Is there a way to create custom components by grouping an existing sub-network together? I'm looking for a way to re-use parts of a program (something similar to subroutines), and to make the network look less cluttered. I found that it is possible to group components (ctrl-g), but this still displays them as separate blocks (too much clutter), and provides no way to re-use a sub-network in such a way that if it is modified in one place, all it's instances (all the places where it is re-used) also get modified.
Is there a component that does nothing, just passes a signal through? Suppose I need to connect block A to blocks B1, B2, B3 (all three get the same input). Then I change my mind, and I decide to connect block C to these three, not A. In this case it will be necessary to change three connections, not just one. I'm looking for an easy way to do this by a single rewiring, not three. (This came up in a practical situation).
Finally, a related question: is there a component that acts as a switch, so I can choose which signal it passes through out of a possible set of choices? For example, suppose that a set of objects can be coloured based on a number of different properties (size, positions, rotation, etc.) I'm looking for a way to switch between these very easily, without the need to do much rewiring.
Thank you in advance for any replies / useful comments, even general ones on how to easily structure a large Grasshopper program/network.…