Forgot password?

Create an account!


« back

RhinoScript – Plane Best Fit Through Points


Please log in to write a message.

  • 5. geef (Nov 16, 2011 13.15):

    ok found it ;-)
    thanks again for quick reply!

  • 4. geef (Nov 16, 2011 12.51):

    hi again,

    are you using rhino5?
    I have the latest SR (SR9) installed but I don't have the method Rhino.PlaneFitFromPoints available...

  • 3. geef (Nov 16, 2011 12.40):


    I don't have that in my rhinoscript helpfile.

  • 2. Johannes (Nov 16, 2011 10.39):


    here the rhinoscript help file example:

            Dim arrPoints, arrPlane, dblDX, dblDY

            arrPoints = Rhino.GetPoints(,,"Pick some points")

            If IsArray(arrPoints) Then

                    arrPlane = Rhino.PlaneFitFromPoints(arrPoints)

                    If IsArray(arrPlane) Then

                            dblDX = 20
                            dblDY = 20

                            Call Rhino.AddPlaneSurface(arrPlane, dblDX, dblDY)

                    End If

            End If


  • 1. geef (Nov 16, 2011 10.34):


    I need to do something like the PlaneFit Component in Grasshopper.
    Given any number of points I won't to get the plane with minimum square distance to through the points. I found one example but this is for RhinoPhython. Anyone know how to do that in Rhinoscript?

    def PlaneFitFromPoints(points):
      Returns a plane that was fit through an array of 3-D points.
      points = An array of 3-D points.
        The plane if successful
        None if not successful, or on error.
      points = rhutil.coerce3dpointlist(points)
      if (points == None): return scriptcontext.errorhandler()
      rc = Rhino.Geometry.Plane.FitPlaneToPoints(points)
      if (rc[0] == Rhino.Geometry.PlaneFitResult.Success):
        return rc[1]
      return None

    Thanks for your help!


Why are these buttons gray?