コード例 #1
0
        public static WavefrontFormat DrawCurve(this WavefrontFormat wf,
                                                string color,
                                                ICurve2 curve,
                                                int count = 100)
        {
            wf.UseMaterial(color);
            if (curve is ComposedCurve2)
            {
                int            i        = 0;
                ComposedCurve2 composed = (ComposedCurve2)curve;
                foreach (ICurve2 segment in composed.GetSegments())
                {
                    /*Vec2d pt = segment.GetPosition(segment.TMin);
                     * wf.DrawFigure(color, WaveFigure.X, pt, 1);
                     * wf.DrawString(color, pt, FontFamily.GenericSerif, FontStyle.Regular, 1000, "" + (i++));*/

                    //if (segment is CircleArc2)
                    {
                        wf.AddLines(MathUtils.For(segment.TMin, segment.TMax, count).Select(segment.GetPosition), false);
                    }
                }

                /*if (!curve.IsClosed)
                 * {
                 *  Vec2d pt = curve.GetPosition(curve.TMax);
                 *  wf.DrawFigure(color, WaveFigure.X, pt, 1);
                 *  wf.DrawString(color, pt, FontFamily.GenericSerif, FontStyle.Regular, 1000, "" + (i++));
                 * }*/
            }
            else
            {
                wf.AddLines(MathUtils.For(curve.TMin, curve.TMax, count).Select(curve.GetPosition), false);
            }
            return(wf);
        }
コード例 #2
0
ファイル: Edge3.cs プロジェクト: mh-soft/mh-master
 // Token: 0x06000104 RID: 260 RVA: 0x000050EC File Offset: 0x000032EC
 public Edge3(Orientation orientation, ICurve3 curve, ICurve2 curveOnSurface, double startParameter, double endParameter)
 {
     this.Orientation    = orientation;
     this.Curve          = curve;
     this.CurveOnSurface = curveOnSurface;
     this.StartParameter = startParameter;
     this.EndParameter   = endParameter;
     this.StartVertex    = this.Curve.EvalAt(this.StartParameter);
     this.EndVertex      = this.Curve.EvalAt(this.EndParameter);
 }
コード例 #3
0
ファイル: Edge3.cs プロジェクト: mh-soft/mh-master
 // Token: 0x06000105 RID: 261 RVA: 0x00005152 File Offset: 0x00003352
 public Edge3(Orientation orientation, ICurve3 curve, ICurve2 curveOnSurface, double startParameter, double endParameter, Vector3 startVertex, Vector3 endVertex)
 {
     this.Orientation    = orientation;
     this.Curve          = curve;
     this.CurveOnSurface = curveOnSurface;
     this.StartParameter = startParameter;
     this.EndParameter   = endParameter;
     this.StartVertex    = startVertex;
     this.EndVertex      = endVertex;
 }
コード例 #4
0
        public static void TimeSubdivision(ICurve2 curve, int size, IList <Point2d> points)
        {
            Debug.Assert(size >= 2);
            Debug.Assert(points != null);

            double delta = (curve.TMax - curve.TMin) / (size - 1);
            double t     = curve.TMin;

            for (int i = 0; i < size; i++)
            {
                points.Add(curve.GetPosition(t));
                t += delta;
            }
        }
コード例 #5
0
        public static void LengthSubdivision(ICurve2 curve, int size, IList <Point2d> puntos)
        {
            Debug.Assert(size >= 2);
            Debug.Assert(puntos != null);

            double delta    = curve.TotalLength / (size - 1);
            double longitud = 0;

            for (int i = 0; i < size; i++)
            {
                double t = curve.GetT(longitud);
                puntos.Add(curve.GetPosition(t));
                longitud += delta;
            }
        }
コード例 #6
0
ファイル: ComposedCurve2.cs プロジェクト: JohannesMP/Essence
 public void Add(ICurve2 curve)
 {
     if (this.segments.Count == 0)
     {
         this.segments.Add(curve);
     }
     else
     {
         ICurve2 last = this.segments[this.segments.Count - 1];
         double  tmin = last.TMax;
         double  tlen = curve.TMax - curve.TMin;
         curve.SetTInterval(tmin, tmin + tlen);
         this.segments.Add(curve);
     }
 }
コード例 #7
0
 public static WavefrontFormat DrawCurve(this WavefrontFormat wf,
                                         string color,
                                         ICurve2 curve,
                                         int count = 100)
 {
     wf.UseMaterial(color);
     if (curve is ComposedCurve2)
     {
         int            i        = 0;
         ComposedCurve2 composed = (ComposedCurve2)curve;
         foreach (ICurve2 segment in composed.GetSegments())
         {
             wf.AddLines(MathUtils.For(segment.TMin, segment.TMax, count).Select(segment.GetPosition), false);
         }
     }
     else
     {
         wf.AddLines(MathUtils.For(curve.TMin, curve.TMax, count).Select(curve.GetPosition), false);
     }
     return(wf);
 }
コード例 #8
0
ファイル: CurveEvaluator2.cs プロジェクト: 15831944/Essence
 private static IEnumerable <double> GetTimes(ICurve2 curve, double tinc)
 {
     if (curve is MultiCurve2)
     {
         TimeList    times = new TimeList();
         MultiCurve2 multi = (MultiCurve2)curve;
         for (int i = 0; i < multi.NumSegments; i++)
         {
             double tmin = multi.GetTMin(i);
             double tmax = multi.GetTMax(i);
             double t    = tmin;
             while (t < tmax)
             {
                 times.Add(t);
                 t += tinc;
             }
             times.Add(tmax);
         }
         return(times.GetTimes());
     }
     else if (curve is DisplacedCurve2)
     {
         DisplacedCurve2 displaced = (DisplacedCurve2)curve;
         return(MathUtils.ConcatSorted(GetTimes(displaced.Curve, tinc), GetTimes(displaced.Displacement, tinc)));
     }
     else
     {
         TimeList times = new TimeList();
         double   tmin  = curve.TMin;
         double   tmax  = curve.TMax;
         double   t     = tmin;
         while (t < tmax)
         {
             times.Add(t);
             t += tinc;
         }
         times.Add(tmax);
         return(times.GetTimes());
     }
 }
コード例 #9
0
ファイル: CurveEvaluator2.cs プロジェクト: 15831944/Essence
 public CurveEvaluator2(ICurve2 curve, double tinc)
 {
     this.curve = curve;
     this.tinc  = tinc;
 }
コード例 #10
0
 public static ICurve2 Split(ICurve2 curve, double tmin, double tmax)
 {
     return(new SplitCurve2(curve, tmin, tmax));
 }
コード例 #11
0
 public SplitCurve2(ICurve2 curve, double tmin, double tmax)
     : base(curve)
 {
     this.tmin = tmin;
     this.tmax = tmax;
 }
コード例 #12
0
ファイル: DisplacedCurve2.cs プロジェクト: 15831944/Essence
 public DisplacedCurve2(ICurve2 curve, ICurve1 displacement)
 {
     this.curve        = curve;
     this.displacement = displacement;
 }
コード例 #13
0
 public WrapperCurve2(ICurve2 curve)
 {
     this.curve = curve;
 }