# Project curve on plane but keep it's lenght

**URL:** <https://discourse.mcneel.com/t/project-curve-on-plane-but-keep-its-lenght/58591>\
**Category:** Grasshopper\
**Created:** [March 21, 2018, 9:25am UTC](https://discourse.mcneel.com/t/project-curve-on-plane-but-keep-its-lenght/58591 "2018-03-21T09:25:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidsmavrov](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidsmavrov/32/767152_2.png) [@davidsmavrov](https://discourse.mcneel.com/u/davidsmavrov)\
**Post date:** [March 21, 2018, 9:25am UTC](https://discourse.mcneel.com/t/project-curve-on-plane-but-keep-its-lenght/58591/1 "2018-03-21T09:25:20Z")

</div>

Is there a way to project a 3D curve/surface onto 2D plane but keep its edges lenght? The idea is that I have to be able to unroll a doubly curved surface/mesh. Split it with geodesic lines and then flatten it into 2D curves.

 ![geodesics](https://global.discourse-cdn.com/mcneel/original/3X/e/7/e7c07eccf06e9fc3236c6c5a9d2a61f7793b0ea4.JPG)

Here is an example geometry:  
[Project on plane.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/4/04882d89187ce7a687a1233103e11dc4ec34c119.gh) (3.9 KB)

The usual Unroll components produce a result which is wrong. (See image below). The goal is to keep the area in 3D and 2D as similar as possible and also the individual edges lenghts as similar as possible also (a certain error is permisable). Also all the edges when flattened have to be orientated towards the center of their coresponding polygon as in the blue strip in the first image.

Bad result from Unroll components  
 ![wrong](https://global.discourse-cdn.com/mcneel/original/3X/f/1/f1d0faee62787e3f82be16addcf1f325feb8deb0.JPG)

---

<div class="post-metadata">

**Author:** ![davidsmavrov](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidsmavrov/32/767152_2.png) [@davidsmavrov](https://discourse.mcneel.com/u/davidsmavrov)\
**Post date:** [March 21, 2018, 11:59am UTC](https://discourse.mcneel.com/t/project-curve-on-plane-but-keep-its-lenght/58591/2 "2018-03-21T11:59:10Z")

</div>

It could be made easier. I can triangulate the surface into a mesh. Then what I need is to some how project the resulting mesh triangular faces and keeping their original size. The faces need to remain connected.

[Mesh Triangles.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/a/0/a006248643f94a499685c9a072b4298ca207656b.gh) (2.5 KB)

 ![pat1](https://global.discourse-cdn.com/mcneel/original/3X/4/b/4baa4dfb9749d4863e9598807821a160d6b616e1.JPG)

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [March 22, 2018, 7:26pm UTC](https://discourse.mcneel.com/t/project-curve-on-plane-but-keep-its-lenght/58591/3 "2018-03-22T19:26:36Z")

</div>

You can use IVY for that

> **[Ivy](https://www.food4rhino.com/en/app/ivy)**
>
> Ivy is a Grasshopper add-on for mesh segmentation and fabrication.

[http://www.grasshopper3d.com/group/ivy](http://www.grasshopper3d.com/group/ivy)

Or Kangaroo has also an unroller for mesh

---

<div class="post-metadata">

**Author:** ![davidsmavrov](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidsmavrov/32/767152_2.png) [@davidsmavrov](https://discourse.mcneel.com/u/davidsmavrov)\
**Post date:** [March 22, 2018, 8:15pm UTC](https://discourse.mcneel.com/t/project-curve-on-plane-but-keep-its-lenght/58591/4 "2018-03-22T20:15:03Z")

</div>

Yes, Ivy, Kangaroo for meshes and a bunch of other plugins which have an Unroll component for surfaces do the job well after a proper triangulation. I have managed to do this days ago. I wonder if the unrolling itself could be done without a plugin but via standard grasshopper components. Technically the task is to take the second def I have posted and align the triangles on the same plane and join them.

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [March 22, 2018, 8:20pm UTC](https://discourse.mcneel.com/t/project-curve-on-plane-but-keep-its-lenght/58591/5 "2018-03-22T20:20:55Z")

</div>

Yes and no. For my own project I did that with my own component, I also made a script to suppress inner points on meshes. What is possible is to use mesh to nurbs and then use unroller class from Rhinocommon in a little script  
See here

> [@Unroller bug?](https://discourse.mcneel.com/t/unroller-bug/55568):
>
> Hello, I found a little problem with Unroller class. If I write that everything is working well Unroller unroll = new Unroller(brep); unroll.ExplodeOutput = false; Curve crvs; Point3d pts; TextDot tDots; Brep breps = unroll.PerformUnroll(out crvs, out pts, out tDots); A = breps; But if I write that, there is no output in breps ? The number of unrolled breps is OK. Unroller unroll = new Unroller(brep); unroll.ExplodeOutput = false; List breps = new List(); int num = unroll.Perfo…
