Filleting Tangent Surfaces

This has been requested several times in this thread. You can read what I responded before.
As I see it, the main problem with the FilletSrf command is that it takes a lot of the user’s time to make the fillets because the user has to tell Rhino where to put each and every fillet. This is completely unnecessary when filleting tangent surfaces because once the user has made one fillet all the others are completely defined. The script can make 50 tangent fillets in under a second. The purpose of the script is to automate the most time consuming parts of using filletsrf. The script is just telling Rhino where to make the fillets so that the user doesn’t have to.

The size of the fillet radius is not what causes a fillet to end in a singularity. The fillet is a constant radius all the way right up to the singularity.
What causes the fillet to come to a point is that both surfaces on either side of the fillet become tangent (at the singularity point).
The real problem is not the singularity itself, but that Rhino (more often than not) botches the construction of the fillet at a singularity. This is a bug that McNeel should fix.

5 Likes

Ah, apologies. I thought I’d read everything. Thx for the quick reply, and again for the script!

1 Like

There is no reason to apologize this thread is very long and your request is very reasonable. I have given it some thought and it may even happen some day if I find the time and work out the logistics of making it very reliable and easy to use.

I have written code that does do the trimming and joining, but its not 100% reliable.

If you set things up correctly and use macros, the manually trimming and joining part takes very little time. An automated process that saves only a little time when it works and wastes a lot of time when it fails is not worth using. Rhino already has more than its share of automation that works like that.

I almost always use the versions of the script that I posted to this thread.
I mostly use this one: FilsrfEX.py (40.1 KB)

If you are using the second one I posted that makes the curves for trimming with, I would put this macro in front of the RunPythonScript command:

! selnone
-selname “check” pause delete
-selname “trimcrv*” pause delete

That will delete the curves from the previous fillet string as well as gap marks.

4 Likes

Ah, appreciate that, thx :blush:

Ikr, I’m still waiting for him to make an Eto Framewrork. Also waiting for @theoutside , I think, to make one for the ‘pipe trim trick’ too :smiley: :slightly_smiling_face:

You’d think the devs would have done this already so you wouldn’t of had to :joy:

I agree. :beers:

Waiting for the ‘buy now’ button for the super awesome fillet tool :money_mouth_face: :slightly_smiling_face:

Yeah, and in V8 now some simple things that used to be stable are now kinda buggy, like the hover tips, and the grid graphic overlay…

you’ll be waiting awhile if you are hoping I’ll do it…I’m an artist, not a programmer… we’d need to enlist some folks who can do math for stuff like that. :wink:

2 Likes

Ok folks, I have finally made an attempt at putting together a script that does the trimming and joining in addition to placing the fillets.

Here is the python script: Filsrf_Join.py (69.1 KB)

The basic premise of this script is that it can be used to connect two polysurfaces with a string of fillet surfaces as a bridge between them. Think of the fillets as a wide intersection between the two polysurfs that is used to trim and join them. The script may extend the string on the ends when that seems to be needed. The extend option is on by default but the user can turn it off.

The script works the same as Rhino’s FilletSrf and the original script (FilsrfEX.py) but this one is limited in what it will accept as inputs. It will not accept two input surfaces from the same polysurface. This version of the script will only make fillets for surfaces that are joined to the two picked input surfaces.

Future versions may not be limited to just working with two polysurfs, but it is simpler to debug and do all the bookkeeping for trimming and joining if the two sides of the Fillet string belong to two separate polysurfaces.

A good example of geometry that works well with this script is the file I posted at the Top of this thread: fillsrf_examples.3dm

In that file a 1mm fillet works on all the examples. OTOH, a 3mm fillet will fail on almost all of those examples. In other words, the script doesn’t work properly when the base surfaces have curvature that is smaller than the fillet radius being applied.

Here is another example:
doodle.3dm (2.9 MB)

This file demonstrates how you can take 7 open polysurfaces and connect them by connecting everything with fillets into one solid. the output polysurface of the script inherits the properties of the first polysurface picked (i.e. it works just like the Join command)

There is no option for trimming and joining. If you don’t want the result joined - just Undo the result one step. If you don’t want the base surfaces trimmed Undo another step and you will have just the fillets and the original surfaces.

The script creates a Layer called “BaqUpz”. The original 2 polysurfaces are saved to that layer before trimming. Be aware that things may pile up in that layer. You can delete that layer anytime you want, but it will be created again when the script is run again. Treat the BaqUpz layer like a Recycle Bin.

I would like users to post geometry that they think should trim and join but does not do it correctly.

15 Likes

Thanks for making it happen, @jim
I’m more than happy to share any failing geo.
And I like the idea of the archival folder.
Excited to try it out.

1 Like

I should add a disclaimer: There are some types of topology that are pretty much guaranteed to cause failure.

As the title of this thread states this is for filleting tangent surfaces. So poor tangent continuity between surfaces that the fillet chain crosses will cause failure.

Also, the script does not create the fillets. It just tells Rhino which pairs of surfaces to use to make the fillets. Rhino usually does an excellent job of making the fillets but if Rhino botches the fillet the trimming and joining will also fail. One example of fillets that Rhino often fails to make correctly are fillets that end in a point (singularity)

Another obvious failure is when the fillet chain tries to cross another fillet of a smaller radius. This one has a known solution, but that involves making a fillet that comes to a point at the end. Hopefully someday Rhino will get better at making fillets that come to a point so that case can be handled.

6 Likes

Hello Jim,
This is a great module you’ve created.
I modified the “print” of your first file, because I had errors with the last version of Rhino and made an icon in SVG.
Filsrf - Copie
filsrfex-printOK.py (39.6 KB)

6 Likes

Feel free to modify or add to the script

What errors were you seeing?
I have the most recent service releace candidate for Rhino8 and have not seen any errors related to the print statements.

1 Like

If running in Python 3, print statements need to be enclosed in parentheses.

Instead of
print "bla bla"

Use
print("bla bla")

This also works retroactively in Python 2 scripts.

Running the script with RunPythonScript should however work as by default it runs Python 2.

2 Likes

I am aware of that, but the script that Siem posted doesn’t seem to run at all in the Rhino8 new Script Editor so I’m puzzled what is the reason for changing the print statements.

1 Like

If your reason for doing that was to get the script to run on the new Rhino8 script editor, I modified your version of the script so that will run.
filsrfex-printOKx.py (39.6 KB)

The new script editor doesn’t recognize some of the System and RhinoCommon calls that work fine in the old script editor.
Also running this script with the new script editor is significantly slower than running it with the old editor. The slow down makes running it unusable for long fillet strings.

3 Likes

Perfect!
To make it work on my machine, I’d made a regex that only took double quotes and not variables.

1 Like

:melting_face:

1 Like

You are misquoting me. What I actually wrote was:

What I have been saying for many years is that the constant radius fillets that Rhino’s FilletSrf command makes are as good or better than any other CAD application in the world. Fillets that end in a point (a singularity) are the rare exception where Rhino often fails to achieve its usual high level of quality.

1 Like

Is it possible to make a Plugin from the script?
Then the Python 2/3 thing shouldn’t interfere.

1 Like

I want to live in your world… unfortunately, I live in reality (thus I still think the part I quoted is accurate). :wink:

1 Like

I really don’t know what might be gained or lost by doing that.
For my purposes it works fine as a python2 script, but as was demonstrated by Siem’s version of the original script it can easily be modified to run as either.

1 Like