Exemple #1
0
        private void component_Click(object sender, EventArgs e)
        {
            if (Mesh == null)
            {
                return;
            }

            if (meshes != null)
            {
                return;
            }

            meshes = TriMeshModify.SeperateComponent(Mesh);
            ToolStripMenuItem item = ((ToolStripMenuItem)sender);

            item.DropDownItems.Clear();

            int num = TriMeshUtil.CountComponents(Mesh, false);

            for (int i = 0; i < num; i++)
            {
                ToolStripMenuItem subitem = new ToolStripMenuItem();
                subitem.Name   = i.ToString() + "ToolStripMenuItem";
                subitem.Text   = "Component " + i.ToString();
                subitem.Tag    = i;
                subitem.Click += Component_Click;
                item.DropDownItems.Add(subitem);
            }
        }
Exemple #2
0
        public static string BuildStatus(TriMesh mesh)
        {
            if (mesh == null)
            {
                return(null);
            }
            string status = "Name: " + mesh.FileName;

            status += "    Vertice: " + mesh.Vertices.Count;
            status += "    Edges: " + mesh.Edges.Count;
            status += "    Faces: " + mesh.Faces.Count;
            status += "    Boundaries: " + TriMeshUtil.CountBoundary(mesh).ToString();
            status += "    Genus: " + TriMeshUtil.CountGenus(mesh).ToString();
            status += "    Component: " + TriMeshUtil.CountComponents(mesh, false).ToString();
            status += "    Euler: " + CountEulerCharacteristic(mesh).ToString();
            status += "    Area: " + ComputeAreaTotal(mesh).ToString();
            status += "    Volumen: " + ComputeVolume(mesh).ToString();
            status += "    Radius: " + ComputeBoundingSphere(mesh).Radius.ToString();

            return(status);
        }
Exemple #3
0
 private void colorComponentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     TriMeshUtil.CountComponents(Mesh, true);
     OnChanged(EventArgs.Empty);
 }