コード例 #1
0
        /*Draw Line*/
        public static void DrawLine(netDxf.Entities.Line xLine, Canvas mainCanvas)
        {
            double X1 = xLine.StartPoint.X;
            double Y1 = mainCanvas.Height - xLine.StartPoint.Y;
            double X2 = xLine.EndPoint.X;
            double Y2 = mainCanvas.Height - xLine.EndPoint.Y;

            getMaxPt(xLine.StartPoint);
            getMaxPt(xLine.EndPoint);
            System.Windows.Shapes.Line wLine = DrawUtils.GetLine(X1, Y1, X2, Y2);
            TypeConverter.Entity2Shape(xLine, wLine);
            mainCanvas.Children.Add(wLine);
        }
コード例 #2
0
        /*Draw Mesh*/
        public static void DrawMesh(Mesh xMesh, Canvas mainCanvas)
        {
            System.Windows.Shapes.Polygon wPoly = new System.Windows.Shapes.Polygon();

            foreach (netDxf.Entities.MeshEdge xEdge in xMesh.Edges)
            {
                System.Windows.Point myPt1 = TypeConverter.Vertex3ToPoint(xMesh.Vertexes[xEdge.StartVertexIndex]);
                System.Windows.Point myPt2 = TypeConverter.Vertex3ToPoint(xMesh.Vertexes[xEdge.EndVertexIndex]);
                myPt1.Y = mainCanvas.Height - myPt1.Y;
                myPt2.Y = mainCanvas.Height - myPt2.Y;

                System.Windows.Shapes.Line wLine = DrawUtils.GetLine(myPt1.X, myPt1.Y, myPt2.X, myPt2.Y);


                TypeConverter.Entity2Shape(xMesh, wLine);

                mainCanvas.Children.Add(wLine);
            }
        }