Exemple #1
0
        public ShapeCollection CreatePaths(PathData p, double increment)
        {
           
            ShapeCollection pc = new ShapeCollection();
            if (p == null || !(p is LatticeData)) return pc;
            ld = p as LatticeData;
            
            rowHeight = ld.Layout.Height / (ld.Rows - 1);
            colWidth = ld.Layout.Width / (ld.Columns - 1);
            //Shape s = MkPath(0, 0, increment);
            //if (s != null)
            //    pc.AddShape(s);
            if ((ld.Layout.RepeatX == 0) && (ld.Layout.RepeatY == 0))
            {
                pc.AddShape(MkPath(0, 0, increment));
            }
            else if ((ld.Layout.RepeatX == 0) && (ld.Layout.RepeatY > 0))
            {
                for (int indy = -ld.Layout.RepeatY; indy < ld.Layout.RepeatY; indy++)
                {
                    Shape s = MkPath(0, indy, increment);
                    if (s != null)
                        pc.AddShape(s);
                }
            }
            else if ((ld.Layout.RepeatX > 0) && (ld.Layout.RepeatY == 0))
            {
                for (int indx = -ld.Layout.RepeatX; indx < ld.Layout.RepeatX; indx++)
                {
                    Shape s = MkPath(indx, 0, increment);
                    if (s != null)
                        pc.AddShape(s);
                }
            }
            else
            {
                for (int indy = -ld.Layout.RepeatY; indy < ld.Layout.RepeatY; indy++)
                {
                    for (int indx = -ld.Layout.RepeatX; indx < ld.Layout.RepeatX; indx++)
                    {
                        Shape s = MkPath(indx, indy, increment);
                        if (s != null)
                            pc.AddShape(s);
                    }
                }

            }
            return pc;
        }
Exemple #2
0
        public ShapeCollection CreatePaths(PathData p, double increment)
        {
           
            ShapeCollection pc = new ShapeCollection();
            if (p == null || !(p is LatticeData)) return pc;
            ld = p as LatticeData;
            repeatAngle = 360.0 / ld.Layout.RepeatX;
            colAngle = (repeatAngle - ld.Layout.Margin) / (ld.Columns - 1);

            rowHeight = ld.Layout.Height / (ld.Rows - 1);
            colWidth = ld.Layout.Width / (ld.Columns - 1);
            origin = new Point(ld.Layout.ToolPosition, 0);

            if ((ld.Layout.RepeatX == 0) && (ld.Layout.RepeatY == 0))
            {
                pc.AddShape(MkPath(0, 0, increment));
            }
            else if ((ld.Layout.RepeatX == 0) && (ld.Layout.RepeatY > 0))
            {
                for (int indy = -ld.Layout.RepeatY; indy < ld.Layout.RepeatY; indy++)
                {
                    pc.AddShape(MkPath(0, indy, increment));
                }
            }
            else if ((ld.Layout.RepeatX > 0) && (ld.Layout.RepeatY == 0))
            {
                for (int indx = -ld.Layout.RepeatX; indx < ld.Layout.RepeatX; indx++)
                {
                    pc.AddShape(MkPath(indx, 0, increment));
                }
            }
            else
            {
                for (int indy = -ld.Layout.RepeatY; indy < ld.Layout.RepeatY; indy++)
                {
                    for (int indx = -ld.Layout.RepeatX; indx < ld.Layout.RepeatX; indx++)
                    {
                        pc.AddShape(MkPath(indx, indy, increment));
                    }
                }
            }

            //for (int indx = 0; indx < ld.Layout.RepeatX; indx++)
            //{
            //    pc.AddShape(MkPath(indx,increment));
            //}
            return pc;
        }
Exemple #3
0
 public ShapeCollection CreatePaths(PathData pathdata, double inc)
 {
     ShapeCollection pc = new ShapeCollection();
     pc.PatternName = pathdata.Name;
     pc.AddShape(Path(pathdata, inc));
     return pc;
 }
Exemple #4
0
 /// <summary>
 /// In this class the second parameter is the number of paths
 /// </summary>
 /// <param name="pathdata"></param>
 /// <param name="increment"></param>
 /// <returns></returns>
 public ShapeCollection CreatePaths(PathData pathdata, double increment)
 {
     ShapeCollection pc = new ShapeCollection();
     pc.PatternName = pathdata.Name;
     if (pathdata.PathType == PatternType.barrel)
     {
         Barrel b = pathdata as Barrel;
         RadialOffsetPath path = b.OutlineAsOffsets((int)(1/increment));
         Polygon poly = CreatePolygonFrom(path, b.ToolPosition);
         (poly.RenderTransform as CompositeTransform).Rotation = b.Phase;
         pc.AddShape(poly);
     }
     return pc;
 }
Exemple #5
0
 public ShapeCollection CreatePaths (PathData pathdata, double inc)
 {
     //Debug.WriteLine("BazelyEngine CreatePaths");
     ShapeCollection pc = new ShapeCollection();
     pc.PatternName = pathdata.Name;
     Polygon poly = Path(pathdata, inc);
     try
     {
         pc.AddShape(poly);
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
     }
     //Debug.WriteLine("End BazelyEngine CreatePaths");
     return pc;
 }
Exemple #6
0
        public ShapeCollection CreatePaths(PathData pd, double increment)
        {
            bd = pd as BraidData;
            ShapeCollection pc = new ShapeCollection();
            pc.PatternName = pd.Name;
            repeatAngle = 2 * Math.PI / bd.Repeats;
            colAngle = (repeatAngle - rad * bd.Margin) / bd.Perms.Count ;

            rowHeight = bd.Width / (bd.NumStrands - 1);
            colWidth = bd.Length / bd.Perms.Count;
            origin = new Point(bd.ToolPosition, 0);

            for (int indx = 0; indx < bd.Repeats; indx++)
            {
                pc.AddShape(MkPath(indx, increment));
            }
            return pc;
           
        }
Exemple #7
0
 public ShapeCollection Path(double inc)
 {
     ShapeCollection pc = new ShapeCollection();
     pc.AddShape(Outline(inc));
     return pc;
 }