s being randomly created rather than with the Ingress strategy in mind, triangles would not be randomly in Ingress. Have to start from scratch with a strategy.
It may have to go with something more iterative (Anemone?)
Ultimately I would like to be able to alter the number of resonators per portal and portal counts to see the fields update accordingly. This for an animation with timing for field alterations.
Some basic Ingress rules: (leaving out portal key requirements of the game)
- Two sets (teams) of portals (resistance (blue) and enlightened (green) team)
- Portals can have 0 to 8 resonators
- Portals with 8 resonators can be linked within team portals
- Portal links cannot cross other links (from either team)
- 3 links that form a triangle form a “field”
- A portal can be part of multiple fields
- Fields can share a link
Here what I think the strategy could be:
1. Create map boundary (at some point the US map with google map background and ingress styling)
2. Populate with random amount of portals per team
3. Randomly assign 0..8 resonators per portal
4. Randomly assign max fields for given portal
5. Create first field
6. Eliminate / flag portals in the field for future linking (would violate intersecting links)
7. Create next field till max fields for given portal (may not reach max fields pending portal options)
Not sure if this is getting too complex and would require something in python or C?
Thoughts?
Anton…
Added by Anton Bakker at 5:11pm on August 29, 2014
you create a new List(Of WhatEver) and you use the default constructor, you get a list with count=0 and capacity=4. When you try and add a fifth item, the list will realise there's no room left and it will double its internal memory to 8 slots. Now, when you try to add a ninth item, it will double again to 16 and so on and so forth. This behaviour has two drawbacks:
1) Growing the internal memory allocation takes some processor cycles.
2) It's possible the list grows unnecessarily big.
For example, imagine we're making a list of 10,000 items. Normally, the List would have to resize itself 12 times (4, 8, 16, 32, 64,..., 8192, 16384) and it finally ends up with over 6000 slots it doesn't need.
If however we constructed the list right away with a capacity for 10,000 items, i.e. New List(Of WhatEver)(10000), not a single resize operation is needed and we're not wasting any memory.
The capacity is always a hint, it is not possible to make a List(Of T) have a fixed size. The capacity will be increased automatically by the List class, which is why it is such a joy to use it.
If you don't know how many items you are going to store in a list you can always choose to call TrimExcess when you're done, which at least insures you're not wasting memory. This is only important though on lists that have a relatively long life-span.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 10:18am on March 24, 2010
8 graphs total (4 seasons, 2 conditions). I am just going to do this with four separate psychrometric chart components. I can use the analysis period to block out the 4 seasons, no problem. I can also write a conditional statement using c<=0 for direct radiation to get whether it is nighttime or daytime (or something in between if I use a value other than zero). However, when I try to connect both, I receive an error:
"1. Solution exception:global name 'getHOYsBasedOnPeriod' is not defined"
I've updated my ladybug, and replaced all the components involved. I attach the file that I'm working on, and the Vienna weather data that I'm using as a test.
Thoughts or help would be much appreciated! (Under a bit of a deadline here, actually)
Alexander…
s is like flattening your data PARTIALLY - chopping an index off the end of the branch paths without obliterating the tree entirely. When working with one "set" of input data, a flatten works to get these lists to match up - but when working with multiple sets, we need to be careful to preserve the original branch indices that keep all four of your original regions separate. As a rule, whenever you're feeding two data trees into any component, they should have the same number of branches. (or one should have branches and the other should be a flat list, in other cases).
The rule of thumb I tend to teach is this:
In 90% of cases...
For lists, all your inputs should either have 1 item or N items. That is to say, if you're feeding 4 items into one input and 9 items into another, something is probably wrong.
For trees, all your inputs should have either 1 branch or M branches. That is to say, if you're feeding a tree w/ branches {0;0} to {0;3} into one input, and a tree w branches {0;0;0} to {0;3;8} into the other input, something is probably wrong.
Grasshopper essentially matches up branches first, then lists second. By "matching" I mean it processes them together. Simple example of the Line component - it will match the first branch of points in the A input to the first branch of points in the B input, creating lines between those points, then match the second branches, the third branches, etc. THEN, it applies the same logic to the level of the list (with a pair of matched branches {0;2}, match all the items in those branches to each other - first item in one branch to the first item in the other branch, etc.)
This is a tricky concept but it seems like you're already well on your way to understanding it from your definition - "PShift" is a critical tool in your path management arsenal. I hope this (overly long) response helps clear things up for you!
…
ky.exe did not accept -p parameter and made empty sky.cal file.
----
Edit: solved run problem, Bee did not download OpenStudioMasterTemplate.idf
Get it here: https://github.com/mostaphaRoudsari/Honeybee/issues/119
Now get empty HDR:
C:\ladybug\prox\imageBasedSimulation>rpict -i -t 10 -vtv -vp 245.129 -226.458 20 0.405 -vd -0.549 0.656 -0.518 -vu -0.332 0.397 0.855 -vh 42.862 -vv 26.991 -v l 0 -vs 0 -vl 0 -x 800 -y 600 -af prox_RAD_Perspective.amb -ps 8 -pt 0.15 -pj 0.6 -dj 0 -ds 0.5 -dt 0.5 -dc 0.25 -dr 0 -dp 64 -st 0.85 -ab 2 -ad 1024 -as 175 -ar 150 -aa 0.200 -lr 4 -lw 0.050 -av 0 0 0 prox_RAD.oct 1>prox_RAD_Perspectiv e.unf rpict: 0 rays, 0.00% after 0.0000 hours rpict: skybright`c__ladybug_skylib_cumulativeSkies_SINGAPORE_SGP_SINGAPORE_SGP_1 : undefined variable rpict: 1020 rays, 4.91% after 0.0000 hours
----
Hi friends,
trying to get a cumulative sky image metric to run and encountered an issue with the image-based metrics component. It throws:
Runtime error (KeyNotFoundException): honeybee_materialLib Traceback: line 768, in main, "<string>" line 1442, in script
I guess this is some sort of setup issue on my end, or I messed up the definition? Any help appreciated.
Thanks,
Max
…
will work slightly different from before. Sorry about breaking this, but it proved impossible to improve the selection logic with the fairly ambiguous notation that was implemented already.
Not every change is breaking though and I hope that most simple matching rules will work as before. There will be a McNeel webinar on Wednesday the 6th of November where I discuss the new selection rules (as well as path mapping syntax and relative offsets within one or more data trees). This will be a pretty hard-core webinar aimed at expert users. The event will be recorded so you can always go and watch it later. I figured I'd briefly explain the new selection rules on Ning before I release the update though.
-------------------------------------------------------------------------------
Imagine we have the following data tree, containing a bunch of textual characters:
{0;0} = [a,e,i,o,u,y] {0;1} = [ä,ë,ê,ï,î,ö,ô,õ,ü,û,ÿ,ý] {1;0} = [b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,z] {1;1} = [ç,ĉ,č,ĝ,ř,š,ş,ž]
There are a total of four branches {0;0}, {0;1}, {1;0} and {1;1}. The first branch contains all the vowels that are part of the standard English alphabet. The second branch contains all non-standard vowels and branches three and four contain the standard and non-standard consonants respectively.
So what if we want to select from this tree only the standard vowels? Basically include everything in the first branch and disregard everything else. We can use the [Tree Split] component with a selection rule to achieve this:
{0;0}
This selection rule hard-codes the number zero in both tree path locations. It doesn't define an item index rule, so all items in {0;0} will be selected.
If we want all the vowels (both standard and non-standard), then we have several options:
{0;?} = select all branches that start with 0
{0;(0,1)} = select all branches that start with 0 and end in either 0 or 1
{0;(0 to 1)} = ......................................... and end in the range 0 to 1.
Conversely, selecting all standard vowels and consonants while disregarding all non-standard character can be achieved with rules as follows:
{?;0}
{(0,1);0}
{(0 to 1);0}
It is also possible to select items from each branch in addition to limiting the selection to specific branches. In this case another rule stated in square brackets needs to be appended:
{0;?}[0 to 2]
The above rule will select the first three vowels from the standard and the non-standard lists.
Basically, rules work in a very consistent way, but there are some syntax conventions you need to know. The first thing to realize is that every individual piece of data in a data-tree can be uniquely and unambiguously identified by a collection of integers. One integer describes its index within the branch and the others are used to identify the branch within the tree. As a result a rule for selection items always looks the same:
{A;B;C;...;Z}[i] where A, B, C, Z and i represent rules.
It's very similar to the Path Mapper syntax except it uses square brackets instead of parenthesis for the index (the Path Mapper will follow suit soon, but that won't be a breaking change). You always have to define the path selector rule in between curly brackets. You can supply any number of rules as long as you separate them with semi-colons.
The index rule is optional, but -when provided- it has to be encased in square brackets after the path selection rule(s).
The following rule notations are allowed:
* Any number of integers in a path
? Any single integer
6 Any specific integer
!6 Anything except a specific integer
(2,6,7) Any one of the specific integers in this group.
!(2,6,7) Anything except one of the integers in this group.
(2 to 20) Any integer in this range (including both 2 and 20).
!(2 to 20) Any integer outside this range.
(0,2,...) Any integer part of this infinite sequence. Sequences have to be at least two integers long, and every subsequent integer has to be bigger than the previous one (sorry, that may be a temporary limitation, don't know yet).
(0,2,...,48) Any integer part of this finite sequence. You can optionally provide a single sequence limit after the three dots.
!(3,5,...) Any integer not part of this infinite sequence. The sequence doesn't extend to the left, only towards the right. So this rule would select the numbers 0, 1, 2, 4, 6, 8, 10, 12 and all remaining even numbers.
!(7,10,21,...,425) Any integer not part of this finite sequence.
Furthermore, it is possible to combine two or more rules using the boolean and/or operators. If you want to select the first five items in every list of a datatree and also the items 7, 12 and 42, then the selection rule would look as follows:
{*}[(0 to 4) or (6,11,41)]
The asterisk allows you to include all branches, no matter what their paths looks like.
It is at present not possible to use the parenthesis to define rule precedence, rules are always evaluated from left to right. It is at present also not possible to use negative integers to identify items from the end of a list.
If you want to know more, join the Webinar on Wednesday!
--
David Rutten
david@mcneel.com
Seattle, WA…
Added by David Rutten at 8:57pm on November 3, 2013
picture:
... and on a PC without anything attached to the serial port. When you open the port, start the read component and its timer, do you then get a stream of <empty> values in the log output? (hmmm... I suppose that's only reasonable - but still, you are also seeing this?)
I suppose that, because of the mutually exclusive behavior of both the spider and grasshopper (i.e. only one at a time can access the COM port), we can deduce that we are listening on the correct port.
Am I listening on the correct pin (if such a notion makes sense at all)? If I look back to the spider software, I see that 9 channels are listed and that it's only the measured value on channel 0 that changes when I press the load cell. Channels 1, 2, and 3 report OVERFLOW; 4, 5, 6, and 7 are pretty much constant at 0.000 to 0.005 V; and channel 8 says FFFF. I do not know how things like that work so I do not know if they reflect reading from the 9 pins on the D-sub 9 connector.
As for your BTW question: no, I don't need to record all of the sensor values. I suppose that the Out value on the Read component will always reflect the most current value and that's all that I need to get on with life. In the end, the idea is that we have 4 load cells in the 4 corners of a plate onto which a vertical pipe is fixed. Loads are then put on the top end of the pipe and we'll have to visualize both direction and magnitude of the bending moment that is calculated from the compression - tension readings from the load cells... We've done this on a scaled model and streamed load cell information into MatLab. Now we'll have to use a different datalogger and I was hoping to be able to do the post processing in Rhino.
wim…
int "ANGLE_LIMIT: ",AngleLimitB # 0-180 input sliderSHARP_MESH_FACES = MESH.Faces.GetConnectedFaces(0,math.radians(180-AngleLimitB),False)print "Size of sharp mesh face array: ",len(SHARP_MESH_FACES)print SHARP_MESH_FACES
Results in this sort of thing for a large mesh:
There are: 13394 faces.ANGLE_LIMIT: 160.0Size of sharp mesh face array: 46Array[int]((0, 1, 2, 3, 5, 553, 554, 4, 7162, 7163, 549, 556, 7159, 550, 7158, 7165, 551, 552, 7167, 558, 7160, 7161, 557, 7026, 417, 7166, 560, 7016, 407, 559, 7169, 408, 7017, 7168, 7014, 7164, 405, 555, 8, 406, 7020, 7, 411, 7015, 6, 110))
What is that array?! It's not always even length, so it's not pairs. The command page says about GetConnectedFaces: "Find all connected face indices where adjacent face normals meet the criteria of angleRadians and greaterThanAngle." The first parameter is the face to start on, so I used 0 to start at the beginning. As I move the angle limit slider it does grab more and more hits.
Why doesn't rhinocommon.chm actually tell what commands really output and how to use them in Python? UGH.…
plication to Rhino.Exe.
3. Press Start.
4. Rhino is opening and I open grasshopper.
5. I add native grasshopper c# component and reference .dll
6. I have an access to static variable.
then what I want to do but I can't:
7. I stop the debugger in visual studio and add one more variable and expect that the library would be updated as is when I compile gh components.
8. But when I press continue and the .dll file is not updated and I do not see any additional variables declared. First I thought ok, maybe it is not visible, but I typed a correct name, but the message says that my dll does not contain this type.
9. Then I tried to reference the .dll again, but nothing happens, same old .dll is referenced.
10. When I close and open rhino it is updated. The whole closing and opening operation is a bit disturbing and I would like to debug it via Visual Studio.
Do you know what I doing wrong?
Is it working like so, because .dll is loaded to memory and not referenced from Hard Drive?…