Grasshopper

algorithmic modeling for Rhino

Hello everyone,

I have a set of 3 polygons, but the amount can vary, and I need to find the closest pair of sides.

I was able to achieve this rather manually, I used explode tree so its does not work with the amount of polygons changes.

Hopefully someone can come up with a better solution.

Views: 1025

Attachments:

Replies to This Discussion

"I need to closest pair of sides between each other." Sorry, I can't understand

Sorry, little typo there let me try again:

I have x numbers of polygons and I need to find the sides that are closer to each other.
I appraoched this by generating a line fron the mid points of all sides of one polygon to the mid points of all the sides of the other polygon. I measured their length and kept the smaller line. Then I traced this line back to the sides it came from. Problem is this method is only working for 2 polygons

Rumor is that you have aspirations to cross the Rubicon (but using the wrong Language for AEC related stuff).

Thus ... get the right thing in the right language.

Moral: Life sucks

Attachments:

Hey Peter, Thank you for this.

Could you help me take this one step further? It ended up being much more complicated than what I initially thought... (wouldn't be the first time)

If not I would understand, you already helped me with my OP, don't wanna give the impression of exploiting you for your skills in the dark side arts.

Haven said that, this would be the goal. I needed the sides to generate a tween curve, which trims the rays that come from each circle. These lines do not coincide in the same point, but that is not an issue.

The tween curve is one thing, the shatter another ( which I wasn't able to properly manage to produce this).

Thing with the tween curve is that the sides need to be oriented properly, so I had to flip some, it worked fine for one situation, but not with extra polygons, so maybe the tween curve isnt the best option to generate this trimming axis. Maybe simply a line from each corner to another, mid points and line through those.

Definitely the complex part is the trimming, specially when more polygons are involved, luckily I ll be only working with regular polygons for this.

Im skeptic about the logic of closest sides to each polygon as it would mess up the trimming(blue), I think each polygon should have its closest connection established but not more, sure a polygon can have multiple connections as it could be the closest to x others.

Thanks for any help in advance,

Shynn

Attachments:

There's other ways to achieve what you want (but post a "typical" curve/polygon layout since ... well... AI is not (yet) arrived and computers are still stupid). I fact I have pretty much exactly what you want ... but it's rather impossible to recall the workstation/directory/file name for the def (around 10K++ around plus advancing Alzheimer == chaos)

In the mean time get the trad V1A update that is "better" (worst actually).

Moral: Ducati Uber Alles

Attachments:

Impossible to find the thing (searched even for "most stupid and useless defs" ... but found nothing).

In the mean time get this (rather off-topic). Added in a great hurry a 2nd thingy that uses Mesh connectivity Methods to speed up considerably  Curve/Curve ccx events and the likes. There's a very tricky approach for going from mesh.TopologyVertices indices to mesh.Vertices indices (in order to get the splitting curve pairs per mesh edge in compliance with the classic edge to vertex connectivity Tree).

The MakeSplittedTree Method actually requires recursion for splitting (further) the splitted Mesh edges (with other Curves that may happen to intersect) ... but I'm out of cigars right now > Adios Amigos.

Attachments:

Haha, one man's trash is another man's treasure they say!

Thank you still Peter.

I was thinking that if the intersection component would group the intersections of each curve in a branch, I could sort those items inside each breach based on the start point of the curve, and then list item 0, leaving with the first intersection of the curve, avoiding multiple shatters... Will try once home.

BTW: Found a couple of minutes more on that Split this with that issue. See a simple 3rd C# that either accepts an user Curve or if there's none around makes some internal random test one (Line or Curve) and then cuts the mustard without recursion (which may could be a freaky concept for a novice in Dark Matters).

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