Grasshopper

algorithmic modeling for Rhino

screenshot.jpg

Hey everyone,

I'm pretty new to grasshopper, so I'm still figuring  out how everything works, and this is probably quite a simple question.

I have a question: as you can see in the screenshot I attached I have a vertical line, which is cut by two pipes in the top and the bottom, and goes through the pipes. I would like to extract the line between the two tubes, and cut it off there. I have managed to do that with trim brep, but only on the top or on the bottom. I have found the command trim breps, and I wondered if there is a way in which I can cut the line simultaneously in the top and bottom, instead of doing the command of trim brep four times. However, I can't seem to get the trim breps to work, to combine multiple breps in one.

Regards,

Views: 850

Replies to This Discussion

see attached

Attachments:

More C code, Peter?  I'll never look at any of your code again, so I don't know in this case.  Why do you persist in offering C code solutions to people who are new to Grasshopper?  Planting a virus, perhaps?

More "compact" but a bit confusing for a novice

Attachments:

I'm still not looking at your code.  Never again.  You haven't explained why you offer absolutely USELESS C code to almost every new person who shows up here?  You aren't doing them a favor because they won't learn Grasshopper from it.  Why?

No offense, but I myself use C# a lot and helped people with C# also. The new people must understand that there will be someday that they need to use coding means to achieve what they need to get. There are ways of doing things with the module but it can be simplified with C. 

No.  It's quite possible to learn and use Grasshopper for years without ever touching any C# code.  New people most of all don't need to see any C#.  It's an advanced topic, even if one is familiar with coding.  Sure, C# (or VBasic or Python) can do wonderful things and has advantages over Grasshopper components, but that's not what a novice needs to see first.

I would agree with Joseph on this, you can do most things with Native GH. (Loops and missing components such as Shrink Trimmed Surface are the only things that really need coding). 

If someone is new to GH and wants to learn it, given them the answer as pure code is great to solve the question but not to help them learn GH any further. 

I sometimes answer a question that been answered with just C# etc with a native GH code to show both methods and help the poster learn more native GH.  

Yes sure they will be able to see how what they have asked is done in code which is great for someone with some understanding of C#/vb/python but maybe not help them carry on working or understand why when they want to change something the error it returns is not a simple to understand as the GH component errors. 

But the concern is, it is to show to the new user that it is not "USELESS"  to use C. 

There is a category for that: VB, C# and Python Coding

You haven't explained why you offer absolutely USELESS C code to almost every new person who shows up here?

I didn't mean it was totally useless.  Just to those new students who are looking for a standard Grasshopper solution.

Nice one Peter, that is about the most compact grasshopper code i've seen. Takes a line, splits with b-reps, and then extracts based on the item index. A note to Eliza, when I am trying to extract a few elements from a tree, and I do not know the actual index number, I either use a the slider component to set the index number (until I figure out which number it is) or cherry picker. 

I use this 'Tree/List Viewer' all the time.  It accepts a tree of geometry (breps, curves, surfaces, points or whatever) and uses a pair of 0..1 sliders ('path idx' and 'list idx') to traverse the tree branches and the list of items in each branch.  Sample tree/data included:

Inside the 'vTrE' cluster:

Inside the 'vList' cluster:

Attachments:

Thanks everyone, quite helpful!

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service