rs.AddPipe() failure...?


I’m just trying to script something simple and I’m running into a problem with rs.AddPipe() if the two end radii are different, the pipes fail… If the two end radii are the same, it works. Am I missing something stupid here?

import rhinoscriptsyntax as rs

def TestPipe(s_rad,e_rad,blend,cap):
    crvs=rs.GetObjects("Select curves",4,preselect=True)
    for crv in crvs:
TestPipe(0.5,1.0,0,1)  #fails
#TestPipe(1.0,1.0,0,1)  #works

Thanks, --Mitch

Hi Mitch, you just need to change the second argument when calling rs.AddPipe():

rs.AddPipe(crv, [0,1], [s_rad,e_rad], blend, cap, False)

OK, thanks, so the Help is wrong then -

I am supplying the curve start and end parameters extracted with rs.CurveDomain(), which works if the radii are the same on both ends, but fails if they are different. Looks like what rs.AddPipe() wants are CurveNormalizedParameters (0 to 1), not just normal parameters within the curve domain

Guess I should have checked the RhinoCommon base method before asking, sorry…

@Alain - maybe you can add that precision to the help file… :grin:

Thanks, --Mitch

This didn’t work for me, either, btw. Here, when I have a line 2 units long, rs.CurveDomain(crv) returns [0.0, 2.0]. Then the pipe is twice as long as the curve.

Hey Mitch,
Long time no see …
The description here is better although the sample needs some work.

The rhinoscriptsyntax docstrings are being worked on right now and the docs from the link above are generated from the doc strings so you can expect some improvements soon.


1 Like

Hey Alain,

Yeah, really !! I hope you are all settled in where you are now, we are moving back in to the house in a couple of weeks, everything is pretty crazy right now…

Thanks for the response, let me know if there’s anything I can help with for the doc stuff.

Cheers, --Mitch

1 Like