oning behind using the equality component to test for even numbers is flawed because of the data matching used by gh. It is testing like this:
0==0 True
2==1 False
4==2 False
6==3 False
etc
.............
Where as a Modulo 2 would work like this
0%2 = 0
1%2 = 1
2%2 = 0
3%2 = 1
4%2 = 0
5%2 = 1
6%2 = 0
7%2 = 1
8%2 = 0
9%2 = 1
......
Also I notice you have some errors in your expressions producing Nulls.
If you want it to be twice the value then you should have 2*D in the Expression and 10*D in the other
....
I attach a working version.…
For example.
If you have two lists of points.
List A List B
{0;0;0}(0) {0;0}(0)
{0;0;1}(0) {0;1}(0)
{0;2}(0)
{0;3}(0)
{0;4}(0)
And you want to merge the two lists so that the two points in list A are the end points.
Merge Lists Results:
{0;0}(0)
{0;0;0}(0)
{0;0;1}(0)
{0;1}(0)
{0;2}(0)
{0;3}(0)
{0;4}(0)
Because of their path structures the order is wrong from a simple merge so Flattening now is out of the question.
Path Mapper
{A;B} --> {A;B+1}
{A;B;C} --> {A;C*6}
---------------------
Results:
{0;0} --> {0;0+1} = {0;1}
{0;1} --> {0;1+1} = {0;2}
{0;2} --> {0;2+1} = {0;3}
{0;3} --> {0;3+1} = {0;4}
{0;4} --> {0;4+1} = {0;5}
{0;0;0} --> {0;0*6} = {0;0}
{0;0;1} --> {0;1*6} = {0;6}
Now with the Path Structures similar when they are re-ordered the results will have the two points of list A as the end points.
Question 2
why did the curve-line intersection lose the path structure? Both trees had 38 branches.
Both trees had 38 Paths but Tree A had more Items, 147 compared to 38 in Tree B.
So you get this happening:
{0;0;0;0;0;0}(0) compared to {0;0;0;0}(0) results: Null {0;0;0;0;0;0}(0)
Base result paths on longest
{0;0;1;0;0;0}(0) compared to {0;0;0;1}(0) results: Null {0;0;1;0;0;0}(0)
{0;0;2;0;0;0}(0) compared to {0;0;0;2}(0) results: Yes {0;0;2;0;0;0;0}(0)
Add a branch to contain result
{0;0;3;0;0;0}(0) compared to {0;0;0;3}(0) results: Yes {0;0;3;0;0;0;0}(0)
{0;0;3;0;0;0}(1) compared to {0;0;0;3}(0) results: No {0;0;3;0;0;0;1}(0)
{0;0;4;0;0;0}(0) compared to {0;0;0;4}(0) results: Yes {0;0;4;0;0;0;0}(0)
{0;0;4;0;0;0}(1) compared to {0;0;0;4}(0) results: Yes {0;0;4;0;0;0;1}(0)
{0;0;5;0;0;0}(0) compared to {0;0;0;5}(0) results: Yes {0;0;5;0;0;0;0}(0)
{0;0;5;0;0;0}(1) compared to {0;0;0;5}(0) results: Yes {0;0;5;0;0;0;1}(0)
{0;0;5;0;0;0}(2) compared to {0;0;0;5}(0) results: Yes {0;0;5;0;0;0;2}(0)
...... etc
…
Start Rhino, run _Grasshopper.
Officially the edit-and-continue feature allows you to rebuild the code while it's running, but I have never been able to make it work.…
Added by David Rutten at 2:14am on February 24, 2016
dimension of matrices must be identical) and division is the same as multiplication (dimension must be in the order of A(mxn)*\/B(nxk) where n is the common dimension): to divide one element by another you just multiply it by 1/value (part or all of the elements can multiply while part or all of the elements divide):
so for example matrix addition of matrices A(2x2): {2,-1}{1,2} and B(2,2): {3,-5}{4,-2} will result in matrix C(2x2):{5,-6}{5,0}. subtraction of those matrices will result in D(2x2): {-1,4}{-3,4}
Division of matrices A(2x2): {2,0.5}{2,4} and B(2x1) :{2}{2} will result in matrix C(2x1): {1+0.25}{1+2}={1.25,3}. Multiplication of those matrices will result in D(2x1):{4+1}{4+8}={5,12}.…
owing:
{0}0. d1. e2. f
3. g4. h5. i
{1}0. a1. b2. c
3. g4. h5. i
{2}0. a1. b2. c
3. e
4. f
5. g
Thought maybe I could use relative Item but I cant figure out how to do an offset that includes multiples.
…