Forgot password?

Create an account!

Forum

« back

RhinoScript – quicker way to calculate area between curves, multiple layers?

Messages

Please log in to write a message.

  • 3. 2mraid3r (Oct 18, 2013 22.34):

    I can't seem to get it working, it doesn't seem to come up with some error, it just isn't processing. I opened RhinoScript Editor using EditScript and copy/pasted the script you posted under Sub Main(). Did I mess up somewhere?

  • 2. pulgarata (Oct 18, 2013 19.58):

    Hi, try this

           Dim Names,xName,Objetos,xObjeto,Superficie,Centro,Area,X
            Dim Puntos:ReDim Puntos(0)
            Dim Curvas:ReDim Curvas(0)
            Names = Rhino.LayerNames
            Dim n
            Dim m:m=0
            For Each xName In Names
                    n=0
                    Objetos=Rhino.ObjectsByLayer(xName,False)
                    If Not isnull(Objetos) Then
                            For Each xObjeto In Objetos
                                    If Rhino.IsPoint (xObjeto) Then
                                            ReDim Preserve Puntos(n)
                                            Puntos(n)=Rhino.PointCoordinates(xObjeto)
                                            n=n+1
                                    End If
                            Next
                            If ubound(Puntos)>0 Then
                                    ReDim Preserve Curvas(m)
                                    Curvas(m)=Rhino.AddInterpCurve (Puntos,3,2)
                                    m=m+1
                            End If
                    End If
            Next
           
           
            For X=0 To ubound(Curvas)-1
                    Superficie=Rhino.AddLoftSrf (Array(Curvas(X),Curvas(X+1)),,,2,1,1000)
                    Area=Rhino.SurfaceArea(Superficie(0))
                    Centro=Rhino.SurfaceAreaCentroid (Superficie(0))
                    Rhino.AddTextDot Area(0),Centro(0)
            Next
  • 1. 2mraid3r (Oct 18, 2013 18.31):

    Hi,
    I have several different layers each containing a set of XYZ points that I want to analyze. Here is sort of what I want to do:

    1) interpolate each curve (3rd degree sqrt chord)
    2) set up a plane to intersect all of the curves at x=0, x=1, x=-1, x=-3
    3) find some way to loft the curves (straight section rebuild with 1000 control points) with each intersecting plane
    4) calculate the areas of each loft?

    Any help you can give me will be greatly appreciated, I'm not fantastic with grasshopper or RhinoScript (even though I've been trying to learn this RhinoScript101...). Even if you can't figure out a way to complete all of the steps, anything will help speed my process up!

Recommend

Why are these buttons gray?