Problem creating fillet between 2 curves by calling _Fillet command

Hello,

I’m trying to create a fillet between two curves on Rhino 5 SR14. It works like magic when I use the button and select the two curves but I cannot make it work from a Python script calling the _Fillet command. Attached, you will find the project containing the two curves and the script I’m using…

FiletTestProject.3dm (25.9 KB)

FiletCmdTest.py (834 Bytes)

Thanks for your help!

Bruno

Hi @bmartin,

Your script doesn’t specify the fillet radius. Could this be the issue?

– Dale

Hello Dale,

Isn’t it supposed to use the default value, in this case Radius=1, which works for the GUI version? Just to fix ideas, the two endpoints are 0.895mm apart.

Any way, I changed the command string for the following:

cmd="_-Fillet " + " Selid " + str(curve1) + " Selid " + str(curve2) + " Radius=0.1 _EnterEnd "

and used different radius (2.0, 1.0, 0.5, 0.1) and always got the same error message:

Unable to fillet the curves. The fillet radius may be too big or the curves may not be on the same plane near the fillet.

Note that my two curves are all in the Z=0 plane so that can’t be the source of the problem (and filleting from the GUI works just fine). Any other ideas?

Bruno

Original curves:
OriginalCurves

Fillet result from GUI:
FilletCurveFromGUI

@Helvetosaur @dale Any idea how to rewrite this command so I get the same result as by the GUI button? Is this a bug? Do you know any workaround?

FilletCurveGUIButton

I suspect that since the on-screen version wants you to click on the the curves near the ends to be filleted, that information is missing in the command string. I’m not sure in this case how the command string could be made to work, so I would use rs.AddFilletCurve() instead of trying to script _Fillet.

I did another test with the GUI button by clicking on the middle of each curve and it still produces the same nice fillet. I guess the script just tries to fillet between the closest two extremities of the two curves…

The interest in scripting _Fillet instead of using rs.AddFilletCurve() lies in the facts that the _Fillet does not just create the filler arc but also:

  1. Finds itself the right curve extremities to fillet
  2. Split each curve at the right place,
  3. Remove the excess length (trims),
  4. Joins the 3 curves (2 original curves trimmed + the actual fillet) into one.

That’s all this not so trilling boilerplate code I was hoping NOT to code, debug, test and support…

FilletCurveFromAddFilletCurve

Hello - here this works if you flip the blue curve.

image

Hm - I take it all back - it does not work… it works with a large radius, 10, that happened to be set when I first tried but not at more expected radii.

-Pascal

Hi @bmartin,

If you want to fillet curves from within a script, you should probably just call RhinoCommon’s Curve.CreateFilletCurves method.

– Dale