Beispiel #1
0
        private static void ClosedSurface()
        {
            // Create a sphere
            vtkSphereSource sphereSource = vtkSphereSource.New();

            sphereSource.Update();

            vtkFeatureEdges featureEdges = vtkFeatureEdges.New();

            featureEdges.FeatureEdgesOff();
            featureEdges.BoundaryEdgesOn();
            featureEdges.NonManifoldEdgesOn();
            featureEdges.SetInputConnection(sphereSource.GetOutputPort());
            featureEdges.Update();

            int numberOfOpenEdges = featureEdges.GetOutput().GetNumberOfCells();

            if (numberOfOpenEdges > 0)
            {
                Console.WriteLine("Surface is not closed");
            }
            else
            {
                Console.WriteLine("Surface is closed");
            }
            // nothing to show graphically
            Console.WriteLine("\nPress any key to continue...");
            Console.ReadKey();
        }
Beispiel #2
0
        public void ExtractFeatures()
        {
            Filter = vtkDataSetSurfaceFilter.New();
            Filter.SetInput(Grid);
            Filter.Update();
            Faces = Filter.GetOutput();

            vtkFeatureEdges FeatureEdges = vtkFeatureEdges.New();

            FeatureEdges.SetInput(Filter.GetOutput());
            FeatureEdges.Update();

            FeatureEdges.BoundaryEdgesOn();
            FeatureEdges.FeatureEdgesOn();
            FeatureEdges.ManifoldEdgesOn();
            FeatureEdges.NonManifoldEdgesOn();

            // Change Edge color
            FeatureEdges.SetColoring(0);

            // Update
            FeatureEdges.Update();

            vtkPolyDataMapper EdgeMapper = vtkPolyDataMapper.New();

            EdgeMapper.SetInput(FeatureEdges.GetOutput());
            EdgeMapper.ScalarVisibilityOff();

            Edges.SetMapper(EdgeMapper);
            Edges.GetProperty().SetEdgeColor(0, 0, 0);
            Edges.GetProperty().SetColor(0.0, 0.0, 0.0);
            Edges.GetProperty().SetLineWidth((float)1.0);   // Set default edge thickness
            Edges.SetVisibility(0);
        }