Unrolling reverses the additional geometry order


I have two surfaces: one flat, one curved, with the similar UV direction.
I would like to unroll them, and unrolled the points on them as well:

For the curved surface, after unrolling, the point order remains the same:

However, for the flat surface, the order of the points gets reversed:

What is causing the difference between these two?

I get the same result in both Rhino 6 SR30, and Rhino 7 Beta (7.0.20301.12003)

Attached is an example code, and both surfaces.
If this is expected Rhino behavior I can always check if the surfaces are curved or not.
I still want to know if it is intentionally set up like this.
unroll flat, curved srfs.3dm (43.8 KB)

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import Rhino

# a) inputs
id = rs.GetObject("select brep to unroll")
brep = rs.coercegeometry(id)

# for flat 'brep'
pt_L = [
        rg.Point3d(161.381105, -4.70594, 13.736569),
        rg.Point3d(171.388057, -4.691688, 18.407002),
        rg.Point3d(181.024381, -4.677964, 22.802705)]
# for curved 'brep'
pt_L = [
        rg.Point3d(212.118075, -8.081183, 3.022045),
        rg.Point3d(219.292585, -12.429482, 12.362912),
        rg.Point3d(230.643013, -13.730152, 21.154316)]

# b) perform unroll
unroller = rg.Unroller(brep)

# add addtional geometry to the unroller
for pt in pt_L:

unrolledGeom = unroller.PerformUnroll()
brep_unrolled = unrolledGeom[0][0]
pt_L_unrolled = unrolledGeom[2]

# c) label
# label pt_L before unrolling
for i in range(pt_L.Count):
    rs.AddTextDot(str(i), pt_L[i])

# label pt_L after unrolling
for i in range(pt_L_unrolled.Count):
    rs.AddTextDot(str(i), pt_L_unrolled[i])

Hi Djordje,

You didn’t leave the dots in your file, but I put some on and ran them through my Multi-unroll script (using the RhinoCommon unroller method) and they came out in the right places… I wonder what is different?

unroll flat-curved srfs-msh.3dm (67.9 KB)
MultiUnroll.py (7.4 KB)

Hi Mitch,

Thank you for the testing.
The points are generated by the upper code.

I tried your script, and got the same result: unrolled points order is reversed with flat surface:

Attached is your modified script and .3dm files with input points.
MultiUnroll2.py (7.8 KB)
unroll flat, curved srfs2.3dm (42.9 KB)

OK, I see, it actually puts the points in the right place but in reversed “time” (list) order. As I used dots, it was not possible to see that. So, yeah, maybe there is something mixed up there.

1 Like


See my reply here:

In short, unroller does not reliably keeps the input order.
You need to query the input index of the results.
For input points this is not available.