Forgot password?

Create an account!

Forum

« back

RhinoScript – Orienting AddCutPlane

Messages

Please log in to write a message.

  • 2. Johannes (Apr 26, 2010 13.49):

    i can't figure out what goes wrong... but take a look on the following code. it works fine with your definition of arrNormal.
    the result is the identifier of the cutting plane.

            Dim arrObjects, arrPt0, arrPt1
            Dim arrNormal
           
            arrObjects      = Rhino.getobjects("Select objects for cut plane")
            arrPt0          = Rhino.GetPoint("Start of cut plane")
            arrPt1          = Rhino.GetPoint("End of cut plane", arrPt0)

            arrNormal = Rhino.VectorCreate(Array(0,0,0), Array(5,5,1))
           
            Call Rhino.AddCutPlane (arrObjects, arrPt0, arrPt1, arrNormal)
    Orienting AddCutPlane
  • 1. mrgordon (Apr 26, 2010 13.02):

    I have a set of rectangular prisms and I want to split each one in half by bisecting its longest dimension. My plan was to generate a cutplane for each prism and I have already calculated a StartPoint and an EndPoint along the middle of each object where I want to cut.

    I have been struggling for days with the Rhino.AddCutPlane method because I have been unable to generate arrNormal (the optional fourth argument) correctly. If I call AddCutPlane on each of the prisms with a correct StartPoint and EndPoint, I get different orientations for the cutplanes that are generated even if I use the same value for arrNormal. Could this have something to do with CPlane vs. WorldPlane, a bug in my code, or something else altogether? Any insight on how I can solve this (with or without AddCutPlane) would be much appreciated. I'm ready to give up on using AddCutPlane but I can get it to properly orient the cutplanes about 75% of the time, so it's really frustrating.

    I've tried generating normals using both of the following formats:

    arrNormal = Rhino.VectorCreate(Array(0,0,0), Array(0,0,1)
    arrNormal = Rhino.SurfaceNormal(strSmallestSurface, Rhino.SurfaceClosestPoint(strSmallestSurface, ptOnSmallestSrf))

    MyPlane = Rhino.AddCutPlane(Array(strObject), ptStart, ptEnd, arrNormal)