# Unable to change color to edges in Meshes/SolidClip example

**URL:** <https://discourse.vtk.org/t/unable-to-change-color-to-edges-in-meshes-solidclip-example/3367>\
**Category:** Development\
**Created:** [May 22, 2020, 4:37am UTC](https://discourse.vtk.org/t/unable-to-change-color-to-edges-in-meshes-solidclip-example/3367 "2020-05-22T04:37:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jhlegarreta/32/27_2.png) [@jhlegarreta](https://discourse.vtk.org/u/jhlegarreta)\
**Post date:** [May 22, 2020, 4:37am UTC](https://discourse.vtk.org/t/unable-to-change-color-to-edges-in-meshes-solidclip-example/3367/1 "2020-05-22T04:37:43Z")

</div>

Folks,  
I am wondering how to change the color for the edges computed by the clipping plane in the [Meshes/SolidClip example](https://github.com/lorensen/VTKExamples/blob/master/src/Cxx/Meshes/SolidClip.cxx).

I went through the [vtkFeatureEdges documentaton](https://vtk.org/doc/nightly/html/classvtkFeatureEdges.html#details) but did not succeed in changing the color even if I set the `SetScalarModeToUseCellData` option to the mapper.

Also, I’ve realized that for another dataset that I have, the edges are colored in blue. I assume that this is a consequence of a different type of edge that the clipper is computing for that dataset and providing as the output for the `vtkFeatureEdges` class.

Not sure how the color corresponding to each type matches the [scalar variable](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Filters/Core/vtkFeatureEdges.cxx#L247) (if that is the variable that controls the color at least).

Additionally I would like to be able to change the size/width of the edge. Not sure if that makes sense for the `vtkFeatureEdge` type of object, or whether I would need to transform the object somehow into another construct to do that.

Any pointer would be appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jhlegarreta/32/27_2.png) [@jhlegarreta](https://discourse.vtk.org/u/jhlegarreta)\
**Post date:** [May 22, 2020, 7:21pm UTC](https://discourse.vtk.org/t/unable-to-change-color-to-edges-in-meshes-solidclip-example/3367/2 "2020-05-22T19:21:10Z")

</div>

I found the way to color the edges. The key was to turn off the coloring for the `vtkFeatureEdges` instance.

I also found the way to change the line width.

For the mentioned example, and assuming that we remove setting the backface property:

```auto
(...)

vtkNew<vtkNamedColors> colors;

# Edges
featureEdges = vtkNew<vtkFeatureEdges>;
featureEdges->SetInputConnection(clipper->GetOutputPort());
featureEdges->BoundaryEdgesOn();
featureEdges->FeatureEdgesOff();
featureEdges->ManifoldEdgesOff();
featureEdges->NonManifoldEdgesOff();
featureEdges->ColoringOff();
featureEdges->Update();

# Visualize
edgeMapper = vtkNew<vtkPolyDataMapper>;
edgeMapper->SetInputConnection(featureEdges->GetOutputPort());
edgeMapper->SetScalarModeToUseCellData();
edgeActor = vtkNew<vtkActor>;
edgeActor->SetMapper(edgeMapper);

edgeActor->GetProperty()->SetColor(colors->GetColor3d("Blue").GetData());
edgeActor->GetProperty()->SetLineWidth(4.5)

(...)

renderer->AddActor(edgeActor);

(...)

```

So the question is answered.
