Forgot password?

Create an account!

Forum

« back

RhinoScript – comparing surfaces from several arrays

Messages

Please log in to write a message.

  • 2. raf2205 (Sep 25, 2009 23.19):

    hi, I would suggest something like that...

    Option Explicit

    Call Main()
    Sub Main()
           
            Dim arrobjects,arrSurfaces
            arrObjects=rhino.getobjects("select polysurfaces",16)
            arrSurfaces=rhino.ExplodePolysurfaces(arrObjects)
           
            Dim i,arrPoint,arrParam,arrNormal
            For i=0 To Ubound(arrSurfaces)
                    arrPoint = Rhino.SurfaceAreaCentroid(arrSurfaces(i))(0)
                    arrParam = Rhino.SurfaceClosestPoint(arrSurfaces(i), arrPoint)         
                    arrNormal = Rhino.SurfaceNormal(arrSurfaces(i), arrParam)
                    Call Rhino.Print (Rhino.Pt2Str(arrNormal))                     
                    Call rhino.ObjectColor(arrSurfaces(i),RGB(abs(arrNormal(0)*255),abs(arrNormal(1)*255),abs(arrNormal(2)*255)))

            Next
           
    End Sub

  • 1. moodo (Sep 25, 2009 01.09):

    Hey
    I thought I solved the problem but that was not the case.
    I have several >10 arrays, the are containing cells, in these arrays I eploded the cells into single surfaces, and I did this also in the other arrays. Now I want to know if there are surfaces with the same surfacenormal in the arrays.
    And if the surfacenormasl are the same (anit-parallel) then add a line. Why do I use several arrays; the surfaces in an array only need to compare with other arrays not comparing surfaces in this array (each cell has an own array), so surfaces from cell1 must be compared with cell2..celln. Does someone has a suggestion how to fix it.
    Maybe I can collect all surfacenormals in an array and than exclude some surfaces? I'm stuck....I don't know how to write this in the script.

    If someone can help me.....thanks.

    gr.
    md

Recommend

Why are these buttons gray?