Scripting Sweep1

Hi all, I’m having trouble with both RhinoScript & Python getting a simple Sweep1 to work on a closed rail.

Image attached of geometry and the result of a normal Sweep1.

In searching the archives, I see mention in Grasshopper that the cross section curve should be placed at the start of the rail curve - I’ve tried this, but when it create geometry it doesn’t complete the mitre on the last corner.

Hoping someone can point me in the right direction. Code pasted below also, which is pretty much straight out of the RhinoScript manual. This is so simple that someone must have worked this out before!

Thanks,

Adrian

Dim strRail, arrShapes
strRail = Rhino.GetObject(“Select rail”, 4)
arrShapes = Rhino.GetObjects(“Select cross-section curve”, 4)
Rhino.AddSweep1 strRail, arrShapes, 0, , 0


did you change the startpoint of the rectangle to the middle of the segment ?
_crvSeam

what happens if you replace this line with (all optional parameters default)
Rhino.AddSweep1 strRail, arrShapes

Thanks Tom,

I’d not thought of changing the seam and equally if I create the closed rail with an extra point in the middle it also works. It does leave a seam line that can’t be removed with a ‘mergecoplanarsurfaces’, but it is better than nothing!

if you don’t want the seam in the middle of the segment:
use _shear to get a “45-Degree-Version”
_loft to get elements.
(or some other workflows with _extrudeCrv, _trim, _join)


the cyan curve done by _shear (“45-Degree-Version”)
the surface is a _loft (straight sections, closed)

Thanks Tom,
Sometimes my rail is ‘curved’ which complicates the loft option, but that is excellent advice also. I may need to compromise on something, but that gives me some ammunition to work with.
Kind regards,
Adrian