Example #1
0
        List <Step> AddStepsForOneLine(Polygon reducedPolygon, Point previous, Point current)
        {
            // use current stroke specification for fill of widened polygon
            Polygon widened   = new LineWidener(previous, current, reducedPolygon.Stroke, string.Empty).Widen(this.colorTranslation.MaxStepLength);
            double  lineAngle = previous.Angle(current);
            var     ctRotated = new ColorTranslation {
                Color         = widened.Color,
                StepAngle     = this.colorTranslation.StepAngle + lineAngle,
                MaxStepLength = this.colorTranslation.MaxStepLength,
                LineHeight    = this.colorTranslation.LineHeight,
                MoveInside    = 0
            };
            var angleStepper = new AngleStepper(widened, ctRotated);

            return(angleStepper.CalculateFillSteps());
        }
Example #2
0
 public static bool IsStroke(this ColorTranslation @this) => @this.Color.StartsWith("stroke:");
Example #3
0
 public static bool IsFill(this ColorTranslation @this) => @this.Color.StartsWith("fill:");
Example #4
0
 public FillCalculator(Polygon polygon, ColorTranslation ct)
 {
     this.polygon          = polygon;
     this.colorTranslation = ct;
 }
Example #5
0
 public AngleStepper(Polygon p, ColorTranslation ct)
 {
     this.p  = p;
     this.ct = ct;
 }
Example #6
0
 public HorizontalStepper(Polygon p, ColorTranslation ct)
 {
     this.polygon = p;
     this.ct      = ct;
 }