# Interpolate curve through points in data tree

**URL:** <https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002>\
**Category:** Grasshopper\
**Tags:** windows\
**Created:** [November 2, 2022, 9:09am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002 "2022-11-02T09:09:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Holt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nicholas_holt/32/386600_2.png) [@Nicholas\_Holt](https://discourse.mcneel.com/u/Nicholas_Holt)\
**Post date:** [November 2, 2022, 9:09am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/1 "2022-11-02T09:09:50Z")

</div>

Hi,

Can someone help me interopolate a curve through this data tree of radial points?

The image shows what I am trying to achieve. I essentially want to interpolate a curve through point {1} [1], {2} [2], {3} [3], etc, to create this curve. But I want to do it in a repeating pattern so that I get an interpolated curve at all 24 points, going to the centre. I can figure out how to retrieve tree and list items in a sequential way.

Go the the far right of the .gh file to find this portion of the code

Thanks

 ![RhinoHelp](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/e/f/1ef0262573ff10b1e73d2edb7075dc21a711c7b7.jpeg)  
[GlassPavillionParametricOriginal.gh](https://discourse.mcneel.com/uploads/short-url/pbxfxtq6vXDT9Ap3A17XBslNPcB.gh) (104.2 KB)

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/772775_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [November 2, 2022, 9:16am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/2 "2022-11-02T09:16:20Z")

</div>

Use the Relative Item component. If your paths are simplified, the offset mask is easy to understand. You want the next path {+1} and the next item (+1).

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

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/3/b/83bfde5eae0dc3ba6225064af47ac1231998191a.png)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/0/1/d01b91a394e9a28fbe2b8f58909990dcc8315f34.png)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/3/8/23846da7305d879ea513ecd19e56c7320c877d63.png)

[interpolate\_spiral\_points.gh](https://discourse.mcneel.com/uploads/short-url/iXMoj2f5jbD0gmRLwq0KX8ai2w6.gh) (11.4 KB)

Depending on the application, I might do it a little different:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/5/b/c5b1bb950f9990de4be168de4f402d64ecd66e15.png)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/4/b/b4bf73d005469df48c6035eac97ac73b044eae3d.jpeg)

[interpolate\_spiral\_points\_02.gh](https://discourse.mcneel.com/uploads/short-url/jrSSmmty00W1gG9jOq2QrmrMCQk.gh) (16.1 KB)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 2, 2022, 11:09am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/3 "2022-11-02T11:09:57Z")

</div>

![missing](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/c/7/bc7422d07aa4d3d8f2aa953eb93dc86a2c2fe3a2.png)

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/772775_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [November 2, 2022, 11:12am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/4 "2022-11-02T11:12:50Z")

</div>

Not very inviting… I didn’t bother looking at the original file.

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 2, 2022, 11:26am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/5 "2022-11-02T11:26:09Z")

</div>

Here is a variation on your version ‘02’:

 ![interpolate_spiral_points_2022Nov2a](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/1/d/31d5c9f54c92cd2297dfb3007a9f88f0558f38fe.png)  
[interpolate\_spiral\_points\_2022Nov2a.gh](https://discourse.mcneel.com/uploads/short-url/q4PUNKuAF8UJ7mIAbSmfvYwilXS.gh) (10.2 KB)

**P.S.** Here’s another idea, a little goofball… Slider in blue group sets ± rotation increment.

 ![interpolate_spiral_points_2022Nov2b](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/7/e/d7e41d79a80b7e82dd78a2bc6242313d337ee086.png)  
[interpolate\_spiral\_points\_2022Nov2b.gh](https://discourse.mcneel.com/uploads/short-url/wj0tzm5fJGc7iOJrlt1U2vPV4sb.gh) (9.8 KB)

---

<div class="post-metadata">

**Author:** ![Nicholas\_Holt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nicholas_holt/32/386600_2.png) [@Nicholas\_Holt](https://discourse.mcneel.com/u/Nicholas_Holt)\
**Post date:** [November 2, 2022, 7:24pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/6 "2022-11-02T19:24:27Z")

</div>

Hi Guys,

Thanks for the responses.

I could get the relative item to work with the ‘line’ command, but it still doesn’t interpolate the curve because it isn’t restructuring/remapping the points.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/f/e/6fe193c20585c99ef0234986fced3ecf491b252c.jpeg)

(I know there are other ways of achieving the form and getting the points, but my points come from panels on a surface lofted from two circles, so I have to work with the structure I have currently. And yes, there are a lot of irrelevant GIS components I had been playing around with in this file)

What I am really trying to do is get items from a tree in this pattern:  
{a}(0),{b}(1),{c}(2),{d}(3),{e}(4),{f}(5),{g}(6),{h}(7),{I}(8) - interpolated curve through points  
{b}(0),{c}(1),{d}(2),{e}(3),{f}(4),{g}(5),{h}(6),{i}(7),{k}(8)) - interpolated curve through points  
{c}(0),{d}(1),{e}(2),{f}(3),{g}(4),{h}(5),{i}(6),{k}(7),{L}(8)) - interpolated curve through points  
Etc…

That should allow me to select the points in the correct sequence. I’m sure there is a way of telling grasshopper to grab items in this pattern (and Ideally restructuring the data), I just don’t know how.

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 2, 2022, 7:44pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/7 "2022-11-02T19:44:16Z")

</div>

> [@Nicholas\_Holt](#):
>
> my points come from panels on a surface lofted from two circles, so I have to work with the structure I have currently. And yes, there are a lot of irrelevant GIS components I had been playing around with in this file)

Do you intend to wait for someone who has all your plugins? Or present a file that all of us can see?

See suggestion #3 on this page:

> [@Help Us Help You](https://discourse.mcneel.com/t/help-us-help-you/50034):
>
> Asking questions and getting answers is what this forum is all about. Although people are generally very helpful, there are things you can do to improve your chances of getting good and quick answers. Below you will find some suggestions, but don’t think of them as rules and especially don’t think of them as guarantees. 1. Choose a descriptive title for your post Don’t title your question Help! or I have a problem or Deadline tonight!, but actually describe the problem you are having. 2. Be s…

> **3. Attach minimal versions of all the relevant files**

[![](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/9/a/9ab755827cd419910c2318f8ea8aa71d7577aaa0.jpeg "Simplifying a Grasshopper network") ](https://www.youtube.com/watch?v=EW8HgWXBcKk)

---

<div class="post-metadata">

**Author:** ![Nicholas\_Holt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nicholas_holt/32/386600_2.png) [@Nicholas\_Holt](https://discourse.mcneel.com/u/Nicholas_Holt)\
**Post date:** [November 2, 2022, 10:32pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/8 "2022-11-02T22:32:35Z")

</div>

Hi Joseph,

Never new about the internalize data command before. Thanks.

This copy shouldn’t have any components that require plugins

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 2, 2022, 11:00pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/9 "2022-11-02T23:00:48Z")

</div>

> [@Nicholas\_Holt](#):
>
> This copy shouldn’t have any components that require plugins

What copy? No file included in your post.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Holt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nicholas_holt/32/386600_2.png) [@Nicholas\_Holt](https://discourse.mcneel.com/u/Nicholas_Holt)\
**Post date:** [November 2, 2022, 11:11pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/10 "2022-11-02T23:11:14Z")

</div>

[GlassPavillionForumHelp.gh](https://discourse.mcneel.com/uploads/short-url/bFdo2wRookVjdBOpdWWX5TbhBzC.gh) (145.2 KB)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 2, 2022, 11:20pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/11 "2022-11-02T23:20:59Z")

</div>

Try again. This file is useless.  
Not that I’ll be the one to help you… but this is the best way to get help.

![missing](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/b/4/9b457e1ad04a6818b51a8abfbd8b8de5853bd0d6.png)

 ![hi_res_GH_canvas24](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/b/0/0b0e698e94662370c1fd18813b79f224025f12b2.png)

---

<div class="post-metadata">

**Author:** ![alirahi32](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alirahi32/32/621083_2.png) [@alirahi32](https://discourse.mcneel.com/u/alirahi32)\
**Post date:** [November 2, 2022, 11:27pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/12 "2022-11-02T23:27:31Z")

</div>

@Nicholas_Holt  
I’m Not Sure if I Understand your intention correctly, But I Guess you can overlook the data management complexities and solve your issue with geometrical approach like this:

 ![0](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/7/f/67fa85dea0a1dc06f42b3e656c89dc94dc30f2d2.png)  
 ![1](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/a/d/4add4f93dae0ed6296cf8f8c6770ea4f240367c0.jpeg)  
[Interpolate-Crv.gh](https://discourse.mcneel.com/uploads/short-url/sYsAymukNSyhY5lh5HizHDxr8iA.gh) (9.4 KB)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 2, 2022, 11:30pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/13 "2022-11-02T23:30:25Z")

</div>

I found that adding an integer slider _( **24** )_ to the Partition ‘S’ input looks useful?

 ![interpolate_spiral_points_2022Nov2c](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/e/f/d/efd310fb8017d81bc5cafa2c7aef9735b72011e8.png)

---

<div class="post-metadata">

**Author:** ![alirahi32](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alirahi32/32/621083_2.png) [@alirahi32](https://discourse.mcneel.com/u/alirahi32)\
**Post date:** [November 2, 2022, 11:45pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/14 "2022-11-02T23:45:13Z")

</div>

Have you Consider Flatten the data tree before “join curve” command?

 ![2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/a/3/4a336f89a315606880028e5a2e863ec182ea25d2.jpeg)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 3, 2022, 12:37am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/15 "2022-11-03T00:37:46Z")

</div>

This looks clumsy to me, more complicated than necessary?

 ![interpolate_spiral_points_2022Nov2c2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/6/1/b61e8cd0e442a4334eaf42ab757dc117fb236f16.png)  
[interpolate\_spiral\_points\_2022Nov2c.gh](https://discourse.mcneel.com/uploads/short-url/prXMmeqOl7xsu5zOPD8Dc8sgcE5.gh) (62.2 KB)

---

<div class="post-metadata">

**Author:** ![Nicholas\_Holt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nicholas_holt/32/386600_2.png) [@Nicholas\_Holt](https://discourse.mcneel.com/u/Nicholas_Holt)\
**Post date:** [November 3, 2022, 7:08am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/16 "2022-11-03T07:08:56Z")

</div>

Hey guys,

Thank you for the help, and all of the solutions. And Joseph\_Oster, I totally forgot that I was moving my data in Elefront components. Sorry about that.

But yeah, Joseph, you totally figured it out. That’s exactly the result I was trying (and failing) to get. Sorry you had to deconstruct the brep’s and start again. I think I’ve just about got my head around your solution and how you shifted the list data. This is a good lesson in managing data in trees.

I’ll try and come up with a less complicated solution and post it. Thank you again for helping me with this. Lots of gratitude to everyone that helped with solutions.

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/772775_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [November 3, 2022, 7:23am UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/17 "2022-11-03T07:23:32Z")

</div>

> [@alirahi32](#):
>
> Flatten

Dear @Nicholas_Holt you probably didn’t even look at my examples in the first post. The line input is flattened because a branch gathers lines going straight up and not around in a spiral shape just yet. Flattening the tree is the easiest way to do this.

It seems you don’t know much about data trees. Therefore I’d suggest reading the modelab primer.

[https://modelab.gitbooks.io/grasshopper-primer/content/1-foundations/1-5/0\_designing-with-data-trees.html](https://modelab.gitbooks.io/grasshopper-primer/content/1-foundations/1-5/0_designing-with-data-trees.html)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [November 3, 2022, 12:36pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/18 "2022-11-03T12:36:45Z")

</div>

> [@Nicholas\_Holt](#):
>
> I think I’ve just about got my head around your solution and how you shifted the list data. This is a good lesson in managing data in trees.

In addition to temporary text panels and the Point List component, these are the tools I use to visualize and understand data trees of geometry:  
 ![data_tree_tools_2022_Nov3a](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/2/6/326bbfd2e422a641e4435860aec615af65a3da03.gif)  
[data\_tree\_tools\_2022\_Nov3a.gh](https://discourse.mcneel.com/uploads/short-url/5YSzOYJq5xlKUxlT0oxBaNQhCh1.gh) (46.6 KB)

Recently I added ‘A’ _(alpha)_ inputs and ‘C’ _(color)_ outputs to ColorB and ColorJ but I rarely need them or use them.

They tend to interfere with each other so I often use them one at a time.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Holt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nicholas_holt/32/386600_2.png) [@Nicholas\_Holt](https://discourse.mcneel.com/u/Nicholas_Holt)\
**Post date:** [November 3, 2022, 6:48pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/19 "2022-11-03T18:48:48Z")

</div>

Hi Martin,

Sorry, I did try to flatten the data coming in but it crashed the RelativeItem component and I couldn’t get any data to come through it.

I had previously tried using ‘ListLength’ +1 to get the next item. However, I couldn’t make sense of how the RelativeItem component worked after the list was flattened and there were no branches left in it (i.e. there were no {n} branches to offset).

I am gonna give that ModeLab document a read. I have some sense of how the data is stored, but I don’t fully know what commands to use with what components to navigate my data. This was why I posted to the group, because I was definitely lacking some knopwledge.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Holt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nicholas_holt/32/386600_2.png) [@Nicholas\_Holt](https://discourse.mcneel.com/u/Nicholas_Holt)\
**Post date:** [November 3, 2022, 6:52pm UTC](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002/20 "2022-11-03T18:52:06Z")

</div>

Thanks Joseph. This is a great tool set. Definitely helps with visualizing data. Just gotta learn how to navigate it now.

Thanks Again

[Next page](https://discourse.mcneel.com/t/interpolate-curve-through-points-in-data-tree/150002.md?page=2)
