Grasshopper

algorithmic modeling for Rhino

I need to mark the intersection points between the lines.

If possible, i should be able to raise one of the sets and still have this intersection point in both lines

Views: 2348

Attachments:

Replies to This Discussion

'MCX Multiple Curves' intersection component will give you the points.  When you move one set of curves, you can move all the intersection points with them?

Thank youuuu!!1

I need to be able to do this (image) and still have the intersection points

As I said, you can move the points along with the curves.  Sorting them out is another can of worms...

P.S.  Why is that Rhino file SO BIG?  And why post it at all, as it's not required for your GH code?

Attachments:

thats perfect!!! thank youu

Now i need to connect these points into a curve

Attachments:

What points?  The image in your post is broken/missing.  Why a Rhino file instead of GH?  I told you that sorting out the points is a "can of worms"; it requires an understanding of data trees to interpret the output from 'MCX'.

Thats the thing i need to do (in the rhino file)

Attachments:

Sorry, I'm done.  Gotta go.

OK, it's not likely you are ready to get this on your own...  I refer you to this thread:

Set Member Index Example (MIndex)
http://www.grasshopper3d.com/forum/topics/set-member-index-example-...

I don't have time to take on this project but hacked a few bits together that might get you started; enough to see that you're in a world of pain here when it comes to data trees!

To start with, it looks like the code that generates the second set of curves (tangents) is identical to the first except for one extra component?  So I disabled the duplicate code and rewired it like this:

Then I noticed that the second point in your desired curve (red arrow below) has not been determined in the GH, either by intersection points or other means.  So for now, I skipped that point:

The code on the right (below) is what I added to organize the points to make your curves.  Notice the use of 'Merge' before 'MCX'; the results depend on which set of curves is 'A' vs. 'B'.

The result is not too bad (minus that one point in each curve) but there are anomalies in the data that create problems and I don't have time to figure it all out.  Sorry.

One of the problems is visible in the panel below, showing the output from 'Weave'.  There are 26 curves (0 to 25) and this data is pretty good up through path "{0;0;25;0}".  You could either figure out why there is more data than you want, or just ignore (somehow) the rest of the 50 paths/branches in this data tree.

Another problem is that the four points in each branch/path (five when you add the missing point) are in proper sequence for all branches except {0;0;0;0}.  Again, you could figure out why or just sort the points by their distance from the center point, as I did.

Sorting is probably better as it would make it easy to merge that second point...  OK, I'll add and merge that missing point, and trim the tree.  Oops, I did it again.  OCD is a terrible thing!

There is still a problem though - curves/pipes 0 through 4 are messed up.  See yellow arrows.  Well, 21 out of 26 isn't bad, eh?

I REALLY need to step away from this keyboard!  I left my 'Tree/List Viewer' tool in the code as it might be useful (it is to me).  Good luck.

Attachments:

you are a genius!!!

thank youuuuuuuu

Would be better to identify and fix the garbled point lists much earlier instead of hacking at the data tree later... OH!  I see it now.  The bottom lines all intersect at the middle while the raised tangent lines don't, causing a data mismatch. So...

  1. 'Cull' all 'MCX' points that equal the origin, and apply the same cull pattern to the 'iA' list (light blue group).
  2. Move the "Second Point" merge and 'Sort' by distance to earlier in the process.
  3. Add a 4th point to the 'List Item' index list (0, 3, 5, 6).
  4. Remove the tree hack nonsense.

Voila!  Perfection.  Now that is... persistence.

“Two percent is genius and ninety-eight percent is hard work.”
-- Thomas Edison, April 1898

By the way, there is another way to do this kind of thing that doesn't require such deep knowledge as this method.  Not considered as elegant because it doesn't apply in all cases, but it would work here.  Create just one curve/pipe and rotate it 26 times.

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service