# SweepOneRail on Closed Curve

**URL:** <https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570>\
**Category:** Rhino Developer\
**Created:** [December 14, 2017, 1:11pm UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570 "2017-12-14T13:11:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![carpetheaddev](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/carpetheaddev/32/75420_2.png) [@carpetheaddev](https://discourse.mcneel.com/u/carpetheaddev)\
**Post date:** [December 14, 2017, 1:11pm UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570/1 "2017-12-14T13:11:51Z")

</div>

I have been writing a RhinoCommon (c#) plugin to convert the native file format of Gravity Sketch into native Rhino Geometry.

Due to the limited nature of available features in OpenNURBS, we are working on a Rhino Import plugin, rather than a .3dm export plugin.

The issue we have come across is that we are trying to perform a SweepOneRail where you specify multiple profiles along the curve to match our geometry creation. This works perfectly for any NURBSCurve we throw at it, and any set of profiles.

However, as soon as you close the curve, SweepOneRail.PerformSweep silently returns null breps, regardless of any other parameters.

Is there a reason for this? or some way to get more detailed information as to why it is failing?

Thanks!

Daniel

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [December 14, 2017, 3:04pm UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570/2 "2017-12-14T15:04:26Z")

</div>

Have you tried setting `SweepOneRail.ClosedSweep = true`?

Alternatively, have you tried the `Brep.CreateFromSweep` function?

[http://developer.rhino3d.com/5/api/RhinoCommonWin/html/M\_Rhino\_Geometry\_Brep\_CreateFromSweep\_3.htm](http://developer.rhino3d.com/5/api/RhinoCommonWin/html/M_Rhino_Geometry_Brep_CreateFromSweep_3.htm)

---

<div class="post-metadata">

**Author:** ![carpetheaddev](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/carpetheaddev/32/75420_2.png) [@carpetheaddev](https://discourse.mcneel.com/u/carpetheaddev)\
**Post date:** [December 14, 2017, 4:07pm UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570/3 "2017-12-14T16:07:04Z")

</div>

Yep, SweepOneRail.ClosedSweep has no effect.

Brep.CreateFromSweep does not allow you to provide profiles along the entire length of the Sweep

We are using this method:

[http://developer.rhino3d.com/api/RhinoCommon/html/M\_Rhino\_Geometry\_SweepOneRail\_PerformSweep\_3.htm](http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_SweepOneRail_PerformSweep_3.htm)

However even using a much simpler method to test

[http://developer.rhino3d.com/api/RhinoCommon/html/M\_Rhino\_Geometry\_SweepOneRail\_PerformSweep.htm](http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_SweepOneRail_PerformSweep.htm)

Does not seem to work either.

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [December 14, 2017, 4:59pm UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570/4 "2017-12-14T16:59:54Z")

</div>

Huh, strange. Is it possible that you post an example of your code and of the geometry that you’re trying to sweep so we can have a go at trying this too?

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [December 14, 2017, 5:19pm UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570/5 "2017-12-14T17:19:40Z")

</div>

Not that it probably matters in this case, but note that you’re referencing Rhino 6 docs. [http://developer.rhino3d.com/5/api/RhinoCommon/html/M\_Rhino\_Geometry\_SweepOneRail\_PerformSweep\_3.htm](http://developer.rhino3d.com/5/api/RhinoCommon/html/M_Rhino_Geometry_SweepOneRail_PerformSweep_3.htm) is the Rhino 5 docs. (notice the /5/ in front of the api in the URL)…

---

<div class="post-metadata">

**Author:** ![Federico\_Giacomarra](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/federico_giacomarra/32/632251_2.png) [@Federico\_Giacomarra](https://discourse.mcneel.com/u/Federico_Giacomarra)\
**Post date:** [June 27, 2019, 8:04am UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570/6 "2019-06-27T08:04:07Z")

</div>

Hi,  
I am having a similar problem to Carpetheaddev, I am not sure if was in the end sorted out. I post my gh python in case anybody wants to have a look.  
basically when the ClosedSweep option is on True it doesn´t produce any result.

[sweep test.gh](https://discourse.mcneel.com/uploads/short-url/t3QTRgOAaBOXJqYsoFnhV8KTLZ.gh) (5.1 KB)

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [June 29, 2019, 12:08am UTC](https://discourse.mcneel.com/t/sweeponerail-on-closed-curve/51570/7 "2019-06-29T00:08:05Z")

</div>

Hi @Federico_Giacomarra,

Let me know if the attached helps.

[sweep\_test\_fixed.gh](https://discourse.mcneel.com/uploads/short-url/v3rNAfcaz5vDnA5iItuhbcA6NHK.gh) (14.0 KB)

– Dale
