Grasshopper

algorithmic modeling for Rhino

I have created a grid and from the points I have then generated some 3d L system trees (using rabbit) of varying heights which relate to a roof surface above. For the trees that sit at the edge of the grid I want to trim them so that the branches which fall outside of the grid are removed.

 

So... When I do this trim what I want to remain is all trees on the points inside the grid and then at the edge points of the grid, just the branches that fall within the grid boundary (so the ones that overhang outside of the perimeter grid get deleted).

 

How do I achieve this???

 

I have tried the method below which does not achieve what I desire. Any suggestions Please???

 

My attempts do far:

I have tried creating a boundary box (by first creating a big box (larger than the grid) and then subtracting (using a boolean) a box the same size as the grid.) and subtracting this using the brep line intersect tool however all I am left with is the branches that are touching the perimeter surfaces of the boundary box.

 

Views: 1764

Replies to This Discussion

Hi Michael,

I'm writing this without the benefit of having either Rhino or GH installed on this machine so I won't be able to post an example until I get in the office on Tuesday, also please bear with me if it goes slightly awry.

For every line outside of the bounding box either the start point or end point or both will be outside therefore you can use the containment component (double click the canvas and type containment as I cannot remember which toolbar its on). This component will test an input list of points for either intersection = 0, inclusion = 1 or exclusion = 2. From a combination of either OR or AND gates you should be able to piece together a Boolean Culling pattern to select the lines you wish to display.

For example take an Endpoints component from your lines and test each output separately for inclusion in your boundary box. Then feed these numbers into separate equals components and test for =1. Then feed these true/false results into either an AND component or an OR component (depending on whole or partial inclusion). This final stream of True/false values should be the pattern you want for a Cull Pattern component to feed your original list of lines into.

This should be straight forward but as I have no idea what the data structures would look like from this example, you might need to play with the Flatten or Graft somewhere along the line also there is the option to invert the pattern on the culling component if the logic is out.

This logic has been aimed at version 0.8 and some features or components might not be present in earlier versions.

Danny,

 

Thanks for the help. Unfortunately, I am running on 0.6 and I cant upgrade as if I do then I will no longer be able to use rabbit which is key to my experiment.

 

Since the Containment component does not work in Grasshopper I have found the inside tool. This has allowed me to generate a series of true/false statements for points that lie inside/outside my brep. This is all good however, I do not know how to make trees again from the points that are true, disgarding the false points. I have tried using the dispatch component which seperates them but then I do not know what to do from there on. Any Suggestions?

 

I have included my grasshopper file in hope that this may help however it was done on 0.6 using rabbit as well.  

Attachments:

UPDATE

 

Using the cull pattern component I have successfully managed to isolate just the points inside the brep however when I join the points using a polyline, the points connect, however the line no longer represent the original tree generated with rabbit as they have connected in a different order. What's more, now all the trees connect with a line.

 

How can I separate the 3d l system trees independently so that when I use the inside component followed by the cull pattern component I am left with points in the same order that they were generated? This I think would solve my problem.    

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service