Achieving what a 'polygon bridge' tool does (with miss-match poly count) in Grasshopper

Hi All,

For a footwear project we are working on we need to make a watertight seal to two different trimmed polygon naked edges loops. There’s no possibility to match the edge count on these since they come from completely different definitions/processes and they are trimmed by an aleatory 3D curve that does not look into poly flow at all, by design.

When ne have ‘matched polyline/polygon naked-edge count’ we can use the Mesh loft component from Chromodoris plugin:

But we don’t have a way to make a polygons loft (or bridge) of mismatched point-count polylines.

Here’s an example of what I created by shattering 2 polylines into 10 segments so lofts do not get unmanageabe and twisty:

I manually created the polygons in one section of the shattered curves, and added random color to each polygon for visual clarity.

We need to create polygons ONLY using the existing polylines as input, no adding any extra vertices, otherwise the mesh-Join will not be watertight. for analysis and RP.

A possible logic needed I think it would be:

  • which ones of these two shattered polylines has smallest point count? (in this case is the upper curve in Z direction, called point 1)

  • Starting with smallest point-count curve, make a quad polygon between: (point 1 or polyline 1), point 2 on polyline 1, closets point of polyline 2 to (point 2 of polyline1), closets point of curve 2 to (point 2 on curve 1)

  • This keeps going until there are quad polygons fill the entire upper polyline chain:

  • Then fill with triangles all the gaps in the lower curve.

like this…

BTW, this is very similar to what the Bridge too in Modo would do:

So basically we need a bridge tool in Grasshopper. We have very many applications for this tool besides this RP watertight hack use-case.

Here’s the grasshopper file with internalized polylines and sample manual mesh:
making_polygon_bridge_with_mismatched_count_polylines_01_gf_190402.gh (30.5 KB)

In general we need to have a bunch of SubD modeling tools in GH, and I really really hope this is coming and soon, because the workflows that this allows are absolutely amazing.

In the meantime if anyone has any ideas of how to achieve this in GH Iwe’d really appreciate it.

Thanks!

Gustavo

I think this should do the trick.

  • Explode the two polylines. Call the polylines P1 (higher point count) and P2 (lower point count)
  • For each point in P1, find the closest point on P2 and draw a line between the P1 point and the P2 point. Now all points in P1 are “bridged”, i.e. they are connected by a line to a point on P2.
  • Select all points on P2 that are not bridged and connect them to their closest point on P1. Now all points on P1 and P2 are bridged.
  • Feed the exploded polylines P1 and P2 and their bridge lines into wbWeave component to get a mesh.

Could be done segment-by-segment if that is nicer for the lofts.

polygon_bridge.gh (46.6 KB)

2 Likes

Hi @S_L, this is great! very smart way to solve it. and you are right, there’s no need to segment the inputs, since you are preventing any twisting by dealing with closest points > lines as mesh inputs.

Thanks so much!

Gustavo

Whether it’s useful or not, but since I have noticed how much you love scripting, here’s a slightly compacted version of the “whole” thing version (soaring above the original GH version):

polygon_bridge_R2.gh (53.3 KB)

// Rolf

1 Like

Just another method. In Pufferfish I have a Compatabilize Polylines Component. It doesnt use closest points, instead it uses some domain stuff to fill in missing verts and equals out the new verts within the polyline span they get added to, the result topology may or may not be what you are looking for, because the edge topology wont collapse to triangles to meet the upper and lower topology, but in this way you will have all quads. (I also use Tree Sloth flip last, and Mesh Tools mesh loft, but you can use whatever you like there for the curve matching and mesh lofting)


CompatPline.gh (20.0 KB)

2 Likes