A Question About Brep.CreateFilletEdges Method

I am trying to use this method to fillet only the edges that are close to a certain point. I get this error:

Runtime error (ArgumentTypeException): expected IEnumerable[int], got list

Please see the .gh file…

CreateFilletEdges.gh (15.9 KB)

What am I doing wrong?

Here’s the code for reference:

import rhinoscriptsyntax as rs
import Rhino as rh
import System as sys

index_list = []

for i in range(len(edges)):
    midPt = rs.CurveMidPoint(edges[i])
    
    surfaceCPuv = rs.SurfaceClosestPoint(top_surface, midPt)
    surfaceCP = rs.SurfaceEvaluate(top_surface, surfaceCPuv, 1)[0]
    
    dist = rh.Geometry.Point3d.DistanceTo(midPt, surfaceCP)
    
    if abs(dist) <= rs.UnitAbsoluteTolerance() * 3:
        index_list.append(i)

indexes = index_list
print indexes
#indexes = sys.Collections.Generic.IEnumerable(indexes)

blendType = rh.Geometry.BlendType.Fillet
railType = rh.Geometry.RailType.RollingBall
tolerance = rh.FileIO.File3dmSettings.ModelAbsoluteTolerance

final_prong = rh.Geometry.Brep.CreateFilletEdges(prong, indexes, radius, radius, blendType, railType, tolerance)

You need to use the indices of the edges

Hello Seghier,

I could make it work with GH components ,that’s no problem, but I want to understand why I get this error in Python.

In the code the indexes variable holds a list of integers that has the same values in your example. Basically they are both the same thing but python somehow doesn’t accept it for some reason. Why?

Count of radius and count edges must equal, and sometimes you need to decrease tolerance.

CreateFilletEdges__.gh (18.4 KB)

1 Like

Thank you for the response… It works now. Can I ask one more thing though? How did you understand that the number of the radiuses must equal to the number of edges?

From the initial error message?

Runtime error (ArgumentTypeException): expected IEnumerable[int], got list

I also realized that ModelAbsoluteTolerance setting should be taken from Rhino.RhinoDoc.ActiveDoc instead of FiloIO namespace. Thanks for correcting that too.

What’s the advantage of doing this in python versus using the native Grasshopper component Fillet Edge?

I had problems in some lower radii with the GH component and wondered if Rhinocommon would work or not. But it didn’t work either. It still can’t create the fillets on that particular radii.

It’s not the scope of this thread but same applies to curveonsrf as well. A very simple offset doesn’t work in GH, though with native rhino command it works.

I just recreated your base geometry with a square at the bottom end and a 3 point circle at the top.

This one can be filleted with a radius in between 0.031 and 0.497

Lower than that, my guess… the problem has to do with the sharp edge coming from the corner of the square but to be honest can’t explain what exactly happens.

CreateFilletEdges__.gh (27.1 KB)

1 Like

I already tested it and created a ghpy component.
You need sometimes to test different cases to find where is the error

1 Like

Well, I tried the same geometry with the native rhino fillet edges command and it can’t make it either. That eases the pain a bit.

I can’t understand why Rhino has more problems with fillets and chamfers compared to other softwares.