protected void BuildCurveConcrete <TSegment>(FillCurve <TSegment> curve, double useSpeed) where TSegment : IFillSegment, new()
        {
            var vertices   = curve.Vertices().ToList();
            var flags      = CreateToolpathVertexFlags(curve);
            var dimensions = GetFillDimensions(curve);

            Builder.AppendExtrude(vertices, useSpeed, dimensions, curve.FillType, curve.IsHoleShell, flags);
        }
Пример #2
0
        private FillCurve <FillSegment> SimplifyPath(FillCurve <FillSegment> path)
        {
            var simp = new PolySimplification2(new PolyLine2d(path.Vertices()));

            switch (SimplifyAmount)
            {
            default:
            case SimplificationLevel.Minor:
                simp.SimplifyDeviationThreshold = ToolWidth / 4; break;

            case SimplificationLevel.Moderate:
                simp.SimplifyDeviationThreshold = ToolWidth / 2; break;

            case SimplificationLevel.Aggressive:
                simp.SimplifyDeviationThreshold = ToolWidth; break;
            }
            simp.Simplify();
            path = new FillCurve <FillSegment>(simp.Result.ToArray())
            {
                FillType = this.FillType
            };
            return(path);
        }