Grasshopper

algorithmic modeling for Rhino

I'm wondering if we can use FilletSurfaces command.

I tried to use the code shown in the help.

import rhinoscriptsyntax as rs

surface0 = rs.GetObject("First surface", rs.filter.surface)

surface1 = rs.GetObject("Second surface", rs.filter.surface)

rs.FilletSurfaces(surface0, surface1, 2.0)

I selected two surfaces but it returned a message like this.

"Could not convert None to a Point2d"

What is the problem here?

Also I cannot get why this command cannot be found in keywords list although it can be searched in the help.

Views: 610

Replies to This Discussion

Yes, looks like a bug.


Open your "surface.py" in Rhino Python Editor. You can find it in:

Win XP:    C:\Documents and Settings\Administrator\Application Data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (...)\settings\lib\rhinoscript

Vista/Win 7:    C:\Users\Administrator\AppData\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (...)\settings\lib\rhinoscript    (hope I did not make mistake with the Vista/Win7 folders)

Replace the lines 938 and 939, with this:

    if uvparam0 and uvparam1 != None:    # indented four spaces
       uvparam0 = rhutil.coerce2dpoint(uvparam0, True)    # indented eight spaces
       uvparam1 = rhutil.coerce2dpoint(uvparam1, True)    # indented eight spaces

Or just overwrite it (the surface.py) with the attached file.

Be aware that rs.FilletSurfaces() function does not split the initial surfaces the way Rhino command does. You need to do that manually:

import rhinoscriptsyntax as rs

surface0 = rs.GetObject("First surface", rs.filter.surface)
surface1 = rs.GetObject("Second surface", rs.filter.surface)

filletSrf = rs.FilletSurfaces(surface0, surface1, 2.0)

# split and delete the initial surfaces
intersectSrf0 = rs.SplitBrep(surface0, filletSrf)
intersectSrf1 = rs.SplitBrep(surface1, filletSrf)
rs.DeleteObjects([surface0, surface1])

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service