Grasshopper

algorithmic modeling for Rhino

Hi!

I'm facing simple problem yet after few days of trying I can not solve it:


I'm making SDL line in +Z direction from point on worlds xy plane. 
Line goes trough 3 floating breps(or points or curves)  at random heights above xy plane.

How can I input lenght of that SDL line so that it goes till highest brep (or point or curve) ? or cut it at highest object? 
Thanks!

Views: 776

Replies to This Discussion

Cut it at the top of the bottom of the highest brep? A file to experiment with would be nice.

Hi David!

The file I'm working on is a bit slow and complex..
I made fast representation of the problem. Please see attached file.

Top or bottom? hmm I guess top would be more useful, because in the end lines will represent column like holders for breps.
p.s. As I mentioned, I can use lines or points instead of breps if that somehow eases the solution of the problem. 

Attachments:

The component that would be ideal for this problem is [Project Point], it however doesn't seem to work as advertised. Sometimes I get points on the lower of several floating boxes. I'm looking into why that's the case.

In the meantime, the neatest alternative I can think of would be to use Mesh Ray intersection. It's quite fast, but only gives accurate results if the tops of your breps are flat.

Attachments:

There was indeed a bug in the Project Point component, it failed to sometimes find the nearest object. I've fixed it so whenever the next WIP release of Rhino6 goes out (usually Tuesdays) there will be a correctly working Project component.

Thank you David! This works like a charm! Very nice solution! 

Just generate a second 'Line SDL' with length determined by the 'Z' value of the highest intersection point?

P.S.  Looking at your GH, it appears at a glance that by flattening the data trees at several points, you have lost the original column/row structure, which makes the job harder?

I haven't checked carefully for duplicate points and lines...  but eliminating the 'Flatten' settings got me the data structure I needed:

Attachments:

Hi Joseph, 

Thank you for your help, this is very clever solution.
Problem is that I have flat list breps from another list etc.. so Davids answer is more suitable this time.

Not that clever, really.  But in general, you'll have better luck in GH if you keep the "history" that unflattened data lists provide - in this case, the columns and rows allow sorting of intersection results to get the highest one for each point in the original grid.

You could say that the solution I used, as written, depends on a useful bug... the fact that 'BLX (Brep | Line Intersection)' works even when the line doesn't actually touch the brep.

It could be written using longer lines, of course, but this BLX result makes it possible to get the intersections even when the line is extremely short, relatively.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service