siemen
November 5, 2020, 2:03pm
1
I’m trying to use the Unroller class to unroll a few curves and it seems like the unroller splits up 1 of the curves in 2 pieces after unrolling. Joining them afterwards works fine so they are within tolerance of each other. Is there something I’m overseeing or does this just happen sometimes?
The code I’m using to go from the black to the green line:
Unroller unroll = new Unroller(brepToUseForEnrolling);
unroll.AddFollowingGeometry(curvesToUnroll);
unroll.AbsoluteTolerance = doc.ModelAbsoluteTolerance;
unroll.PerformUnroll(out Curve[] unrolledcurves, out Point3d[] unrolledpoints, out TextDot[] unrolleddots);
I tried both with setting the AbsoluteTolerance and without setting that to the modelabsolutetolerance.
And if this is just the way the unroller sometimes work: if I try to join the list of curves, will it mess up the order of the list?
dale
(Dale Fugier)
November 5, 2020, 4:39pm
2
Hi @siemen ,
Obviously, we’ll need a sample file before we can answer your question.
Thanks,
– Dale
siemen
November 6, 2020, 5:58am
3
201106 Unroller.3dm (34.6 KB)
´´´
var go = new GetObject();
go.GeometryFilter = ObjectType.Surface;
go.SetCommandPrompt("Select Surface to unroll");
while (true)
{
go.Get();
if (go.CommandResult() != Result.Success)
return Result.Failure;
break;
}
Brep unroller = go.Object(0).Brep();
var gc = new GetObject();
gc.GeometryFilter = ObjectType.Curve;
gc.SetCommandPrompt("Select curve to unroll");
gc.Get();
Curve CurveToUnroll = gc.Object(0).Curve();
Unroller unroll = new Unroller(unroller);
unroll.AddFollowingGeometry(CurveToUnroll);
unroll.AbsoluteTolerance = doc.ModelAbsoluteTolerance;
Brep[] breps = unroll.PerformUnroll(out Curve[] unrolledcurves, out Point3d[] unrolledpoints, out TextDot[] unrolleddots);
foreach (var curve in unrolledcurves)
{
doc.Objects.AddCurve(curve);
}
´´´
siemen
November 9, 2020, 7:28pm
4
Any idea what the problem could be @dale ? I understand that the curve could potentially split where the curve overlaps the edge of the surface, but it seems like that’s not the case here, since I can join the 2 curves afterwards to a single curve again.
dale
(Dale Fugier)
November 9, 2020, 10:07pm
5
Hi @siemen ,
I see the UnrollSrf
command does the same. I am not sure why. But I’ll file an issue the a developer can review this behavior.
https://mcneel.myjetbrains.com/youtrack/issue/RH-61413
Thanks,
– Dale