Exemple #1
0
        // [TODO] no reason we couldn't start on edge midpoint??
        public virtual void AppendPolygon2d(FillPolygon2d poly)
        {
            Vector3d currentPos  = Builder.Position;
            Vector2d currentPos2 = currentPos.xy;

            int N = poly.VertexCount;

            if (N < 2)
            {
                throw new Exception("PathScheduler.AppendPolygon2d: degenerate curve!");
            }

            int iNearest = CurveUtils2.FindNearestVertex(currentPos2, poly.Vertices);

            Vector2d startPt = poly[iNearest];

            Builder.AppendTravel(startPt, Settings.RapidTravelSpeed);

            List <Vector2d> loopV = new List <Vector2d>(N + 1);

            for (int i = 0; i <= N; i++)
            {
                int k = (iNearest + i) % N;
                loopV.Add(poly[k]);
            }

            double useSpeed = select_speed(poly);

            Builder.AppendExtrude(loopV, useSpeed, poly.TypeFlags, null);
        }
 protected virtual void BuildLoopConcrete <TSegment>(FillLoop <TSegment> rolled, double useSpeed) where TSegment : IFillSegment, new()
 {
     Builder.AppendExtrude(rolled.Vertices(true).ToList(), useSpeed, rolled.FillType, null);
 }