Ejemplo n.º 1
0
        /// <since>5.0</since>
        public Brep[] PerformSweep(Curve rail, IEnumerable <Curve> crossSections, IEnumerable <double> crossSectionParameters)
        {
            List <Curve>  sections   = new List <Curve>(crossSections);
            List <double> parameters = new List <double>(crossSectionParameters);

            if (sections.Count > 1 && sections.Count == parameters.Count)
            {
                Curve[]  crvs = sections.ToArray();
                double[] par  = parameters.ToArray();
                Array.Sort(par, crvs);
                crossSections          = crvs;
                crossSectionParameters = par;
            }

            ArgsSweep1 sweep = ArgsSweep1.Construct(rail, crossSections, crossSectionParameters, m_roadlike_up, m_bClosed, m_sweep_tol, m_angle_tol, m_miter_type);

            Runtime.InteropWrappers.SimpleArrayBrepPointer breps = new Rhino.Runtime.InteropWrappers.SimpleArrayBrepPointer();
            IntPtr pArgsSweep1 = sweep.NonConstPointer();
            IntPtr pBreps      = breps.NonConstPointer();

            UnsafeNativeMethods.RHC_Sweep1(pArgsSweep1, pBreps, m_shape_blending);
            Brep[] rc = breps.ToNonConstArray();
            sweep.Dispose();
            breps.Dispose();
            return(rc);
        }
Ejemplo n.º 2
0
        /// <since>5.0</since>
        public Brep[] PerformSweepRebuild(Curve rail, IEnumerable <Curve> crossSections, IEnumerable <double> crossSectionParameters, int rebuildCount)
        {
            ArgsSweep1 sweep = ArgsSweep1.Construct(rail, crossSections, crossSectionParameters, m_roadlike_up, m_bClosed, m_sweep_tol, m_angle_tol, m_miter_type);

            Runtime.InteropWrappers.SimpleArrayBrepPointer breps = new Rhino.Runtime.InteropWrappers.SimpleArrayBrepPointer();
            IntPtr pArgsSweep1 = sweep.NonConstPointer();
            IntPtr pBreps      = breps.NonConstPointer();

            UnsafeNativeMethods.RHC_Sweep1Rebuild(pArgsSweep1, pBreps, rebuildCount, m_shape_blending);
            Brep[] rc = breps.ToNonConstArray();
            sweep.Dispose();
            breps.Dispose();
            return(rc);
        }
Ejemplo n.º 3
0
 public Brep[] PerformSweepRebuild(Curve rail, IEnumerable<Curve> crossSections, IEnumerable<double> crossSectionParameters, int rebuildCount)
 {
   ArgsSweep1 sweep = ArgsSweep1.Construct(rail, crossSections, crossSectionParameters, m_roadlike_up, m_bClosed, m_sweep_tol, m_angle_tol, m_miter_type);
   Runtime.InteropWrappers.SimpleArrayBrepPointer breps = new Rhino.Runtime.InteropWrappers.SimpleArrayBrepPointer();
   IntPtr pArgsSweep1 = sweep.NonConstPointer();
   IntPtr pBreps = breps.NonConstPointer();
   UnsafeNativeMethods.RHC_Sweep1Rebuild(pArgsSweep1, pBreps, rebuildCount);
   Brep[] rc = breps.ToNonConstArray();
   sweep.Dispose();
   breps.Dispose();
   return rc;
 }
Ejemplo n.º 4
0
    public Brep[] PerformSweep(Curve rail, IEnumerable<Curve> crossSections, IEnumerable<double> crossSectionParameters)
    {
      List<Curve> sections = new List<Curve>(crossSections);
      List<double> parameters = new List<double>(crossSectionParameters);
      if (sections.Count > 1 && sections.Count == parameters.Count)
      {
        Curve[] crvs = sections.ToArray();
        double[] par = parameters.ToArray();
        Array.Sort(par, crvs);
        crossSections = crvs;
        crossSectionParameters = par;
      }

      ArgsSweep1 sweep = ArgsSweep1.Construct(rail, crossSections, crossSectionParameters, m_roadlike_up, m_bClosed, m_sweep_tol, m_angle_tol, m_miter_type);
      Runtime.InteropWrappers.SimpleArrayBrepPointer breps = new Rhino.Runtime.InteropWrappers.SimpleArrayBrepPointer();
      IntPtr pArgsSweep1 = sweep.NonConstPointer();
      IntPtr pBreps = breps.NonConstPointer();
      UnsafeNativeMethods.RHC_Sweep1(pArgsSweep1, pBreps);
      Brep[] rc = breps.ToNonConstArray();
      sweep.Dispose();
      breps.Dispose();
      return rc;
    }