# How to merge Branches but keep it tree

**URL:** <https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437>\
**Category:** Grasshopper\
**Created:** [November 29, 2020, 8:21pm UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437 "2020-11-29T20:21:43Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 29, 2020, 8:21pm UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/1 "2020-11-29T20:21:43Z")

</div>

Hi I’m trying to figured out how can I merge branches and keep tree.  
This problem I have also in more complicated project and this is just example 🙂

I would like to merge “red colour” branches {0;0} up to {0;7}. and get {0;0} etc.  
with keeping the green colours branches ( not like Trim )

Because i want to have just 3 curves in this case but still I would like to do it through tree

 ![Screenshot 2020-11-29 at 21.02.54](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/9/0/190e5937f7da970719974ff30417a6df1783bf0f.jpeg)

[201129\_Offset\_Both\_Sides.gh](https://discourse.mcneel.com/uploads/short-url/uVt4Ua58BVxzfN57h4JL6kFl8Jw.gh) (14.3 KB)

I tried to trim, shift adn Path Mapper but with no right results.

[201130\_Offset\_Both\_Sides\_R6.3dm](https://discourse.mcneel.com/uploads/short-url/8w1M7ukV5ZrblWylwWEMSAqI7dl.3dm) (40.4 KB)

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [November 29, 2020, 8:49pm UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/2 "2020-11-29T20:49:43Z")

</div>

not sure if I got your question right 🙂

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/3/f/63f9badac6885bee65431b46722e9a53cdf79cdf.png)

[201129\_Offset\_Both\_Sides\_re.gh](https://discourse.mcneel.com/uploads/short-url/umnsgVBEfzdrEncoHJxpHI8gcdE.gh) (16.7 KB)

---

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 30, 2020, 7:14am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/3 "2020-11-30T07:14:39Z")

</div>

Yes It’s look right but it doesn’t do what I would like to Do. Result should to merg Curve 0 and 1.  
And be able to select each curves

- I still have a feeling that this {A;B} → {A;0} just rewrite all elemnts in 0 thas mean not merging but erasing

 ![Skärmavbild 2020-11-30 kl. 08.11.50](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/d/6/3d6c5d832870c37c9faebd88305be88e054322d1.jpeg)

 ![Skärmavbild 2020-11-30 kl. 08.11.43](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/8/2/f82639b6fb9e99142ca0070c6655fc41101e8fcc.jpeg)

---

<div class="post-metadata">

**Author:** ![anon39580149](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@anon39580149](https://discourse.mcneel.com/u/anon39580149)\
**Post date:** [November 30, 2020, 7:25am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/4 "2020-11-30T07:25:46Z")

</div>

Don’t forget to internalize data

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/4/e/14eb56ea4a2444bc8bebb3b3de3ccb40c3518915.png)

---

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 30, 2020, 7:40am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/5 "2020-11-30T07:40:54Z")

</div>

Can you be more specific please ? I don’t understand what you mean

---

<div class="post-metadata">

**Author:** ![anon39580149](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@anon39580149](https://discourse.mcneel.com/u/anon39580149)\
**Post date:** [November 30, 2020, 7:52am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/6 "2020-11-30T07:52:05Z")

</div>

Your curves are not available in the script

---

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 30, 2020, 7:56am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/7 "2020-11-30T07:56:06Z")

</div>

Uploaded 😉

[201130\_Offset\_Both\_Sides\_R6.3dm](https://discourse.mcneel.com/uploads/short-url/8w1M7ukV5ZrblWylwWEMSAqI7dl.3dm) (40.4 KB)

---

<div class="post-metadata">

**Author:** ![scottd](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/scottd/32/494002_2.png) [@scottd](https://discourse.mcneel.com/u/scottd)\
**Post date:** [November 30, 2020, 9:03am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/8 "2020-11-30T09:03:11Z")

</div>

I use [Treesloth](https://www.food4rhino.com/app/treesloth) for extra tree utilities.

---

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 30, 2020, 9:30am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/9 "2020-11-30T09:30:33Z")

</div>

Big thanks from answer from you 💛, unfortunately I’m Mac user and plugins no help me to fix it

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [November 30, 2020, 10:30am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/10 "2020-11-30T10:30:29Z")

</div>

maybe this is the data structure you are looking for?

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

[201129\_Offset\_Both\_Sides\_re2.gh](https://discourse.mcneel.com/uploads/short-url/zAqAO8Rk5EClU6Zlp7UkXWPVRH1.gh) (19.1 KB)

---

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 30, 2020, 11:58am UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/11 "2020-11-30T11:58:41Z")

</div>

I’m really struggling what have you did. Because it seem that get the same tree like before and lines also not merge

 ![Skärmavbild 2020-11-30 kl. 12.57.41](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/2/3/723a6b28919414c2574c89a846bcabf6ef6a1b55.jpeg)

I want it like 1. branch including this curve ( red ) 2. branch including the other curve ( purple ) and 3.( yellow) branch including last curve

 ![Skärmavbild 2020-11-30 kl. 12.54.37](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/2/c/92c467615a81e460d38313c420a2fdaf323c95be.jpeg)

---

<div class="post-metadata">

**Author:** ![rajeev\_pulari](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rajeev_pulari/32/604732_2.png) [@rajeev\_pulari](https://discourse.mcneel.com/u/rajeev_pulari)\
**Post date:** [November 30, 2020, 12:27pm UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/12 "2020-11-30T12:27:17Z")

</div>

chekc it r u looking for this !

 ![201129_Offset_Both_Sides_re3](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/e/c/9/ec9485bd0aac035f99598a0690e4bc061804f3fd.png)

---

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 30, 2020, 1:54pm UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/13 "2020-11-30T13:54:13Z")

</div>

Wau this is working Thanks

the Tree is also changed after flipping unfortunately but it’s something what I can work with it 🙂

 ![Skärmavbild 2020-11-30 kl. 14.52.23](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/b/6/3b6a477302f81480d8a9e4c3e5805680143b869a.jpeg)

---

<div class="post-metadata">

**Author:** ![slavikvojtech](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/slavikvojtech/32/724206_2.png) [@slavikvojtech](https://discourse.mcneel.com/u/slavikvojtech)\
**Post date:** [November 30, 2020, 9:19pm UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/14 "2020-11-30T21:19:30Z")

</div>

Thanks to everyone who try to help me here is my solution 🙂

 ![Screenshot 2020-11-30 at 22.13.28](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/1/6/01678667ffa68af8a600ada6369f21b73c0ce398.jpeg)

Still I don’t know how can I combine two dif. trees in one but maybe later I will understand how can I do this

Maybe you will laugh to me but I just Used Solid Union and for my case works perfectly with merging tree

 ![Screenshot 2020-11-30 at 22.16.48](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/7/f/c7f65848081b33ffcbec2a72913b417c38e099be.jpeg)

---

<div class="post-metadata">

**Author:** ![anon39580149](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@anon39580149](https://discourse.mcneel.com/u/anon39580149)\
**Post date:** [November 30, 2020, 10:17pm UTC](https://discourse.mcneel.com/t/how-to-merge-branches-but-keep-it-tree/113437/15 "2020-11-30T22:17:06Z")

</div>

If you want this result simply use join directly

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/e/c/0/ec0a34801a2b9189bc71f4b76bace3769c7181aa.jpeg)
