0;3} (N = 2)
{0;0;0;4} (N = 2)
{0;0;1;0} (N = 2)
{0;0;1;1} (N = 2)
{0;0;1;2} (N = 2)
{0;0;1;3} (N = 2)
{0;0;1;4} (N = 2)
Flattening this structure using the Flatten component would result in:
{0} (N = 20)
However, using a Path Mapper with the following masks will flatten is somewhat more intelligently:
{A;B;C;D} -> {A;B;C}
Now, you get:
{0;0;0} (N = 10)
{0;0;1} (N = 10)
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 3:19am on December 14, 2009
================================>>>
Traceback (most recent call last): File "C:\Users\katastrophy\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\LaseCutFabTools-master\Box_Maker.py", line 1, in <module> import rhinoscriptsyntax as rsImportError: No module named rhinoscriptsyntax>>>…
is created for each point (25 paths, N=1 for each) which is feed into [Pull Point] for the pull geometry [G].
Correspondingly for the 4 source points a branch is created for each point and duplicated 25 times (4 paths, N=25 for each). This tree then needs to be inverted with [Path Mapper] so the structure will correspond to the format of the pull geometry. The mapping {A;B;C}(i) > {i}(B) produces (25 paths, N=4 for each) the structure to feed into the search point [P].
The [Pull Point] boolean toggle [C] needs to get set to False to obtain all the distances between all search and pull points (4 x 25 = 100 values).
Simultaneously there is also an index being created to correspond to the list of the 4 source points. This index is the integers 0 to 3 which are branched and inverted similar to the source points (25 paths, N=4 for each).
The distance output [D] from [Pull Point] is then sorted synchronously with the source point index for each branch. From the following screengrab branch {0;0} corresponds to a point in the 5 x 5 grid and the shortest distance between that point and a referenced source point index is 5.261. The index of the referenced source point is 3.
For each following sorted branch the first sorted index value will correspond to the closest source point (first [List Item] shown). This index value is then used to select from the original list of duplicated and inverted points and this is done for each of the 25 branches (second List Item shown).
Draw a line or whatever an away we go!…
nts me this:
[[0], [0, 1], [0, 1, 2], [0, 1, 2, 3], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5, 6], [0, 1, 2, 3, 4, 5, 6, 7]]
this is what I wanted but how to convert this to tree in grasshopper?
In grasshopper I just get:
8x IronPython.Runtime.List…
branches in each A's list of B's, or remove its ends etcso that if I want to remove the last B in every A{0;1},{0;2},{0;3},{0;4},{0;5},{0;6}{1;1},{1;2},{1;3},{1;4}{2;1},{2;2},{2;3},{2;4},{2;5}would become{0;1},{0;2},{0;3},{0;4},{0;5}
{1;1},{1;2},{1;3}
{2;1},{2;2},{2;3},{2;4}I guess the question is do I need to figure out the cull pattern- each B may have different lengths...…
operate on the data from your own components.
2) Put your 2D array data inside a Grasshopper.Kernel.Types.GH_ObjectWrapper instance, which is a class that can be used to transmit non-standard data through wires. Again, you'll only be able to use this from your own components.
3) Create your own data-type (implement IGH_Goo) as a 2D array.
4) (and my favourite) store your 2D data in a DataTree instead. All grasshopper data is stored in trees and it's possible to mimic a 2D array this way. For example, you could create a tree like this:
{0} N = 10
{1} N = 10
{2} N = 10
{3} N = 10
{4} N = 10
This would be analogous to a 2D matrix of 5 x 10.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…