コード例 #1
0
 public void DrawEyeSocket(GridSpace grid, double thickness)
 {
     DrawOvoidInBox("black", "none", grid);
     grid = grid.Inset(thickness, InsetType.AllSides);
     DrawOvoidInBox("white", "none", grid);
     grid = grid.Inset(thickness, InsetType.AllSides);
     DrawEyeInBox("white", "black", grid, thickness * 0.5);
 }
コード例 #2
0
 public void DrawOvoidInBox(String fillStr, String outlineStr, GridSpace grid)
 {
     m_file.DrawClosedCatmullRomSpline(fillStr, outlineStr,
                 new Path(grid[0.116, 0.054],
                         grid[0.009, 0.484],
                         grid[0.188, 0.860],
                         grid[0.500, 1.000],
                         grid[0.813, 0.860],
                         grid[0.991, 0.484],
                         grid[0.884, 0.054]));
 }
コード例 #3
0
        public void DrawBakersUform1(GridSpace grid, double thickness)
        {
            DrawUformInBox("black", "none", grid);
            grid = grid.Inset(thickness, InsetType.BottomFixed); DrawUformInBox("white", "none", grid);
            grid = grid.Inset(thickness, InsetType.BottomFixed); DrawUformInBox("white", "black", grid);

            GridSpace leftgrid = grid.Inset(thickness*0.65, InsetType.LeftHalf);
            DrawStackedUform("white", "red", leftgrid, thickness);

            GridSpace rightgrid = grid.Inset(thickness * 0.65, InsetType.RightHalf);
            DrawStackedUform("white", "red", rightgrid, thickness);
        }
コード例 #4
0
 public void DrawEyeInBox(String fillStr, String outlineStr, GridSpace grid, double thickness)
 {
     m_file.DrawCatmullRomSplines(fillStr, outlineStr,
                 new Path(grid[-0.10, 0.400],
                         grid[0.000, 0.500],
                         grid[0.188, 0.860],
                         grid[0.500, 1.000],
                         grid[0.813, 0.860],
                         grid[1.000, 0.500],
                         grid[1.100, 0.400]),
                 new Path(grid[1.100, 0.400],
                         grid[1.000, 0.300],
                         grid[0.884, 0.054],
                         grid[0.500, 0.000],
                         grid[0.116, 0.054],
                         grid[0.000, 0.300],
                         grid[-0.10, 0.400]));
     grid = grid.Inset(thickness, InsetType.AllSides);
     DrawOvoidInBox(outlineStr, "none", grid);
     DrawOvoidInBox(fillStr, "none", grid.Inset(thickness, InsetType.AllSides));
     DrawOvoidInBox(outlineStr, "none", grid.Inset(thickness * 2, InsetType.CupUp));
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: dmswart/Personal-Projects
        static void Main(string[] args)
        {
            String fileName = "nwc_" + System.DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".eps";
            EPSFile file = new EPSFile(fileName);
            NWCArt artwork = new NWCArt(file);

            #if false //draw the same thing at different orientations.
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    double x = 25.0 * ((i+1)* (i+2) / 2.0);
                    double y = 25.0 * ((j+1) * (j+2) / 2.0);
                    double width = 25.0 * (i + 1);
                    double height = 25.0 * (j + 1);

                    GridSpace grid = new GridSpace( new Path( new Point2D(x,y),
                                                              //new Point2D(x+width*0.5, y + height * 0.1),
                                                              new Point2D(x + width, y ) ),
                                                    new Path( new Point2D(x, y + height),
                                                              new Point2D(x + width, y + height) ) );

                    artwork.DrawBox("lightgray", "none", grid);
                    artwork.DrawUformInBox("white","black",grid);
                }
            }
            #endif
            #if true   //odd quadrilateral.

            //            GridSpace grid2 = new GridSpace(new Point2D(100, 600),
            //                                                        new Point2D(500, 550),
            //                                                        new Point2D(250, 720),
            //                                                        new Point2D(500, 800));
            GridSpace grid2 = new GridSpace(new Point2D(0, 0),
                                            new Point2D(350, 0),
                                            new Point2D(0, 700),
                                            new Point2D(350, 700));
            artwork.DrawBox("lightgray", "none", grid2);
            artwork.DrawUformInBox("white","black",grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            #endif
            #if false
            artwork.DrawSun(100, 10);
            #endif

            file.Close();

            System.IO.File.Copy(fileName, "latest.eps", true);
            System.IO.File.Move(fileName, ".\\archive\\" + fileName);
        }
コード例 #6
0
 public void DrawSplitInBox(String fillStr, String outlineStr, GridSpace grid)
 {
     m_file.DrawCatmullRomSplines(fillStr, outlineStr,
                 new Path(grid[0.0, 0.0],
                         grid[0.083333333, 0.1],
                         grid[0.416666667, 0.32],
                         grid[0.5, 0.86]),
                 new Path(grid[0.5, 0.86],
                         grid[0.583333333, 0.32],
                         grid[0.916666667, 0.1],
                         grid[1.0, 0.0]),
                 grid.m_bottomPath.reversed());
 }
コード例 #7
0
 public void DrawBox(String fillStr, String outlineStr, GridSpace grid)
 {
     m_file.DrawPoly(fillStr, outlineStr, new Path(grid[0, 0], grid[0, 1], grid[1, 1], grid[1, 0]));
 }
コード例 #8
0
 public GridSpace ExtractUform(GridSpace grid)
 {
     return new GridSpace(
         new Path(grid[0.0, 0.0],
                  grid[1.0, 0.0]),
         new Path(grid[0.1333, 0.89],
                  grid[0.8666, 0.89]));
 }
コード例 #9
0
 public GridSpace ExtractOvoid(GridSpace grid)
 {
     return new GridSpace(
         new Path(grid[0.116, 0.054],
                 grid[0.884, 0.054]),
         new Path(grid[0.009, 0.484],
                 grid[0.188, 0.860],
                 grid[0.500, 1.000],
                 grid[0.813, 0.860],
                 grid[0.991, 0.484]));
 }
コード例 #10
0
 public void DrawUformInBox(String fillStr, String outlineStr, GridSpace grid)
 {
     m_file.DrawCatmullRomSplines(fillStr, outlineStr,
                 new Path(grid[0.0, 0.0],
                         grid[0.1333, 0.89],
                         grid[0.8666, 0.89],
                         grid[1.0, 0.0]),
                 grid.m_bottomPath.reversed());
 }
コード例 #11
0
 public void DrawStackedUform(string fillStr, string outlineStr, GridSpace grid, double thickness)
 {
     DrawUformInBox(outlineStr, "none", grid);
     DrawSplitInBox(fillStr, "none", grid.Inset(thickness, InsetType.TopHalf));
     //DrawUformInBox(fillStr, "none", grid.Inset(thickness, InsetType.TopHalf));
     //DrawOvoidInBox(fillStr, "none", grid.Inset(thickness, InsetType.TopHalf));
     DrawUformInBox(fillStr, "none", grid.Inset(thickness, InsetType.BottomHalf));
     grid = grid.Inset(thickness, InsetType.BottomHalf);
     DrawOvoidInBox(outlineStr, "none", grid.Inset(thickness, InsetType.TopHalf));
     DrawUformInBox(outlineStr, "none", grid.Inset(thickness, InsetType.BottomHalf));
 }