Exemple #1
0
        public Curve[] Explode()
        {
            IntPtr const_ptr_parent        = IntPtr.Zero;
            IntPtr const_ptr_this          = IntPtr.Zero;
            IntPtr const_ptr_this_dimstyle = IntPtr.Zero;

            TextObject parent = _GetConstObjectParent() as TextObject;

            if (null != parent)
            {
                const_ptr_parent = parent.ConstPointer();
            }
            else
            {
                const_ptr_this = ConstPointer();
                //const_ptr_this_dimstyle = ConstPointerForDimStyle();
            }

            var dimstyle = DimensionStyle;

            if (null == parent)
            {
                const_ptr_this_dimstyle = dimstyle.ConstPointer();
            }

            Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
            IntPtr ptr_curves = curves.NonConstPointer();

            UnsafeNativeMethods.RHC_RhinoGetTextOutlines(const_ptr_parent, const_ptr_this, const_ptr_this_dimstyle, ptr_curves);

            GC.KeepAlive(dimstyle); // GC_KeepAlive: Nov. 1, 2018
            GC.KeepAlive(parent);   // GC_KeepAlive: Nov. 1, 2018

            return(curves.ToNonConstArray());
        }
        /// <summary>
        /// Constructs an array of <see cref="Hatch">hatches</see> from a set of curves.
        /// </summary>
        /// <param name="curves">An array, a list or any enumerable set of <see cref="Curve"/>.</param>
        /// <param name="hatchPatternIndex">The index of the hatch pattern in the document hatch pattern table.</param>
        /// <param name="rotationRadians">The relative rotation of the pattern.</param>
        /// <param name="scale">A scaling factor.</param>
        /// <param name="tolerance"></param>
        /// <returns>An array of hatches. The array might be empty on error.</returns>
        /// <exception cref="ArgumentNullException">If curves is null.</exception>
        /// <since>6.0</since>
        public static Hatch[] Create(IEnumerable <Curve> curves, int hatchPatternIndex, double rotationRadians, double scale, double tolerance)
        {
            if (curves == null)
            {
                throw new ArgumentNullException("curves");
            }

            var    curvearray      = new Runtime.InteropWrappers.SimpleArrayCurvePointer(curves);
            IntPtr ptr_curve_array = curvearray.NonConstPointer();
            var    hatcharray      = new Runtime.InteropWrappers.SimpleArrayGeometryPointer();
            IntPtr ptr_hatch_array = hatcharray.NonConstPointer();

            UnsafeNativeMethods.RHC_RhinoCreateHatches(ptr_curve_array, tolerance, hatchPatternIndex, rotationRadians, scale, ptr_hatch_array);
            GeometryBase[] g = hatcharray.ToNonConstArray();
            if (g == null)
            {
                return(new Hatch[0]);
            }
            List <Hatch> hatches = new List <Hatch>();

            for (int i = 0; i < g.Length; i++)
            {
                Hatch hatch = g[i] as Hatch;
                if (hatch != null)
                {
                    hatches.Add(hatch);
                }
            }
            GC.KeepAlive(curves);
            return(hatches.ToArray());
        }
Exemple #3
0
        /// <summary>
        /// Explodes this text entity into an array of curves.
        /// </summary>
        /// <returns>An array of curves that forms the outline or content of this text entity.</returns>
        public Curve[] Explode()
        {
            IntPtr pConstThis = ConstPointer();

            Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
            IntPtr pCurves = curves.NonConstPointer();

            UnsafeNativeMethods.ON_TextEntity_Explode(pConstThis, pCurves);
            return(curves.ToNonConstArray());
        }
 /// <summary>
 /// Gets 3d curves that define the boundaries of the hatch
 /// </summary>
 /// <param name="outer">true to get the outer curves, false to get the inner curves</param>
 /// <returns></returns>
 public Curve[] Get3dCurves(bool outer)
 {
     using (Rhino.Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer())
     {
         IntPtr pCurveArray = curves.NonConstPointer();
         IntPtr pConstThis  = ConstPointer();
         UnsafeNativeMethods.ON_Hatch_LoopCurve3d(pConstThis, pCurveArray, outer);
         return(curves.ToNonConstArray());
     }
 }
        //skipping
        //  const ON_PolyCurve* PolyProfile() const;
        //  int GetProfileCurves( ON_SimpleArray<const ON_Curve*>& profile_curves ) const;

#if RHINO_SDK
        /// <summary>
        /// Constructs all the Wireframe curves for this Extrusion.
        /// </summary>
        /// <returns>An array of Wireframe curves.</returns>
        public Curve[] GetWireframe()
        {
            IntPtr ptr_const_this = ConstPointer();

            using (var output = new Runtime.InteropWrappers.SimpleArrayCurvePointer())
            {
                IntPtr ptr_curve_array = output.NonConstPointer();
                UnsafeNativeMethods.CRhinoExtrusionObject_GetWireFrame(ptr_const_this, ptr_curve_array);
                return(output.ToNonConstArray());
            }
        }
        /// <summary>
        /// Generate geometry that would be used to draw the hatch with a given hatch pattern
        /// </summary>
        /// <param name="pattern"></param>
        /// <param name="patternScale"></param>
        /// <param name="bounds"></param>
        /// <param name="lines"></param>
        /// <param name="solidBrep"></param>
        public void CreateDisplayGeometry(DocObjects.HatchPattern pattern, double patternScale, out Curve[] bounds, out Line[] lines, out Brep solidBrep)
        {
            IntPtr const_ptr_this    = ConstPointer();
            IntPtr const_ptr_pattern = pattern.ConstPointer();

            using (var curve_array = new Runtime.InteropWrappers.SimpleArrayCurvePointer())
                using (var line_array = new Runtime.InteropWrappers.SimpleArrayLine())
                {
                    IntPtr ptr_curves = curve_array.NonConstPointer();
                    IntPtr ptr_lines  = line_array.NonConstPointer();
                    IntPtr ptr_brep   = UnsafeNativeMethods.CRhinoHatchPattern_CreateDisplay(const_ptr_this, const_ptr_pattern, patternScale, ptr_curves, ptr_lines);
                    solidBrep = (ptr_brep == IntPtr.Zero) ? null : new Brep(ptr_brep, null);
                    bounds    = curve_array.ToNonConstArray();
                    lines     = line_array.ToArray();
                }
        }
Exemple #7
0
        /// <summary>
        /// Builds a surface from an autosorted network of curves/edges.
        /// </summary>
        /// <param name="curves">An array, a list or any enumerable set of curves/edges, sorted automatically into U and V curves.</param>
        /// <param name="continuity">continuity along edges, 0 = loose, 1 = pos, 2 = tan, 3 = curvature.</param>
        /// <param name="edgeTolerance">tolerance to use along network surface edge.</param>
        /// <param name="interiorTolerance">tolerance to use for the interior curves.</param>
        /// <param name="angleTolerance">angle tolerance to use.</param>
        /// <param name="error">
        /// If the NurbsSurface could not be created, the error value describes where
        /// the failure occured.  0 = success,  1 = curve sorter failed, 2 = network initializing failed,
        /// 3 = failed to build surface, 4 = network surface is not valid.
        /// </param>
        /// <returns>A NurbsSurface or null on failure.</returns>
        public static NurbsSurface CreateNetworkSurface(IEnumerable <Curve> curves, int continuity,
                                                        double edgeTolerance, double interiorTolerance, double angleTolerance,
                                                        out int error)
        {
            Rhino.Runtime.InteropWrappers.SimpleArrayCurvePointer _curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer(curves);
            IntPtr pCurves = _curves.NonConstPointer();

            error = 0;
            IntPtr pNS = UnsafeNativeMethods.RHC_RhinoNetworkSurface2(pCurves, continuity, edgeTolerance, interiorTolerance, angleTolerance, ref error);

            _curves.Dispose();
            if (pNS != IntPtr.Zero)
            {
                return(new NurbsSurface(pNS, null));
            }
            return(null);
        }
Exemple #8
0
        /// <summary>
        /// Builds a surface from an ordered network of curves/edges.
        /// </summary>
        /// <param name="uCurves">An array, a list or any enumerable set of U curves.</param>
        /// <param name="uContinuityStart">
        /// continuity at first U segment, 0 = loose, 1 = pos, 2 = tan, 3 = curvature.
        /// </param>
        /// <param name="uContinuityEnd">
        /// continuity at last U segment, 0 = loose, 1 = pos, 2 = tan, 3 = curvature.
        /// </param>
        /// <param name="vCurves">An array, a list or any enumerable set of V curves.</param>
        /// <param name="vContinuityStart">
        /// continuity at first V segment, 0 = loose, 1 = pos, 2 = tan, 3 = curvature.
        /// </param>
        /// <param name="vContinuityEnd">
        /// continuity at last V segment, 0 = loose, 1 = pos, 2 = tan, 3 = curvature.
        /// </param>
        /// <param name="edgeTolerance">tolerance to use along network surface edge.</param>
        /// <param name="interiorTolerance">tolerance to use for the interior curves.</param>
        /// <param name="angleTolerance">angle tolerance to use.</param>
        /// <param name="error">
        /// If the NurbsSurface could not be created, the error value describes where
        /// the failure occured.  0 = success,  1 = curve sorter failed, 2 = network initializing failed,
        /// 3 = failed to build surface, 4 = network surface is not valid.
        /// </param>
        /// <returns>A NurbsSurface or null on failure.</returns>
        public static NurbsSurface CreateNetworkSurface(IEnumerable <Curve> uCurves, int uContinuityStart, int uContinuityEnd,
                                                        IEnumerable <Curve> vCurves, int vContinuityStart, int vContinuityEnd,
                                                        double edgeTolerance, double interiorTolerance, double angleTolerance,
                                                        out int error)
        {
            Rhino.Runtime.InteropWrappers.SimpleArrayCurvePointer _uCurves = new Runtime.InteropWrappers.SimpleArrayCurvePointer(uCurves);
            Rhino.Runtime.InteropWrappers.SimpleArrayCurvePointer _vCurves = new Runtime.InteropWrappers.SimpleArrayCurvePointer(vCurves);
            IntPtr pUCurves = _uCurves.NonConstPointer();
            IntPtr pVCurves = _vCurves.NonConstPointer();

            error = 0;
            IntPtr pNS = UnsafeNativeMethods.RHC_RhinoNetworkSurface(pUCurves, uContinuityStart, uContinuityEnd, pVCurves, vContinuityStart, vContinuityEnd, edgeTolerance, interiorTolerance, angleTolerance, ref error);

            _uCurves.Dispose();
            _vCurves.Dispose();
            if (pNS != IntPtr.Zero)
            {
                return(new NurbsSurface(pNS, null));
            }
            return(null);
        }
Exemple #9
0
        public Curve[] CreateCurves(DimensionStyle dimstyle, bool bAllowOpen, double smallCapsScale = 1.0, double spacing = 0.0)
        {
            IntPtr const_ptr_parent = IntPtr.Zero;
            IntPtr const_ptr_this   = IntPtr.Zero;

            TextObject parent = _GetConstObjectParent() as TextObject;

            if (null != parent)
            {
                const_ptr_parent = parent.ConstPointer();
            }
            else
            {
                const_ptr_this = ConstPointer();
            }

            Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
            IntPtr ptr_curves         = curves.NonConstPointer();
            var    const_ptr_dimstyle = dimstyle.ConstPointer();

            UnsafeNativeMethods.RHC_RhinoGetPlanarCurvesFromText(const_ptr_parent, const_ptr_this, const_ptr_dimstyle, !bAllowOpen, smallCapsScale, spacing, ptr_curves);
            return(curves.ToNonConstArray());
        }
Exemple #10
0
        /// <summary>
        /// Explodes this PolyCurve into a list of Curve segments. This will <b>not explode</b> nested polycurves.
        /// Call <see cref="RemoveNesting"/> first if you need all individual segments.
        /// </summary>
        /// <returns>An array of polycurve segments.</returns>
        public Curve[] Explode()
        {
            Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
            IntPtr pConstThis  = ConstPointer();
            IntPtr pCurveArray = curves.NonConstPointer();

            UnsafeNativeMethods.ON_PolyCurve_SegmentCurves(pConstThis, pCurveArray);

            int count = UnsafeNativeMethods.ON_CurveArray_Count(pCurveArray);

            Curve[] rc = new Curve[count];
            for (int i = 0; i < count; i++)
            {
                IntPtr pConstSegmentCurve = UnsafeNativeMethods.ON_CurveArray_Get(pCurveArray, i);
                if (IntPtr.Zero == pConstSegmentCurve)
                {
                    continue;
                }
                IntPtr pNewCurve = UnsafeNativeMethods.ON_Curve_DuplicateCurve(pConstSegmentCurve);
                rc[i] = GeometryBase.CreateGeometryHelper(pNewCurve, null) as Curve;
            }
            curves.Dispose();
            return(rc);
        }
    /// <summary>
    /// Explodes this PolyCurve into a list of Curve segments. This will <b>not explode</b> nested polycurves. 
    /// Call <see cref="RemoveNesting"/> first if you need all individual segments.
    /// </summary>
    /// <returns>An array of polycurve segments.</returns>
    public Curve[] Explode()
    {
      Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
      IntPtr pConstThis = ConstPointer();
      IntPtr pCurveArray = curves.NonConstPointer();
      UnsafeNativeMethods.ON_PolyCurve_SegmentCurves(pConstThis, pCurveArray);

      int count = UnsafeNativeMethods.ON_CurveArray_Count(pCurveArray);
      Curve[] rc = new Curve[count];
      for (int i = 0; i < count; i++)
      {
        IntPtr pConstSegmentCurve = UnsafeNativeMethods.ON_CurveArray_Get(pCurveArray, i);
        if (IntPtr.Zero == pConstSegmentCurve)
          continue;
        IntPtr pNewCurve = UnsafeNativeMethods.ON_Curve_DuplicateCurve(pConstSegmentCurve);
        rc[i] = GeometryBase.CreateGeometryHelper(pNewCurve, null) as Curve;
      }
      curves.Dispose();
      return rc;
    }
        /// <summary>
        /// Executes unrolling operations.
        /// </summary>
        /// <param name="unrolledCurves">An array of unrolled curves is assigned during the call in this out parameter.</param>
        /// <param name="unrolledPoints">An array of unrolled points is assigned during the call in this out parameter.</param>
        /// <param name="unrolledDots">An array of unrolled text dots is assigned during the call in this out parameter.</param>
        /// <returns>An array of breps. This array can be empty.</returns>
        /// <since>5.0</since>
        public Brep[] PerformUnroll(out Curve[] unrolledCurves, out Point3d[] unrolledPoints, out TextDot[] unrolledDots)
        {
            unrolledCurves = new Curve[0];
            unrolledPoints = new Point3d[0];
            unrolledDots   = new TextDot[0];

            IntPtr ptr_unroller = IntPtr.Zero;

            if (m_surface != null)
            {
                IntPtr const_ptr_surface = m_surface.ConstPointer();
                ptr_unroller = UnsafeNativeMethods.CRhinoUnroll_NewSrf(const_ptr_surface, m_absolute_tolerance, m_relative_tolerance);
            }
            else if (m_brep != null)
            {
                IntPtr const_ptr_brep = m_brep.ConstPointer();
                ptr_unroller = UnsafeNativeMethods.CRhinoUnroll_NewBrp(const_ptr_brep, m_absolute_tolerance, m_relative_tolerance);
            }
            if (ptr_unroller == IntPtr.Zero)
            {
                throw new Exception("Unable to access input surface or brep");
            }

            var rc = new Brep[0];

            if (0 == UnsafeNativeMethods.CRhinoUnroll_PrepareFaces(ptr_unroller))
            {
                if (m_curves.Count > 0)
                {
                    var    crvs             = new Runtime.InteropWrappers.SimpleArrayCurvePointer(m_curves);
                    IntPtr const_ptr_curves = crvs.ConstPointer();
                    UnsafeNativeMethods.CRhinoUnroll_PrepareCurves(ptr_unroller, const_ptr_curves);
                }
                if (m_points.Count > 0)
                {
                    Point3d[] pts = m_points.ToArray();
                    UnsafeNativeMethods.CRhinoUnroll_PreparePoints(ptr_unroller, pts.Length, pts);
                }
                if (m_dots.Count > 0)
                {
                    using (var dots = new Runtime.InteropWrappers.SimpleArrayGeometryPointer(m_dots))
                    {
                        IntPtr const_ptr_dots = dots.ConstPointer();
                        UnsafeNativeMethods.CRhinoUnroll_PrepareDots(ptr_unroller, const_ptr_dots);
                    }
                }

                int    brep_count   = 0;
                int    curve_count  = 0;
                int    point_count  = 0;
                int    dot_count    = 0;
                double explode_dist = -1;
                if (m_explode_output)
                {
                    explode_dist = m_explode_spacing;
                }
                IntPtr ptr_results = UnsafeNativeMethods.CRhinoUnroll_CreateFlatBreps(ptr_unroller,
                                                                                      explode_dist, ref brep_count, ref curve_count, ref point_count, ref dot_count);
                if (ptr_results != IntPtr.Zero)
                {
                    if (brep_count > 0)
                    {
                        rc = new Brep[brep_count];
                        for (int i = 0; i < brep_count; i++)
                        {
                            IntPtr ptr_brep = UnsafeNativeMethods.CRhinoUnrollResults_GetBrep(ptr_results, i);
                            if (ptr_brep != IntPtr.Zero)
                            {
                                rc[i] = new Brep(ptr_brep, null);
                            }
                        }
                    }
                    if (curve_count > 0)
                    {
                        unrolledCurves = new Curve[curve_count];
                        for (int i = 0; i < curve_count; i++)
                        {
                            IntPtr ptr_curve = UnsafeNativeMethods.CRhinoUnrollResults_GetCurve(ptr_results, i);
                            if (ptr_curve != IntPtr.Zero)
                            {
                                unrolledCurves[i] = new Curve(ptr_curve, null);
                            }
                        }
                    }
                    if (point_count > 0)
                    {
                        unrolledPoints = new Point3d[point_count];
                        UnsafeNativeMethods.CRhinoUnrollResults_GetPoints(ptr_results, point_count, unrolledPoints);
                    }
                    if (dot_count > 0)
                    {
                        unrolledDots = new TextDot[dot_count];
                        for (int i = 0; i < dot_count; i++)
                        {
                            IntPtr ptr_dots = UnsafeNativeMethods.CRhinoUnrollResults_GetDot(ptr_results, i);
                            if (ptr_dots != IntPtr.Zero)
                            {
                                unrolledDots[i] = new TextDot(ptr_dots, null);
                            }
                        }
                    }

                    UnsafeNativeMethods.CRhinoUnrollResults_Delete(ptr_results);
                }
            }
            UnsafeNativeMethods.CRhinoUnroll_Delete(ptr_unroller);
            return(rc);
        }
    /// <summary>
    /// Intersects a Brep and a Surface.
    /// </summary>
    /// <param name="brep">A brep to be intersected.</param>
    /// <param name="surface">A surface to be intersected.</param>
    /// <param name="tolerance">A tolerance value.</param>
    /// <param name="intersectionCurves">The intersection curves array argument. This out reference is assigned during the call.</param>
    /// <param name="intersectionPoints">The intersection points array argument. This out reference is assigned during the call.</param>
    /// <returns>true on success; false on failure.</returns>
    public static bool BrepSurface(Brep brep, Surface surface, double tolerance, out Curve[] intersectionCurves, out Point3d[] intersectionPoints)
    {
      intersectionCurves = new Curve[0];
      intersectionPoints = new Point3d[0];

      Runtime.InteropWrappers.SimpleArrayPoint3d outputPoints = new Runtime.InteropWrappers.SimpleArrayPoint3d();
      IntPtr outputPointsPtr = outputPoints.NonConstPointer();

      Runtime.InteropWrappers.SimpleArrayCurvePointer outputCurves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
      IntPtr outputCurvesPtr = outputCurves.NonConstPointer();

      IntPtr brepPtr = brep.ConstPointer();
      IntPtr surfacePtr = surface.ConstPointer();

      bool rc = UnsafeNativeMethods.ON_Intersect_BrepSurface(brepPtr, surfacePtr, tolerance, outputCurvesPtr, outputPointsPtr);

      if (rc)
      {
        intersectionCurves = outputCurves.ToNonConstArray();
        intersectionPoints = outputPoints.ToArray();
      }

      outputPoints.Dispose();
      outputCurves.Dispose();

      return rc;
    }
 /// <summary>
 /// Generate geometry that would be used to draw the hatch with a given hatch pattern
 /// </summary>
 /// <param name="pattern"></param>
 /// <param name="patternScale"></param>
 /// <param name="bounds"></param>
 /// <param name="lines"></param>
 /// <param name="solidBrep"></param>
 public void CreateDisplayGeometry(DocObjects.HatchPattern pattern, double patternScale, out Curve[] bounds, out Line[] lines, out Brep solidBrep)
 {
   IntPtr const_ptr_this = ConstPointer();
   IntPtr const_ptr_pattern = pattern.ConstPointer();
   using(var curve_array = new Runtime.InteropWrappers.SimpleArrayCurvePointer())
   using(var line_array = new Runtime.InteropWrappers.SimpleArrayLine())
   {
     IntPtr ptr_curves = curve_array.NonConstPointer();
     IntPtr ptr_lines = line_array.NonConstPointer();
     IntPtr ptr_brep = UnsafeNativeMethods.CRhinoHatchPattern_CreateDisplay(const_ptr_this, const_ptr_pattern, patternScale, ptr_curves, ptr_lines);
     solidBrep = (ptr_brep==IntPtr.Zero) ? null : new Brep(ptr_brep, null);
     bounds = curve_array.ToNonConstArray();
     lines = line_array.ToArray();
   }
 }
 /// <summary>
 /// Gets 3d curves that define the boundaries of the hatch
 /// </summary>
 /// <param name="outer">true to get the outer curves, false to get the inner curves</param>
 /// <returns></returns>
 public Curve[] Get3dCurves(bool outer)
 {
   using (Rhino.Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer())
   {
     IntPtr pCurveArray = curves.NonConstPointer();
     IntPtr pConstThis = ConstPointer();
     UnsafeNativeMethods.ON_Hatch_LoopCurve3d(pConstThis, pCurveArray, outer);
     return curves.ToNonConstArray();
   }
 }
 /// <summary>
 /// Explodes this text entity into an array of curves.
 /// </summary>
 /// <returns>An array of curves that forms the outline or content of this text entity.</returns>
 public Curve[] Explode()
 {
   IntPtr pConstThis = ConstPointer();
   Runtime.InteropWrappers.SimpleArrayCurvePointer curves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
   IntPtr pCurves = curves.NonConstPointer();
   UnsafeNativeMethods.ON_TextEntity_Explode(pConstThis, pCurves);
   return curves.ToNonConstArray();
 }
    /// <summary>
    /// Intersects a curve with a Brep face.
    /// </summary>
    /// <param name="curve">A curve.</param>
    /// <param name="face">A brep face.</param>
    /// <param name="tolerance">Fitting and near miss tolerance.</param>
    /// <param name="overlapCurves">A overlap curves array argument. This out reference is assigned during the call.</param>
    /// <param name="intersectionPoints">A points array argument. This out reference is assigned during the call.</param>
    /// <returns>true on success, false on failure.</returns>
    public static bool CurveBrepFace(Curve curve, BrepFace face, double tolerance, out Curve[] overlapCurves, out Point3d[] intersectionPoints)
    {
      overlapCurves = new Curve[0];
      intersectionPoints = new Point3d[0];

      Runtime.InteropWrappers.SimpleArrayPoint3d outputPoints = new Runtime.InteropWrappers.SimpleArrayPoint3d();
      IntPtr outputPointsPtr = outputPoints.NonConstPointer();

      Runtime.InteropWrappers.SimpleArrayCurvePointer outputCurves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
      IntPtr outputCurvesPtr = outputCurves.NonConstPointer();

      IntPtr curvePtr = curve.ConstPointer();
      IntPtr facePtr = face.ConstPointer();

      bool rc = UnsafeNativeMethods.RHC_RhinoCurveFaceIntersect(curvePtr, facePtr, tolerance, outputCurvesPtr, outputPointsPtr);

      if (rc)
      {
        overlapCurves = outputCurves.ToNonConstArray();
        intersectionPoints = outputPoints.ToArray();
      }

      outputPoints.Dispose();
      outputCurves.Dispose();

      return rc;
    }
    /// <summary>
    /// Intersects two Surfaces.
    /// </summary>
    /// <param name="surfaceA">First Surface for intersection.</param>
    /// <param name="surfaceB">Second Surface for intersection.</param>
    /// <param name="tolerance">Intersection tolerance.</param>
    /// <param name="intersectionCurves">The intersection curves will be returned here.</param>
    /// <param name="intersectionPoints">The intersection points will be returned here.</param>
    /// <returns>true on success, false on failure.</returns>
    public static bool SurfaceSurface(Surface surfaceA, Surface surfaceB, double tolerance, out Curve[] intersectionCurves, out Point3d[] intersectionPoints)
    {
      intersectionCurves = new Curve[0];
      intersectionPoints = new Point3d[0];

      Runtime.InteropWrappers.SimpleArrayPoint3d outputPoints = new Runtime.InteropWrappers.SimpleArrayPoint3d();
      IntPtr outputPointsPtr = outputPoints.NonConstPointer();

      Runtime.InteropWrappers.SimpleArrayCurvePointer outputCurves = new Runtime.InteropWrappers.SimpleArrayCurvePointer();
      IntPtr outputCurvesPtr = outputCurves.NonConstPointer();

      IntPtr srfPtrA = surfaceA.ConstPointer();
      IntPtr srfPtrB = surfaceB.ConstPointer();

      bool rc = UnsafeNativeMethods.RHC_RhinoIntersectSurfaces( srfPtrA, srfPtrB, tolerance, outputCurvesPtr, outputPointsPtr);

      if (rc)
      {
        intersectionCurves = outputCurves.ToNonConstArray();
        intersectionPoints = outputPoints.ToArray();
      }

      outputPoints.Dispose();
      outputCurves.Dispose();

      return rc;
    }
    //skipping
    //  const ON_PolyCurve* PolyProfile() const;
    //  int GetProfileCurves( ON_SimpleArray<const ON_Curve*>& profile_curves ) const;

#if RHINO_SDK
    /// <summary>
    /// Constructs all the Wireframe curves for this Extrusion.
    /// </summary>
    /// <returns>An array of Wireframe curves.</returns>
    public Curve[] GetWireframe()
    {
      IntPtr ptr_const_this = ConstPointer();
      using (var output = new Runtime.InteropWrappers.SimpleArrayCurvePointer())
      {
        IntPtr ptr_curve_array = output.NonConstPointer();
        UnsafeNativeMethods.CRhinoExtrusionObject_GetWireFrame(ptr_const_this, ptr_curve_array);
        return output.ToNonConstArray();
      }
    }