# Mesh Between 2 Sets of Points Along Curves

**URL:** <https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247>\
**Category:** Grasshopper\
**Created:** [September 23, 2019, 10:53am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247 "2019-09-23T10:53:45Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 23, 2019, 10:53am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/1 "2019-09-23T10:53:45Z")

</div>

I have 2 sets of points along 2 curves that I want to create a mesh between.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/8/5/854783e6b5d671712016f1421c5474b0914bdd96.png)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/a/4/a452041a12b711cbec4ab4aaa59f1c0820d42611.png)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/6/d/6d812e29d5c73db09fb42a1f900039c9dc33dacf.png)

If the curves were straight lines, this would be easy - I could just take point n from curve1 and points n & n+1 from curve 2 and create a mesh face - but because they are curves the points do not stay adjacent as the curves bend and the mesh faces do not stay within the curves.

My attempt in the attached definition with internalised point data takes the point n from curve 1, the closest point in curve 2 and then the closest point from that in curve 1 or curve 2. It works in places but not all along the curve.

It feels like I need some script to do this but I would prefer to do it in native GH.

[STITCH\_EDGES.gh](https://discourse.mcneel.com/uploads/short-url/kFoB3ggVtaiUfjG1sWQtsqDwrOn.gh) (13.2 KB)

---

<div class="post-metadata">

**Author:** ![maje90](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maje90/32/771922_2.png) [@maje90](https://discourse.mcneel.com/u/maje90)\
**Post date:** [September 23, 2019, 11:11am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/2 "2019-09-23T11:11:04Z")

</div>

![2019-09-23%2013_09_25-Window](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/1/a/1a1a44cf38c2079e188bf304244544de618ac168.png)  
[STITCH\_EDGES\_V2.gh](https://discourse.mcneel.com/uploads/short-url/gBtDLgGaQsWRGOomBKQFBjrz9fd.gh) (9.8 KB)  
Only late i’ve seen those are not XY flat point sets… but it is still working.  
Concept might be handy.  
(won’t work with complex 3d point sets)

---

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 23, 2019, 11:28am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/3 "2019-09-23T11:28:20Z")

</div>

Thanks!  
The concept makes sense but unfortunately not working in R5 although I can’t see why it wouldn’t… I get an invalid mesh out of the CullF component.  
I’ll try and recreate it from scratch in R5 and see if it works.

EDIT: Had to change the direction of the SDL Line and it worked

---

<div class="post-metadata">

**Author:** ![akilli](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/akilli/32/514967_2.png) [@akilli](https://discourse.mcneel.com/u/akilli)\
**Post date:** [September 23, 2019, 11:29am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/4 "2019-09-23T11:29:32Z")

</div>

@maje90 gave me some ideas. It looks good but given the snakeiness, it’s kind of hard to tell if it is good.

 ![Canvas%20at%2007%3B25%3B56](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/b/3/b3ed5eafcc5678154314b3de20b6ec812ef04b41.png)

Edit:  
I forgot to weld the resulting mesh.  
[STITCH\_EDGES-b.gh](https://discourse.mcneel.com/uploads/short-url/c9s9cwC0VNmH0yvgwWhPQTVoyQJ.gh) (9.0 KB)

---

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 23, 2019, 11:33am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/5 "2019-09-23T11:33:33Z")

</div>

I think this will have the same issues I faced… because the points do not stay adjacent along the curves (i.e. at the start pt1a is next to pt1b but in the middle pt16a is next to py18b) then the Extruded surfaces you create become crossed over.

---

<div class="post-metadata">

**Author:** ![AndersDeleuran](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andersdeleuran/32/476683_2.png) [@AndersDeleuran](https://discourse.mcneel.com/u/AndersDeleuran)\
**Post date:** [September 23, 2019, 11:46am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/6 "2019-09-23T11:46:57Z")

</div>

You could make a closed polyline and [then triangulate it](https://discourse.mcneel.com/t/close-an-opening-like-this-one-mesh/62819/4). Like so:

 ![2019-09-23%2013_43_50-Rhinoceros%206%20Commercial%20-%20%5BPerspective%5D](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/4/3/43ebec345b865d1fb2df9fc142d61effe37cff8c.png) [170811\_TriangulatePolyline\_01.gh](https://discourse.mcneel.com/uploads/short-url/mKROxkGK7k7nk39XizGhZrzb361.gh) (8.3 KB)

---

<div class="post-metadata">

**Author:** ![maje90](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maje90/32/771922_2.png) [@maje90](https://discourse.mcneel.com/u/maje90)\
**Post date:** [September 23, 2019, 11:47am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/7 "2019-09-23T11:47:30Z")

</div>

Yes, that SDL part is really silly, it was just the simplest method to have a small but working solution.  
Any other method to cull unwanted faces will be good.  
I just think that delanuary mesh is really useful in this context… if points are enough “projectable” to a plane…

Edit: Anders solution is way better! Well done!

---

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 23, 2019, 12:18pm UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/8 "2019-09-23T12:18:16Z")

</div>

Thank you! This is really nice. I’d wondered whether I’d need code to do this and imagined all kinds of complicated ways of looping through the points and connecting them. It would have probably taken me a month and been 1700 lines of code so it’s great to see someone do it so simply!

---

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 23, 2019, 12:19pm UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/9 "2019-09-23T12:19:10Z")

</div>

I had looked at delaunay but didn’t think to cull unwanted faces. Certainly a good concept to have in the toolbag for future.

---

<div class="post-metadata">

**Author:** ![chanley](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chanley/32/341693_2.png) [@chanley](https://discourse.mcneel.com/u/chanley)\
**Post date:** [September 23, 2019, 1:52pm UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/10 "2019-09-23T13:52:01Z")

</div>

@AndersDeleuran 's solution is pretty sweet! If it’s just 2 lines…You could do something like this as well. (requires weaverbird’s mesh from lines)

 ![MeshStrip](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/f/6/f64a86d5079f13346a86a65faacfbb1df1841624.png)

---

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 23, 2019, 2:25pm UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/11 "2019-09-23T14:25:24Z")

</div>

Any idea why it doesn’t work on these points?  
[170811\_TriangulatePolyline\_Nope.gh](https://discourse.mcneel.com/uploads/short-url/unRplF64nVkW2sJxL6HVzchzYaN.gh) (3.7 KB)

---

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 23, 2019, 2:29pm UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/12 "2019-09-23T14:29:18Z")

</div>

Thanks!  
I think, if you try this on curves that are close together with high curvature, the mesh faces get messed up if the points become out of sync along the curves… i.e. because the outer curve is longer and the points are evenly spaced, it’s points lag behind the inner curve so the mesh edges cross over the curve boundary.

---

<div class="post-metadata">

**Author:** ![AndersDeleuran](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andersdeleuran/32/476683_2.png) [@AndersDeleuran](https://discourse.mcneel.com/u/AndersDeleuran)\
**Post date:** [September 26, 2019, 7:49am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/13 "2019-09-26T07:49:40Z")

</div>

Ah yes, the triangulate method has been known to [not always work predicatively in all cases](https://discourse.mcneel.com/t/close-mesh-gaps/73320/18). A simple/robust/efficient method is to generate ruling lines between the two set of points, and then mesh these (as a two-dimensional point grid), here using the components from `Mesh Edit`:

 ![2019-09-26%2009_44_42-Grasshopper%20-%20190926_TriangulatePolyline_Yup](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/a/0/a00f1b9513f7d45cfe9074d38ede97e4546b0263.png)

[190926\_TriangulatePolyline\_Yup.gh](https://discourse.mcneel.com/uploads/short-url/dnpAkuYr83evlpDOSFDWKK28D7Q.gh) (8.5 KB)

---

<div class="post-metadata">

**Author:** ![martynjhogg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martynjhogg/32/513395_2.png) [@martynjhogg](https://discourse.mcneel.com/u/martynjhogg)\
**Post date:** [September 26, 2019, 8:12am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/14 "2019-09-26T08:12:07Z")

</div>

This looks good for when there are equal numbers of points in each curve.

---

<div class="post-metadata">

**Author:** ![AndersDeleuran](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andersdeleuran/32/476683_2.png) [@AndersDeleuran](https://discourse.mcneel.com/u/AndersDeleuran)\
**Post date:** [September 26, 2019, 8:15am UTC](https://discourse.mcneel.com/t/mesh-between-2-sets-of-points-along-curves/89247/15 "2019-09-26T08:15:11Z")

</div>

It’ll definitively be more predictably with even points. But you can (as this demonstrates) generate the rulings from uneven amounts as well. Though I’m sure there are cases here as well where this won’t work so well.
