I am currently working on upgrading a plugin from Rhino 5.0 to Rhino 6.0 which is a bit of a pain in the ass since there is no changelog for the API (or am I missing something… ).
Just to illustrate:
I spend about 3h looking for the error when unrolling a surface:
Since the function AddFollowingGeometry is a bit of a blackbox, my guess is that in Rhino 5 it added the curves at the end of the list, now it adds it at the beginning of the list.
Is there any chance a ChangeLog for the API is released, and yes I know there is Unroller.FollowingGeometryIndex but come on a stable sorting would be expected…
I don’t believe there is a single change log that douments all of the additions to RhinoCommon between V5 and V6. However, every week we post WIPs and Service Release candidates. In each announcement is a change log.
The AddFollowingGeometry methods just appends to lists.
Can you provide a model, along with sample code we can run here, that produces different results in V5 and V6?
back a step I figured out what the problem was with unroll it is not between versions it is within the same version. The sorting of the input curves seams to be unstable, see attached file.
The reveres sorted case is a simple rectangle plane surface (which is a rare usecase for the plugin., so this is why I have missed it in Rhino 5)
Maybe there is a good reason for this but again undocumented black box behaviour is bit … when you develop plugins for companies…
You would expect that if you input curve A,B,C,D it would output curve A,B,C,D … Maybe documentation can be updated…
It doesn’t take much effort to sort the output following curves if needed:
private void RunScript(Brep brep, List<Curve> curves, Curve extra, ref object A)
{
var unroller = new Unroller(brep);
unroller.AbsoluteTolerance = RhinoDocument.ModelAbsoluteTolerance;
unroller.AddFollowingGeometry(curves);
unroller.AddFollowingGeometry(extra);
Curve[] unrolled_curves;
Point3d[] unrolled_points;
TextDot[] unrolled_dots;
var breps = unroller.PerformUnroll(out unrolled_curves, out unrolled_points, out unrolled_dots);
if (breps.Length > 0)
{
var out_curves = new Curve[unrolled_curves.Length];
for (var i = 0; i < unrolled_curves.Length; i++)
{
var curve_index = unroller.FollowingGeometryIndex(unrolled_curves[i]);
Print(string.Format("Output({0}) = Input({1})", i, curve_index));
out_curves[curve_index] = unrolled_curves[i];
}
A = out_curves;
}
}