Grasshopper

algorithmic modeling for Rhino

I would like to suggest several components that would make working with trees easier.
I'm currently trying to create a three-dimensional grid of points where each point is on its own branch corresponding to its indices within the three-dimensional matrix, but I'm not sure it's even possible for adjustable grid dimensions.

1. Select Branches

This has seemed to be missing to me since trees were introduced. Like Replace Branches, this component would allow the user to filter a tree with a branch pattern, but it would preserve the branch paths of the output elements instead of merging them into a given path. Maybe this can be done with Path Compare and Cull Pattern, but it should be easier.

E.g. for

{0:0:0}
0 Point 1
{0:1:0}
0 Point 2
{0:1:1}
0 Point 3
1 Point 4

Selecting 0:1:* would give

{0:1:0}
0 Point 2
{0:1:1}
0 Point 3
1 Point 4

2. Extract Paths

Given an input tree this component would output a new tree where each element was the path of the corresponding element in the input tree.

E.g. for

{0:0}
0 Referenced Point
1 Referenced Point
{0:1}
0 Referenced Point
1 Referenced Point
2 Referenced Point

The result would be

{0:0}
0 {0:0}
1 {0:0}
{0:1}
0 {0:1}
1 {0:1}
2 {0:1}

3. Set paths

This component would take a data tree and a path tree and apply the paths to the elements of the data tree.

E.g. for

(Tree 1 - data)
{0}
0 Point 1
1 Point 2
2 Point 3
{1}
0 Point 4
1 Point 5

(Tree 2 - paths)
{0}
0 {0:1}
1 {1:0}
{1}
0 {0:0}
1 {1:0}

The result would be
{0}
0 Point 3
{0:0}
1 Point 4
{0:1}
0 Point 1
{1:0}
0 Point 2
1 Point 5

Any elements in the data tree for which there is not a corresponding path in the path tree would retain its path (like Point 3).


If anyone wants more clarification on these examples I would be happy to oblige.

Views: 354

Replies to This Discussion

And another thing that would be useful:

A "Branch cross reference" method

Let's say I have the following grafted integer series:

(Tree 1)
{0}
0 10
{1}
0 11
{2}
0 12

(Tree 2)
{3}
0 13
{4}
0 14

(Tree 3)
{5}
0 15
{6}
0 16

And I want to place points at every possible combination of these coordinates, treating Tree 1 as X coordinates, Tree 2 as Y coordinates, and Tree 3 as Z coordinates. Also, I would like the list of points to be a tree with paths corresponding to the coordinates. Wouldn't it be nice if I could plug these trees into a Point XYZ, with a new "branch cross reference" method, and get the following result?

{0:3:5}
0 {10.0, 13.0, 15.0}
{0:3:6}
0 {10.0, 13.0, 16.0}
{0:4:5}
0 {10.0, 14.0, 15.0}
{0:4:6}
0 {10.0, 14.0, 16.0}
{1:3:5}
0 {11.0, 13.0, 15.0}
{1:3:6}
0 {11.0, 13.0, 16.0}
{1:4:5}
0 {11.0, 14.0, 15.0}
{1:4:6}
0 {11.0, 14.0, 16.0}
{2:3:5}
0 {12.0, 13.0, 15.0}
{2:3:6}
0 {12.0, 13.0, 16.0}
{2:4:5}
0 {12.0, 14.0, 15.0}
{2:4:6}
0 {12.0, 14.0, 16.0}

In this form of cross referencing, every combination of individual branches from the different lists is used as separate input, and the output for each combination is put onto a branch in the result whose path is the concatenation of the input branch paths used.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service