Forgot password?

Create an account!

Forum

« back

RhinoScript – Select adjacent surfaces

Messages

Please log in to write a message.

  • 3. sergo (May 24, 2013 00.58):

    Thanks Johannes!
    My surfaces are very different and not horizontal, but that script is a good start, I'll check if I can modify it for my needs.

  • 2. Johannes (May 23, 2013 08.31):

    Hi, you can use the following script if the surfaces you need to skip are all horizontal or have the same normal direction.

            ' surface input
            Dim arrObjects  : arrObjects = Rhino.GetObjects("Pick objects", 8)
            ' angle tolerance in degree
            Dim tolerance   : tolerance = 5
           
            Dim i, arrDomU, arrDomV, dblParam, normal, angle
           
            ' loop through srfs
            For i = 0 To Ubound(arrObjects)
                   
                    arrDomU = Rhino.SurfaceDomain(arrObjects(i), 0)
                    arrDomV = Rhino.SurfaceDomain(arrObjects(i), 1)

                    'mid point
                    dblParam = array((arrDomU(0) + arrDomU(1)) / 2, (arrDomV(0) + arrDomV(1)) / 2)
                    'normal vector
                    normal = Rhino.SurfaceNormal(arrObjects(i), dblParam)
                    ' angle between normal v and z
                    angle = Rhino.VectorAngle(array(0, 0, 1), normal)
                   
                    ' change object color of hoizontal surfaces
                    If angle < tolerance Or Abs(angle - 180) < tolerance Then
                            Call Rhino.ObjectColor(arrObjects(i), RGB(200, 0, 0))
                    End If
                   
            Next

    Johannes

    Select adjacent surfaces
  • 1. sergo (May 23, 2013 05.52):

    Hello!

    I have large models that are basically sheets of metal with some thickness. My task is to "clean" that models so that only outer surface should stay.
    What I'm doing now is Join all the surfaces to get solid polysurface, then Detach the edge of metal sheet and then easily select inner polysurface and throw it away, thus having only outer polysurface as a result.

    Sound easy but some times I spend days joining and finding/selecting edjes and so on.

    So the main question is - is there some way to automate selection of adjacent non-joined (or subsurfaces in joined polysurface) based on the angle (or the tangent) between them? In that case I would skip joining part and only select smooth outer surfaces excluding hard edges.

    Thank you for any help.

    P.S.: If you are familiar with 3ds max, there is polygon selection mode "ignore visible edges". That's basically what I would like to accomplish, but with surfaces in Rhino.

Recommend

Why are these buttons gray?