Exemple #1
0
        public void GetFourExtremePoints(out Vector3[] points, VerticesStats vs)
        {
            float   extraExtension = 3;
            Vector3 p1             = new Vector3(vs.MinX - extraExtension, vs.MinY - extraExtension, vs.MinZ - extraExtension);
            Vector3 p2             = new Vector3(vs.MinX - extraExtension, vs.MaxY + extraExtension, vs.MaxZ + extraExtension);
            Vector3 p3             = new Vector3(vs.MaxX + extraExtension, vs.MaxY + extraExtension, vs.MaxZ + extraExtension);
            Vector3 p4             = new Vector3(vs.MaxX + extraExtension, vs.MinY - extraExtension, vs.MinZ - extraExtension);

            //project p1-p4 on the plane and set "points" to them
            points    = new Vector3[4];
            points[0] = new Vector3(ProjectPointOnPlane(p1));
            points[1] = new Vector3(ProjectPointOnPlane(p2));
            points[2] = new Vector3(ProjectPointOnPlane(p3));
            points[3] = new Vector3(ProjectPointOnPlane(p4));
        }
Exemple #2
0
        public MeshInfoForm(Common.VerticesStats cast1, Common.VerticesStats cast2)
        {
            InitializeComponent();

            if (cast1.name != null && cast1.name.ToLower() != "no mesh loaded")
            {
                lb_meshName1.Text    = "Mesh: " + cast1.name;
                lb_numVertices1.Text = "Vertices: " + cast1.numVertices.ToString();
                lb_numFaces1.Text    = "Faces: " + cast1.numFaces.ToString();
                lb_range1.Text       = "Range: " +
                                       "X(" + cast1.MinX.ToString("f2") + "  :  " + cast1.MaxX.ToString("f2") + ") " +
                                       "Y(" + cast1.MinY.ToString("f2") + "  :  " + cast1.MaxY.ToString("f2") + ") " +
                                       "Z(" + cast1.MinZ.ToString("f2") + "  :  " + cast1.MaxZ.ToString("f2") + ")";
                lb_mean1.Text = "Center of Mass: " +
                                cast1.Mean.X.ToString("f9") + " , " +
                                cast1.Mean.Y.ToString("f9") + " , " +
                                cast1.Mean.Z.ToString("f9");
                lb_averageVertexDistance1.Text = "Average Vertex Distance: " + cast1.averageVertexDistance.ToString("f2");
            }

            if (cast2.name != null && cast2.name.ToLower() != "no mesh loaded")
            {
                lb_meshName2.Text    = "Mesh: " + cast2.name;
                lb_numVertices2.Text = "Vertices: " + cast2.numVertices.ToString();
                lb_numFaces2.Text    = "Faces: " + cast2.numFaces.ToString();
                lb_range2.Text       = "Range: " +
                                       "X(" + cast2.MinX.ToString("f2") + "  :  " + cast2.MaxX.ToString("f2") + ") " +
                                       "Y(" + cast2.MinY.ToString("f2") + "  :  " + cast2.MaxY.ToString("f2") + ") " +
                                       "Z(" + cast2.MinZ.ToString("f2") + "  :  " + cast2.MaxZ.ToString("f2") + ")";
                lb_mean2.Text = "Center of Mass: " +
                                cast2.Mean.X.ToString("f9") + " , " +
                                cast2.Mean.Y.ToString("f9") + " , " +
                                cast2.Mean.Z.ToString("f9");
                lb_averageVertexDistance2.Text = "Average Vertex Distance: " + cast2.averageVertexDistance.ToString("f2");
            }
        }