Rhino7SR14 Sweep2Rails methods not working in C# !?

Hello,

I have encountered this problem after upgrading my plugin to SR14.
one command that uses SweepTwoRails() class stopped working

On SR13 the same code worked without problems

I tried workarounds with using Sweep method in brep class but it fails also.
( Brep.CreateFromSweep )

Every time it returns an empty array Rhino.Geometry.Brep[]

Am I missing something here?

here is the piece of code:

                var finalProfile = new SweepTwoRail();
                finalProfile.SweepTolerance = 0.1;
                finalProfile.MaintainHeight = true;

                //var res1 = finalProfile.PerformSweep(path, path2, Profiles);
                //var res1 = finalProfile.PerformSweepRefit(path, path2, Profiles, 0.1);
                var res1 = Brep.CreateFromSweep(path, path2, Profiles, true, 0.1);

                if (res1 == null || res1.Length==0)
                {
                    RhinoApp.WriteLine("Could not create Sweep. Check your profile");
                    doc.Views.EnableRedraw(true, true, true);
                    doc.Objects.AddCurve(Profiles[0]);
                    doc.Objects.AddCurve(Profiles[1]);
                    doc.Objects.AddCurve(path);
                    doc.Objects.AddCurve(path2);

                    return Result.Failure;
                }

( note that I commented out different methods while searching for the solution, the first one was the one I originally used)

I get res1.Length==0 true every time, no matter what I tried

I tried the latest release candidate SR15 and it is not working too…

Thanks in advance

BR
Aleksandar

Hi @AleksandarSM,

Can you provide a full working sample that we can run here? Please include the geometry too.

Thanks,

– Dale

Hi Dale,

I sent you the sample by sendspace. You should also get an email with more info about the issue.

BR
Aleksandar

Hi Dale,

The solution you proposed to me works!

here it is:

var finalProfile = new SweepTwoRail();
finalProfile.SweepTolerance = 0.1;
finalProfile.MaintainHeight = true;
finalProfile.ClosedSweep = false; // NEW
Brep[] res1 = finalProfile.PerformSweep(path, path2, Profiles);

BR
Aleksandar