Пример #1
0
 /// <summary>
 /// Splits (divides) the surface into two parts at the specified parameter
 /// </summary>
 /// <param name="direction">
 /// 0 = The surface is split vertically. The "west" side is returned as the first
 /// surface in the array and the "east" side is returned as the second surface in
 /// the array.
 /// 1 = The surface is split horizontally. The "south" side is returned as the first surface in the array and the "north"
 /// side is returned as the second surfae in the array
 /// </param>
 /// <param name="parameter">
 /// value of constant parameter in interval returned by Domain(direction)
 /// </param>
 /// <returns>Array of two surfaces on success</returns>
 public Surface[] Split(int direction, double parameter)
 {
   using (var surfaces = new Runtime.InteropWrappers.SimpleArraySurfacePointer())
   {
     IntPtr pSurfaces = surfaces.NonConstPointer();
     IntPtr pConstThis = ConstPointer();
     UnsafeNativeMethods.ON_Surface_Split(pConstThis, direction, parameter, pSurfaces);
     return surfaces.ToNonConstArray();
   }
 }
    /// <summary>
    /// Constructs a rolling ball fillet between two surfaces.
    /// </summary>
    /// <param name="surfaceA">A first surface.</param>
    /// <param name="uvA">A point in the parameter space of FaceA near where the fillet is expected to hit the surface.</param>
    /// <param name="surfaceB">A second surface.</param>
    /// <param name="uvB">A point in the parameter space of FaceB near where the fillet is expected to hit the surface.</param>
    /// <param name="radius">A radius value.</param>
    /// <param name="tolerance">A tolerance value used for approximating and intersecting offset surfaces.</param>
    /// <returns>A new array of rolling ball fillet surfaces; this array can be empty on failure.</returns>
    /// <exception cref="ArgumentNullException">If surfaceA or surfaceB are null.</exception>
    public static Surface[] CreateRollingBallFillet(Surface surfaceA, Point2d uvA, Surface surfaceB, Point2d uvB, double radius, double tolerance)
    {
      if (surfaceA == null) throw new ArgumentNullException("surfaceA");
      if (surfaceB == null) throw new ArgumentNullException("surfaceB");

      IntPtr const_ptr_surface_a = surfaceA.ConstPointer();
      IntPtr const_ptr_surface_b = surfaceB.ConstPointer();
      using (Runtime.InteropWrappers.SimpleArraySurfacePointer srfs = new Runtime.InteropWrappers.SimpleArraySurfacePointer())
      {
        IntPtr ptr_surfaces = srfs.NonConstPointer();
        UnsafeNativeMethods.RHC_RhinoSimpleRollingBallFillet2(const_ptr_surface_a, uvA,
          const_ptr_surface_b, uvB, radius, tolerance, ptr_surfaces);
        return srfs.ToNonConstArray();
      }
    }