I assume that branch 0;0 has N = 10 points, 0;1 N = 7 points.
In the photo the way you describe the points it is like branch 0;0 has N = 45 points, where subbranch 0;0;1 has null points, subbrach 0;0;1 has N=1 point... subbranch 0;0;9 has N= 9 points.
Most likely you need to just graft you initial data tree that has the following structure
0;0 with N = 10
0;1 with N = 7
0;2 with N = 9
0;3 with N = 5
0;4 with N = 8
without a file, or a solid description of your starting data structure all these remain assumptions.
…
lections import defaultdict
example_list = [[1,2,4], [1,2,3], [3,4,3], [1,2,3], [5,7,1], [3,4,3], [5,7,1], [1,2,4], [9,4,9], [9,3,9], [9,4,9]]
d = defaultdict(list)
for item in example_list: d[tuple(item)].append(item)
groupedlist = sorted(d[x] for x in d)
print groupedlist
# Returns [[[1, 2, 3], [1, 2, 3]], [[1, 2, 4], [1, 2, 4]], [[3, 4, 3], [3, 4, 3]], [[5, 7, 1], [5, 7, 1]], [[9, 3, 9]], [[9, 4, 9], [9, 4, 9]]]
____________________________________________________
However working with python inside GH the code fails as (I'm assuming the id is included in the list ie.
[<Rhino.Geometry.Point3d object at 0x0000000000000BD0 [1611664.12669822,2952929.94466619,5788.70761766478]>]
If I print my object[0] i get just the vector, i.e [1611664.12669822,2952929.94466619,5788.70761766478]
However if i append my object, (for i in xrange (len(X)... list.append(my object[x])
The id included!?
[<Rhino.Geometry.Point3d object at 0x0000000000000BD0 [1611664.12669822,2952929.94466619,5788.70761766478]>]
Perhaps I'm over complicating this and should just use GH to group objects with the same position...
Also sometimes when getting vectors I receive long numbers such as.. 9.0122222900391e(10), and another times I don't.... Same file, script, geometry etc..
I'm quite a noobie in python for GH so any help or pointers are welcome...
Thank you in advance!
…
opper is all these values "recognizing" as similar/same.
I got list of results (n) with following values:
0. -3.2584e-9 1. -4.4992e-9 2. -6.7220e-9 3. -4.5154e-9 4. -4.3325e-9 5. -2.2496e-9 6. -2.2385e-9 7. -6.7525e-9 8. -4.5154e-9
Even though most of these values (maybe all of them) "go" into the second group:
(10^(-9)≤n) and (n>10^(-4))
Grasshopper recognizes all of them as members of the first group:
10^(-4)≥n
I am aware that this kind of very small values are unusual, and maybe Grasshopper is not made for it. But is there any way this can be done?
Take a look:
Thank you.…
output will show a tree with 3 branches of 4 integers each that I can pass on to other components. What is the best way to do it?
I have tried creating a tree and using a for loop to do so, but it didn't work.
Thank you for your help.
…
1
condition: largest number<max length
then the packing would look something like this:
1 |4 |5 |7 |2
9 |6 |5 |3 |2
|5
|1
sums|10|10|10|10|10 => 100% efficiency
And the algorithm is:
1.Place first number(x=1)
2.Calculate the rest(R) in this row(10-1=9)
3.Search for closest x <= than R
3.1 If x=R -> place that number -> end of cycle
3.2 If x<=R -> place that number -> return to 2.
3.3 If x=null -> end of cycle
Something like this.
Can this be classified as brute force?
…
Added by Artyom Maxim at 11:08am on March 19, 2013