Hello,
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:
unroller.AddFollowingGeometry(pt)
unrolledGeom = unroller.PerformUnroll()
brep_unrolled = unrolledGeom[0][0]
pt_L_unrolled = unrolledGeom[2]
Rhino.RhinoDoc.ActiveDoc.Objects.Add(brep_unrolled)
# 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])