imes. Your loop should go to y.Count - 1. Or, you could use a For...Each loop, circumventing the problem altogether:
Dim shortLines As New List(Of Line)
For Each segment As Line in y
If (segment.Length < x) Then
shortLines.Add(segment)
End If
Next
A = shortLines
--------------------------------
Another problem is this line of code:
New_Lines.Add(New_Line)
It is located inside the loop but outside the If statement, meaning it gets run every single iteration. This fills up the short line list with duplicates.
-------------------------------
Here's something else which is redundant:
Dim Input_Line As New Line
Apart from the fact that you don't need a special variable for this at all, you also don't need to add a New keyword. The type Line in RhinoCommon (just like Point3d, Vector3d, Plane, BoundingBox etc. etc.) are Structures, not Classes. Structures always exist when they are defined, whereas Classes can be null ("Nothing" in VB).
-------------------------------
Some more advice:
Dim i As Integer
For i = 0 To y.Count()
You can merge these two lines into one. VB.NET allows you to declare your iteration variable inside the loop:
For i As Integer = 0 To y.Count - 1
--------------------------------
If you don't like the For...Each approach at the top of this answer, here's how to write this using a For...To loop:
Dim shortLines As New List(Of Line)
For i As Integer = 0 To y.Count - 1
If (y(i).Length < x) Then
shortLines.Add(y(i))
End If
Next
A = shortLines
ps. A personal preference of mine is that I always encase the expressions inside If...Then statements in brackets. You technically don't need to do this, but I find it makes the code more readable.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
itects are at the spoke of a number of different specialties, and their work affects many different people. It's not like an architect is a painter, whose work may offend or upset the occasional viewer. As an architect you have a responsibility to produce quality work. How can anybody trust you with this responsibility if you're taking a purely artistic approach? What guarantees do you have that your clients money won't be spend on a poorly designed project if you can provide no rational for why your design is the way it is?
2. What is any sense in purely architectural discourse?
I don't get. Discourse is there to flesh out problems and agree on solutions. It might not always accomplish that, but what's the difference between talking about architecture as opposed to any other topic?
3. strictly looked, can be determined sense generally in a purely architectural discourse?
I'm sorry I don't understand.
4. What is purely architectural discourse?
I imagine it's having a discussion where you only talk about architecture?
5. What is Funktionalismus or Rationalismus without philosophical support?
Functionalism and Rationalism are ideologies. Some would even call them methodologies. They are inherently philosophical things as they are nothing more than a collection of ideas and views. As a society we've decided that a certain level of rationalism is a good thing. The Enlightenment continued this trend after the Dark Age hiatus and it quickly led to a large number of very tangible benefits for almost everyone.
I'm not arguing for or against Functionalism as an architectural style. I'm asking for a measure of rationalism in our academic process.
6. Would not be the pure functional fulfilment empty ?
Let's find out. In the meantime I'll settle for a little functionalism.
7. Would be not a critical position on the promise of purely rational algorithms applied?
Algorithms and algorithmic design are rational in the sense that they do not allow for ambiguity. But that doesn't make them rational in the real-world sense. These are not the same kind of 'rational's. I can make an algorithm that produces total nonsense, but does so completely reliably. I can also use an algorithm in a setting for which it wasn't intended, thus invalidating the results.
This is actually the crux of the problem. Which algorithms does one use to solve a problem and what data do they require? If you can't answer this question or if you do not understand the algorithms you are using (at least on a superficial level) then I'd say you have no business using them.
--
David Rutten
david@mcneel.com
Tirol, Austria…
Added by David Rutten at 12:48pm on August 19, 2013
taTree.
2. Since GH is acyclic by design we can't pick individually (without code, that is) our "picks" for the iceberg ... thus we need a global policy applied to ALL grid points at once.
3. This is what the next part does: it picks randomly some iceberg stuff and modifies their Z by a random value. If the Z is always "above" the grid or not it depends upon the domain of values to operate. Seed means "roll the bones again" (meaning another collection).
4. So we have the modified points Data Tree (that are steady - acting as the tips of the iceberg). Let's call them Anchors.
5. If we subtract set 4 from 1 we have the points prone to vary according some manipulation. Kangaroo does that manipulation (this is the best add-on that GH has to offer by 1M miles made by a very clever fella).
6. But if we instruct Kangaroo to do the job... he makes chaos since the points in 4 are not sufficient: we need perimeter steady points that act as Anchors as well. So we manage some logic to pick a variable set of perimeter points and we "merge" 4 and 6 and we have the final set of Anchors on hand - whilst all the rest are points willing to change.
7. Kangaroo is a physics engine meaning that the only thing that understands is ... er ... points and their relation (the "line" connecting them, that is). Kinda like a CPU that understands 0 and 1 and nothing else.
8. So we provide Kangaroo info about all the lines involved: how "stiff" they are and what is the expected/desired final length.
9. By double clicking the Kangaroo component ... the "simulation" starts running (in some kind of "loops") and goes towards an "equilibrium" where all our desires are satisfied - or the solution's entropy is the minimum possible (well up to some level, he he). Kangaroo displays a small control dialog that allows you to halt the process or reset it (meaning: start again).
10. If the instructions are "good"/"proper" the "loops" (iterations) are relatively few: if K does 1M "loops" ... this means that your instructions are silly or not well thought.
After stopping Kangaroo ... we have (hopefully) a "well" distorted collection of points (and their equivalent mesh) to proceed further via components usually found in the WB add-on
PS: If all the above sound Greek to you ... it's because I'm Greek, he he.
Moral: Get the gist of Kangaroo ASAP - worth spending some time I recon. If you do that and you need examples (other than the ones available at download time) ... well I have more than 300 (from simple to ultra paranoid).…
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).
…
on excel (leaving 0,0 cell blank and also making sure there are no commas in the names ) Also let's call the names "ID"
2 - For the weight, use numbers ranging from 1 - 10 where 10 is the highest dependancy.
3 - Save the file as a Unicode CSV from excel
4 - Create another file on excel that has the attributes of your spaces, with the names of your spaces under the header ID (let's start with a simple "area" and "SNo" attribute but you could add more features for sorting and manipulating your data)
5 - Open Gephi and further open your matrix CSV file
5 - Import it as "," (comma delimited file) and make sure you check "matrix" for the data type
6 - Ensure the import is nondirectional as well (or Gephi adds silly arrows)
7 - Not gonna go into the gephi bit too much but select a force atlas layout and set the force to something high 1000 or 10000 depending on the size of the data and the attraction to a 1000th of that 1 or 10. Go to the data lab and import your excel with the attributes and append to your existing datasheet.
8 - Set the node attributes to use the area for the node size and color scheme to SNo
9 - Play around with all the layout options and finally go to your preview. Once you're happy with it, export it to a GDF graph file.
the GDF now has the coordinates of the circles and the diameters. as well as the edge connections.
I've written a very amateur script that converts this to GH geometry (below)
Hope this helps someone out, I'm still figuring out the gephi streaming API but I've only started with python about a month ago so might take a while to get there.
You can use the second half of the GDF files to also create dependency chord diagrams online as shown in the third image.
https://flourish.studio/2018/07/25/how-to-make-a-chord-diagram/
Cheers,
Sanjay
…
to run at full screen. I've gone as far as using an iPad to use as the second monitor via AirDisplay (which actually works really well) but have never been satisfied with any setup that required you to look back and forth as if at a tennis match all day long.
Not long after first using Grasshopper 3+ years ago I've had the desire for a "Live Viewport" component that would allow a live image of the 3d geometry being generated directly in the canvas. Every once in a while I search the forums with the hope of finding a solution, but always come up empty handed. Someday this might exist although for now I have found what might be the next best thing to a native "Live Viewport" component and its enabled with a small app named Sticky Previews. This app uses the task bar preview feature within Windows 7's aero interface to create custom, floating preview windows from any open window currently running. I've only just discovered the app, but it seems to do the trick and has been stable and problem free so far. -- I will post an update if I find out that I might have spoken too soon. The install allows for a 30 day trial and is $15 bucks to purchase. I just found the app and don't know anything about this group that created the app. If you happen to know of them, Id be curious to find out more.
divided windows, cramped and slow;
unified window with floating rhino model preview;
link to the apps webpage;
http://www.ntwind.com/software/sticky-previews.html
Also works with other apps;
and the about me page screen shot;
…
Added by Tyler Selby at 11:25pm on November 26, 2012
Introduction to Grasshopper Videos by David Rutten.
Wondering how to get started with Grasshopper? Look no further. Spend an some time with the creator of Grasshopper, David Rutten, to learn the
nd B) daylight autonomy for a single room. A and B are therefore the conflicting objectives, and are connected to the O of octopus component. The geometry iterated is that of a window, on one of the rooms' facades.
I have a grasshopper definition that iterates the window by changing:
1. Window height
2. Window sill height
3. Window width
4. Window position from one side of the wall
1,2,3,4 are therefore the genes. A combination of these genes is a complete window, which is the chromoshome, that i will from now on call solution. All genes are connected to the G of octopus component.
Now regarding the octopus settings, i have these questions so that i can properly calibrate the settings (mutarion rate, crossover rate etc):
1.In the beginning of the octopus simulation, how many are the random solutions generated? (By random i mean totally random, not resulting solutions from mutation or crossover of previous solutions, i am talking about the very first generation). Is this number connected to the population size? Is it 6? How is it defined by octopus? Can somebody control it?
2.The first generation finishes when the number of "individuals to be evaluated" is reached. Then octopus jumps to the second generation. To do so, it keeps a specific number of solutions of the first generation, the so called elite. What is the number of these elite? Is it elitism x population size?
3.The SPEA2 original paper describes step wise the algorithm loop. During the loop, a number of solutions is stored in the elite domain, and from that domain, a number of solutions is used for mating. There are therefore two numbers, one that defines the number of solutions to enter the elite domain, and one that defines the number of solutions to be inserted in the mating pool. In octopus i only see elitism as a setting, which i am guessing is what defines the number of solutions to enter the elite domain. Is that true? How do i define the number of solutions to be copied in the mating pool, where mutation and crossover will occur? This number should be called tournament size, but i can't seem to find it..
4.Why is it that DURING one generation, the number of "individuals to be evaluated" can decrease? Is it because octopus finds out that there are no more possible solutions? (i am using discrete values for the genes)
5.The gene of window width, represented by a grasshopper slider, has 4 possible values: 0,1,2,3. Assuming that the mutation rate is 0.5. Does this mean that mutation of the gene can happen to an extent of 0.5 x 4 = 2? Meaning that the slider position can change for 0 to 2 or from 3 to 1 etc?
6.The mutation probability is dictating whether or not a gene will be mutated, or whether or not the whole solution will be mutated? So for instance, with a mutation probability of 0.5, does it mean that 2 out of the 4 genes are going to be mutated, or 2 out of 4 solutions is going to be mutated. If its the second case, then how is mutation divided between the different genes? Meaning, which of the 4 genes is going to get mutated? Is it random? Is it for all 4 genes?
7.Crossover can occur between 2 subsequent solutions. Crossover rate dictates whether or not crossover will take place? If so, then, assuming that it was chosen for crossover to take place between 2 solutions, which of the genes are going to be exchanged. I mean how many, out of the 4 genes (height, sill height, width, position). Is it random?
8.After clarifying the previous 7 questions, i can run a simulation. Then, is there an indicative number that i can be monitoring, to see that no more generations are required? I know that a good pareto has to be short, with a lot of solutions and with a uniform distribution. But is there a specific number output somewhere, that can inform me that a good pareto has more or less been generated? If there is such indicator...
Thank you all,
i hope this can help others as well,
Iason
…
u can still find some wonky behaviour in GH related to datatrees. My experience is that new users quite quickly get the hang of it once they learn that a tree is in fact not a tree but in the first place set of lists, where the path shows how the pieces of data used to be grouped.
Branch Count checking A component has multiple tree inputs, but has different amount of branches, each having branch count > 2. (While I understand the logic of combining multiple trees, I've not once encounted once that combining a component with e.g. an input of 2 branches and an input of 4 branches to give any kind of sensible output.
Desired behaviour: If a component has branches (each being > 2 path count), the component should throw a warning. ("Strict branches behaviour?). For example: take an offset component, with 6 branches of curves and 5 branches of offsets. It is extremely likely that this is the result of an error earlier in the definition. This works however without a problem - the last branch is repeated again, and it's later on quite hard to discover something went wrong.
Checking branch Count The most important numeric is the amount of branches, and the amount of items in the tree. It's desired that the hovers show the amount of data and the amount of branches.
Desired behaviour
Trees with paths of different rank Trees that contain {0;0} and {0} and {0;0;1} is usually a sign of trouble of not well merged trees, faulty C# components, or just nasty coding habits.
Trim as undo graft instead of flatten Having the trim in the context menu would provide an easy way to undo a graft. Right now the easiest way for many people is to flatten it, and then start all over again - while just getting rid of the last index keeps the underlying history and makes it easier to write reuseable pieces of code when you prepend datatrees to it.
Component to get branch by index, not by path Would be great. Suppose you have a grid of points, grouped by row. It would help to show: "look, this is in the first path, it's called {0;0;1}, it's got 10 points, these points are the first row".
Analogue to using list item to show what is the first point, second point, and so on.
Semantic path names (maybe far fetched) But what if we can add a short name of each method that was executed to the path list, so it can show:
{Slider 0; Series 0; Point 0}{Slider 0; Series 0; Point 1}
{Slider 0; Series 0; Point 2}
{Slider 0; Series 0; Point 3}
{Slider 0; Series 1; Point 0}
{Slider 0; Series 1; Point 1}
{Slider 0; Series 1; Point 2}
{Slider 0; Series 1; Point 3}
Make the input/data matching inside components explicit Can we make it even more obvious that a component is not a black box that's executed once, but in fact an iteration machine that tries to make sense of the inputs that's fed to this box?
Show data combination. How data input A relates to data input B and data input C, is currently very implict and is just plain hard to learn., and required the ability to be able to relate the output back to the input. If we can textually or even graphically show what data matching occured inside a component, it would greatly help the understanding (and debugging) of "what's going on here in this component"
A verbose explanation of the data matching in component A
Iteration one: - Geometry: We take the data item from Branch 0, Position 0: (Point 0,0,0) - Motion: We take the data item from Branch 0, Position 0: (Vector 0,0,0)
Iteration two:
- Geometry: We take the data item from Branch 0, Position 0: (Point 0,0,0)
- Motion: We take the data item from Branch 0, Position 1: (Vector 10,0,0)
Iteration three:
- Geometry: We take the data item from Branch 0, Position 0: (Point 0,0,0)
- Motion: We take the data item from Branch 0, Position 1: (Vector 20,0,0)
etc.
A verbose explanation of the data matching in component B
Iteration one: - Geometry: We take the data item from Branch 0, Position 0: (Point 0,0,0) - Motion: We take the data item from Branch 0, Position 0: (Vector 0,0,0)
..
Iteration seven:
- Geometry: We take the data item from Branch 0, Position 0: (Point 0,0,0)
- Motion: We take the data item from Branch 7, Position 0: (Vector 0,70,0)
..
Iteration 27:
- Geometry: We take the data item from Branch 0, Position 7: (Point 80,0,0)
- Motion: We take the data item from Branch 2, Position 0: (Vector 0,20,0)
…
ow the steps of the successful run when step 1.2 is bypassed (note that the and OpenFOAM session is open in the background while running the Butterfly demo file):
1. create wind tunnel, and use different parameters of (4,4) for _globalRefLevel_ as suggested by Theodoro in this post
2. run blockMesh:
3. run snappyHexMesh:
4. run checkMesh:
5. connect the case from checkMesh to simpleFOAM and run the simulation:
6. the simulation converged at 1865 iteration, but the results visualization part has some problem:
7. so I revised this part according to suggestions from Hagit:
8. and the results can be visualized for P and U values:
The GH file used for the successful run shown above is attached here.
Now, the following is the error I got when the case from the update fvScheme component is used for simpleFOAM simulation:
the warning message on the simpleFOAM component is:
1. Solution exception: --> OpenFOAM command Failed!#0 Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #2 ? in "/lib64/libc.so.6" #3 double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #4 Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #5 Foam::GAMGSolver::solveCoarsestLevel(Foam::Field<double>&, Foam::Field<double> const&) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #6 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #7 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #8 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so" #9 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #10 Foam::fvMatrix<double>::solve() in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #11 ? in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #12 __libc_start_main in "/lib64/libc.so.6" #13 ? in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam"
The error message from the readMe! output node is attached below as a text file.
Hope you can kindly advise what the important steps or parameters I might have missed here. I assume it might be related to OpenFOAM rather than with the Butterfly workflow...
Thank you very much!
- Ji
…